Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
3df324d8
T
Third Party Libpng
项目概览
OpenHarmony
/
Third Party Libpng
11 个月 前同步成功
通知
4
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Libpng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3df324d8
编写于
7月 31, 2010
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[devel] Expanded TAB characters, again.
上级
c27291d4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
102 addition
and
102 deletion
+102
-102
png.c
png.c
+45
-45
pngget.c
pngget.c
+1
-1
pngpread.c
pngpread.c
+1
-1
pngrutil.c
pngrutil.c
+2
-2
pngwrite.c
pngwrite.c
+53
-53
未找到文件。
png.c
浏览文件 @
3df324d8
...
...
@@ -1402,49 +1402,49 @@ png_ascii_from_fixed(png_structp png_ptr, png_charp ascii, png_size_t size,
if
(
num
<=
0x80000000U
)
/* else overflowed */
{
unsigned
ndigits
=
0
,
first
=
16
/*flag value*/
;
unsigned
ndigits
=
0
,
first
=
16
/*flag value*/
;
char
digits
[
10
];
while
(
num
)
{
/* Split the low digit off num: */
unsigned
tmp
=
num
/
10
;
num
-=
tmp
*
10
;
digits
[
ndigits
++
]
=
(
char
)(
48
+
num
);
/* Record the first non-zero digit, note that this is a number
* starting at 1, it's not actually the array index.
*/
if
(
first
==
16
&&
num
>
0
)
first
=
ndigits
;
num
=
tmp
;
}
if
(
ndigits
>
0
)
{
while
(
ndigits
>
5
)
*
ascii
++
=
digits
[
--
ndigits
];
/* The remaining digits are fractional digits, ndigits is '5' or
* smaller at this point. It is certainly not zero. Check for a
* non-zero fractional digit:
*/
if
(
first
<=
5
)
{
unsigned
i
;
*
ascii
++
=
46
;
/* decimal point */
/* ndigits may be <5 for small numbers, output leading zeros then
* ndigits digits to first:
*/
i
=
5
;
while
(
ndigits
<
i
)
*
ascii
++
=
48
,
--
i
;
while
(
ndigits
>=
first
)
*
ascii
++
=
digits
[
--
ndigits
];
/* Don't output the trailing zeros! */
}
}
else
*
ascii
++
=
48
;
/* And null terminate the string: */
*
ascii
=
0
;
return
;
while
(
num
)
{
/* Split the low digit off num: */
unsigned
tmp
=
num
/
10
;
num
-=
tmp
*
10
;
digits
[
ndigits
++
]
=
(
char
)(
48
+
num
);
/* Record the first non-zero digit, note that this is a number
* starting at 1, it's not actually the array index.
*/
if
(
first
==
16
&&
num
>
0
)
first
=
ndigits
;
num
=
tmp
;
}
if
(
ndigits
>
0
)
{
while
(
ndigits
>
5
)
*
ascii
++
=
digits
[
--
ndigits
];
/* The remaining digits are fractional digits, ndigits is '5' or
* smaller at this point. It is certainly not zero. Check for a
* non-zero fractional digit:
*/
if
(
first
<=
5
)
{
unsigned
i
;
*
ascii
++
=
46
;
/* decimal point */
/* ndigits may be <5 for small numbers, output leading zeros then
* ndigits digits to first:
*/
i
=
5
;
while
(
ndigits
<
i
)
*
ascii
++
=
48
,
--
i
;
while
(
ndigits
>=
first
)
*
ascii
++
=
digits
[
--
ndigits
];
/* Don't output the trailing zeros! */
}
}
else
*
ascii
++
=
48
;
/* And null terminate the string: */
*
ascii
=
0
;
return
;
}
}
...
...
@@ -2020,8 +2020,8 @@ png_gamma_8bit_correct(unsigned value, png_fixed_point gamma)
if
(
png_muldiv
(
&
res
,
gamma
,
log
,
PNG_FP_1
))
return
png_exp8bit
(
res
);
/* Overflow. */
value
=
0
;
/* Overflow. */
value
=
0
;
# endif
}
...
...
@@ -2043,8 +2043,8 @@ png_gamma_16bit_correct(unsigned value, png_fixed_point gamma)
if
(
png_muldiv
(
&
res
,
gamma
,
log
,
PNG_FP_1
))
return
png_exp16bit
(
res
);
/* Overflow. */
value
=
0
;
/* Overflow. */
value
=
0
;
# endif
}
...
...
pngget.c
浏览文件 @
3df324d8
...
...
@@ -216,7 +216,7 @@ png_get_pixel_aspect_ratio_fixed(png_structp png_ptr, png_infop info_ptr)
if
(
png_muldiv
(
&
res
,
info_ptr
->
y_pixels_per_unit
,
PNG_FP_1
,
info_ptr
->
x_pixels_per_unit
))
return
res
;
return
res
;
}
#endif
return
0
;
...
...
pngpread.c
浏览文件 @
3df324d8
...
...
@@ -1214,7 +1214,7 @@ png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
{
info_ptr
=
info_ptr
;
/* To quiet some compiler warnings */
png_error
(
png_ptr
,
"Out of place tEXt"
);
/*NOT REACHED*/
/*NOT REACHED*/
}
#ifdef PNG_MAX_MALLOC_64K
...
...
pngrutil.c
浏览文件 @
3df324d8
...
...
@@ -3075,8 +3075,8 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row,
}
default:
png_error
(
png_ptr
,
"Ignoring bad adaptive filter type"
);
/*NOT REACHED */
break
;
/*NOT REACHED */
break
;
}
}
...
...
pngwrite.c
浏览文件 @
3df324d8
...
...
@@ -1228,20 +1228,20 @@ png_init_filter_heuristics(png_structp png_ptr, int heuristic_method,
png_ptr
->
prev_filters
[
i
]
=
255
;
}
png_ptr
->
filter_weights
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
png_sizeof
(
png_uint_16
)
*
num_weights
));
png_ptr
->
filter_weights
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
png_sizeof
(
png_uint_16
)
*
num_weights
));
png_ptr
->
inv_filter_weights
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
png_sizeof
(
png_uint_16
)
*
num_weights
));
png_ptr
->
inv_filter_weights
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
png_sizeof
(
png_uint_16
)
*
num_weights
));
for
(
i
=
0
;
i
<
num_weights
;
i
++
)
{
png_ptr
->
inv_filter_weights
[
i
]
=
png_ptr
->
filter_weights
[
i
]
=
PNG_WEIGHT_FACTOR
;
}
for
(
i
=
0
;
i
<
num_weights
;
i
++
)
{
png_ptr
->
inv_filter_weights
[
i
]
=
png_ptr
->
filter_weights
[
i
]
=
PNG_WEIGHT_FACTOR
;
}
/* Safe to set this now */
png_ptr
->
num_prev_filters
=
(
png_byte
)
num_weights
;
/* Safe to set this now */
png_ptr
->
num_prev_filters
=
(
png_byte
)
num_weights
;
}
/* If, in the future, there are other filter methods, this would
...
...
@@ -1249,17 +1249,17 @@ png_init_filter_heuristics(png_structp png_ptr, int heuristic_method,
*/
if
(
png_ptr
->
filter_costs
==
NULL
)
{
png_ptr
->
filter_costs
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
png_sizeof
(
png_uint_16
)
*
PNG_FILTER_VALUE_LAST
));
png_ptr
->
filter_costs
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
png_sizeof
(
png_uint_16
)
*
PNG_FILTER_VALUE_LAST
));
png_ptr
->
inv_filter_costs
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
png_sizeof
(
png_uint_16
)
*
PNG_FILTER_VALUE_LAST
));
png_ptr
->
inv_filter_costs
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
png_sizeof
(
png_uint_16
)
*
PNG_FILTER_VALUE_LAST
));
}
for
(
i
=
0
;
i
<
PNG_FILTER_VALUE_LAST
;
i
++
)
{
png_ptr
->
inv_filter_costs
[
i
]
=
png_ptr
->
filter_costs
[
i
]
=
PNG_COST_FACTOR
;
png_ptr
->
inv_filter_costs
[
i
]
=
png_ptr
->
filter_costs
[
i
]
=
PNG_COST_FACTOR
;
}
/* All the arrays are inited, safe to set this: */
...
...
@@ -1300,20 +1300,20 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
int
i
;
for
(
i
=
0
;
i
<
num_weights
;
i
++
)
{
if
(
filter_weights
[
i
]
<=
0
.
0
)
{
png_ptr
->
inv_filter_weights
[
i
]
=
png_ptr
->
filter_weights
[
i
]
=
PNG_WEIGHT_FACTOR
;
}
else
{
png_ptr
->
inv_filter_weights
[
i
]
=
(
png_uint_16
)(
PNG_WEIGHT_FACTOR
*
filter_weights
[
i
]
+
.
5
);
png_ptr
->
filter_weights
[
i
]
=
(
png_uint_16
)(
PNG_WEIGHT_FACTOR
/
filter_weights
[
i
]
+
.
5
);
}
if
(
filter_weights
[
i
]
<=
0
.
0
)
{
png_ptr
->
inv_filter_weights
[
i
]
=
png_ptr
->
filter_weights
[
i
]
=
PNG_WEIGHT_FACTOR
;
}
else
{
png_ptr
->
inv_filter_weights
[
i
]
=
(
png_uint_16
)(
PNG_WEIGHT_FACTOR
*
filter_weights
[
i
]
+
.
5
);
png_ptr
->
filter_weights
[
i
]
=
(
png_uint_16
)(
PNG_WEIGHT_FACTOR
/
filter_weights
[
i
]
+
.
5
);
}
}
/* Here is where we set the relative costs of the different filters. We
...
...
@@ -1325,11 +1325,11 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
*/
for
(
i
=
0
;
i
<
PNG_FILTER_VALUE_LAST
;
i
++
)
if
(
filter_costs
[
i
]
>=
1
.
0
)
{
png_ptr
->
inv_filter_costs
[
i
]
=
(
png_uint_16
)(
PNG_COST_FACTOR
/
filter_costs
[
i
]
+
.
5
);
png_ptr
->
inv_filter_costs
[
i
]
=
(
png_uint_16
)(
PNG_COST_FACTOR
/
filter_costs
[
i
]
+
.
5
);
png_ptr
->
filter_costs
[
i
]
=
(
png_uint_16
)(
PNG_COST_FACTOR
*
filter_costs
[
i
]
+
.
5
);
png_ptr
->
filter_costs
[
i
]
=
(
png_uint_16
)(
PNG_COST_FACTOR
*
filter_costs
[
i
]
+
.
5
);
}
}
}
...
...
@@ -1355,20 +1355,20 @@ png_set_filter_heuristics_fixed(png_structp png_ptr, int heuristic_method,
int
i
;
for
(
i
=
0
;
i
<
num_weights
;
i
++
)
{
if
(
filter_weights
[
i
]
<=
0
)
{
png_ptr
->
inv_filter_weights
[
i
]
=
png_ptr
->
filter_weights
[
i
]
=
PNG_WEIGHT_FACTOR
;
}
else
{
png_ptr
->
inv_filter_weights
[
i
]
=
(
png_uint_16
)
((
PNG_WEIGHT_FACTOR
*
filter_weights
[
i
]
+
PNG_FP_HALF
)
/
PNG_FP_1
);
png_ptr
->
filter_weights
[
i
]
=
(
png_uint_16
)((
PNG_WEIGHT_FACTOR
*
PNG_FP_1
+
(
filter_weights
[
i
]
/
2
))
/
filter_weights
[
i
]);
}
if
(
filter_weights
[
i
]
<=
0
)
{
png_ptr
->
inv_filter_weights
[
i
]
=
png_ptr
->
filter_weights
[
i
]
=
PNG_WEIGHT_FACTOR
;
}
else
{
png_ptr
->
inv_filter_weights
[
i
]
=
(
png_uint_16
)
((
PNG_WEIGHT_FACTOR
*
filter_weights
[
i
]
+
PNG_FP_HALF
)
/
PNG_FP_1
);
png_ptr
->
filter_weights
[
i
]
=
(
png_uint_16
)((
PNG_WEIGHT_FACTOR
*
PNG_FP_1
+
(
filter_weights
[
i
]
/
2
))
/
filter_weights
[
i
]);
}
}
/* Here is where we set the relative costs of the different filters. We
...
...
@@ -1381,11 +1381,11 @@ png_set_filter_heuristics_fixed(png_structp png_ptr, int heuristic_method,
for
(
i
=
0
;
i
<
PNG_FILTER_VALUE_LAST
;
i
++
)
if
(
filter_costs
[
i
]
>=
PNG_FP_1
)
{
png_ptr
->
inv_filter_costs
[
i
]
=
(
png_uint_16
)((
PNG_COST_FACTOR
*
PNG_FP_1
+
(
filter_costs
[
i
]
/
2
))
/
filter_costs
[
i
]);
png_ptr
->
inv_filter_costs
[
i
]
=
(
png_uint_16
)((
PNG_COST_FACTOR
*
PNG_FP_1
+
(
filter_costs
[
i
]
/
2
))
/
filter_costs
[
i
]);
png_ptr
->
filter_costs
[
i
]
=
(
png_uint_16
)
((
PNG_COST_FACTOR
*
filter_costs
[
i
]
+
PNG_FP_HALF
)
/
PNG_FP_1
);
png_ptr
->
filter_costs
[
i
]
=
(
png_uint_16
)
((
PNG_COST_FACTOR
*
filter_costs
[
i
]
+
PNG_FP_HALF
)
/
PNG_FP_1
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录