Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
983ec160
T
Third Party Libpng
项目概览
OpenHarmony
/
Third Party Libpng
接近 2 年 前同步成功
通知
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看板
提交
983ec160
编写于
3月 07, 1998
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Imported from libpng-0.99j.tar
上级
08a3343e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
24 deletion
+24
-24
pngrutil.c
pngrutil.c
+15
-15
pngtest.c
pngtest.c
+5
-5
pngwrite.c
pngwrite.c
+4
-4
未找到文件。
pngrutil.c
浏览文件 @
983ec160
...
@@ -1704,7 +1704,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1704,7 +1704,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
case
1
:
case
1
:
{
{
png_bytep
sp
,
dp
;
png_bytep
sp
,
dp
;
png_uint_32
sshift
,
dshift
;
int
sshift
,
dshift
;
int
s_start
,
s_end
,
s_inc
;
int
s_start
,
s_end
,
s_inc
;
png_byte
v
;
png_byte
v
;
png_uint_32
i
;
png_uint_32
i
;
...
@@ -1715,8 +1715,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1715,8 +1715,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
#if defined(PNG_READ_PACKSWAP_SUPPORTED)
#if defined(PNG_READ_PACKSWAP_SUPPORTED)
if
(
transformations
&
PNG_PACKSWAP
)
if
(
transformations
&
PNG_PACKSWAP
)
{
{
sshift
=
(
png_uint_32
)((
row_info
->
width
+
7
)
&
7
);
sshift
=
(
int
)((
row_info
->
width
+
7
)
&
7
);
dshift
=
(
png_uint_32
)((
final_width
+
7
)
&
7
);
dshift
=
(
int
)((
final_width
+
7
)
&
7
);
s_start
=
7
;
s_start
=
7
;
s_end
=
0
;
s_end
=
0
;
s_inc
=
-
1
;
s_inc
=
-
1
;
...
@@ -1724,8 +1724,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1724,8 +1724,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else
else
#endif
#endif
{
{
sshift
=
7
-
(
png_uint_32
)((
row_info
->
width
+
7
)
&
7
);
sshift
=
7
-
(
int
)((
row_info
->
width
+
7
)
&
7
);
dshift
=
7
-
(
png_uint_32
)((
final_width
+
7
)
&
7
);
dshift
=
7
-
(
int
)((
final_width
+
7
)
&
7
);
s_start
=
0
;
s_start
=
0
;
s_end
=
7
;
s_end
=
7
;
s_inc
=
1
;
s_inc
=
1
;
...
@@ -1759,7 +1759,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1759,7 +1759,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
case
2
:
case
2
:
{
{
png_bytep
sp
,
dp
;
png_bytep
sp
,
dp
;
png_uint_32
sshift
,
dshift
;
int
sshift
,
dshift
;
int
s_start
,
s_end
,
s_inc
;
int
s_start
,
s_end
,
s_inc
;
png_uint_32
i
;
png_uint_32
i
;
...
@@ -1768,8 +1768,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1768,8 +1768,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
#if defined(PNG_READ_PACKSWAP_SUPPORTED)
#if defined(PNG_READ_PACKSWAP_SUPPORTED)
if
(
transformations
&
PNG_PACKSWAP
)
if
(
transformations
&
PNG_PACKSWAP
)
{
{
sshift
=
(
png_uint_32
)(((
row_info
->
width
+
3
)
&
3
)
<<
1
);
sshift
=
(
int
)(((
row_info
->
width
+
3
)
&
3
)
<<
1
);
dshift
=
(
png_uint_32
)(((
final_width
+
3
)
&
3
)
<<
1
);
dshift
=
(
int
)(((
final_width
+
3
)
&
3
)
<<
1
);
s_start
=
6
;
s_start
=
6
;
s_end
=
0
;
s_end
=
0
;
s_inc
=
-
2
;
s_inc
=
-
2
;
...
@@ -1777,8 +1777,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1777,8 +1777,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else
else
#endif
#endif
{
{
sshift
=
(
png_uint_32
)((
3
-
((
row_info
->
width
+
3
)
&
3
))
<<
1
);
sshift
=
(
int
)((
3
-
((
row_info
->
width
+
3
)
&
3
))
<<
1
);
dshift
=
(
png_uint_32
)((
3
-
((
final_width
+
3
)
&
3
))
<<
1
);
dshift
=
(
int
)((
3
-
((
final_width
+
3
)
&
3
))
<<
1
);
s_start
=
0
;
s_start
=
0
;
s_end
=
6
;
s_end
=
6
;
s_inc
=
2
;
s_inc
=
2
;
...
@@ -1815,7 +1815,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1815,7 +1815,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
case
4
:
case
4
:
{
{
png_bytep
sp
,
dp
;
png_bytep
sp
,
dp
;
png_uint_32
sshift
,
dshift
;
int
sshift
,
dshift
;
int
s_start
,
s_end
,
s_inc
;
int
s_start
,
s_end
,
s_inc
;
png_uint_32
i
;
png_uint_32
i
;
...
@@ -1824,8 +1824,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1824,8 +1824,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
#if defined(PNG_READ_PACKSWAP_SUPPORTED)
#if defined(PNG_READ_PACKSWAP_SUPPORTED)
if
(
transformations
&
PNG_PACKSWAP
)
if
(
transformations
&
PNG_PACKSWAP
)
{
{
sshift
=
(
png_uint_32
)(((
row_info
->
width
+
1
)
&
1
)
<<
2
);
sshift
=
(
int
)(((
row_info
->
width
+
1
)
&
1
)
<<
2
);
dshift
=
(
png_uint_32
)(((
final_width
+
1
)
&
1
)
<<
2
);
dshift
=
(
int
)(((
final_width
+
1
)
&
1
)
<<
2
);
s_start
=
4
;
s_start
=
4
;
s_end
=
0
;
s_end
=
0
;
s_inc
=
-
4
;
s_inc
=
-
4
;
...
@@ -1833,8 +1833,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
...
@@ -1833,8 +1833,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else
else
#endif
#endif
{
{
sshift
=
(
png_uint_32
)((
1
-
((
row_info
->
width
+
1
)
&
1
))
<<
2
);
sshift
=
(
int
)((
1
-
((
row_info
->
width
+
1
)
&
1
))
<<
2
);
dshift
=
(
png_uint_32
)((
1
-
((
final_width
+
1
)
&
1
))
<<
2
);
dshift
=
(
int
)((
1
-
((
final_width
+
1
)
&
1
))
<<
2
);
s_start
=
0
;
s_start
=
0
;
s_end
=
4
;
s_end
=
4
;
s_inc
=
4
;
s_inc
=
4
;
...
...
pngtest.c
浏览文件 @
983ec160
...
@@ -54,7 +54,7 @@ static int status_dots=1;
...
@@ -54,7 +54,7 @@ static int status_dots=1;
void
read_row_callback
(
png_structp
png_ptr
,
png_uint_32
row_number
,
int
pass
);
void
read_row_callback
(
png_structp
png_ptr
,
png_uint_32
row_number
,
int
pass
);
void
read_row_callback
(
png_structp
png_ptr
,
png_uint_32
row_number
,
int
pass
)
void
read_row_callback
(
png_structp
png_ptr
,
png_uint_32
row_number
,
int
pass
)
{
{
if
(
png_ptr
==
NULL
||
row_number
>
0x3fffffff
)
return
;
if
(
png_ptr
==
NULL
||
row_number
>
0x3fffffff
L
)
return
;
if
(
status_pass
!=
pass
)
if
(
status_pass
!=
pass
)
{
{
fprintf
(
stdout
,
"
\n
Pass %d: "
,
pass
);
fprintf
(
stdout
,
"
\n
Pass %d: "
,
pass
);
...
@@ -72,7 +72,7 @@ void read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
...
@@ -72,7 +72,7 @@ void read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
void
write_row_callback
(
png_structp
png_ptr
,
png_uint_32
row_number
,
int
pass
);
void
write_row_callback
(
png_structp
png_ptr
,
png_uint_32
row_number
,
int
pass
);
void
write_row_callback
(
png_structp
png_ptr
,
png_uint_32
row_number
,
int
pass
)
void
write_row_callback
(
png_structp
png_ptr
,
png_uint_32
row_number
,
int
pass
)
{
{
if
(
png_ptr
==
NULL
||
row_number
>
0x3fffffff
||
pass
>
7
)
return
;
if
(
png_ptr
==
NULL
||
row_number
>
0x3fffffff
L
||
pass
>
7
)
return
;
fprintf
(
stdout
,
"w"
);
fprintf
(
stdout
,
"w"
);
}
}
...
@@ -106,7 +106,7 @@ void count_black_pixels(png_structp png_ptr, png_row_infop row_info,
...
@@ -106,7 +106,7 @@ void count_black_pixels(png_structp png_ptr, png_row_infop row_info,
{
{
int
pos
=
0
;
int
pos
=
0
;
png_uint_32
n
;
png_uint_32
n
;
for
(
n
=
0
;
n
<
(
int
)
row_info
->
width
;
n
++
)
for
(
n
=
0
;
n
<
row_info
->
width
;
n
++
)
{
{
if
(
row_info
->
bit_depth
==
1
)
if
(
row_info
->
bit_depth
==
1
)
if
(((
*
dp
<<
pos
++
)
&
0x80
)
==
0
)
black_pixels
++
;
if
(((
*
dp
<<
pos
++
)
&
0x80
)
==
0
)
black_pixels
++
;
...
@@ -869,8 +869,8 @@ int test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
...
@@ -869,8 +869,8 @@ int test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
PNG_CONST
char
*
inname
=
"pngtest/png"
;
PNG_CONST
char
*
inname
=
"pngtest/png"
;
PNG_CONST
char
*
outname
=
"pngout/png"
;
PNG_CONST
char
*
outname
=
"pngout/png"
;
#else
#else
static
char
*
inname
=
"pngtest.png"
;
static
PNG_CONST
char
*
inname
=
"pngtest.png"
;
static
char
*
outname
=
"pngout.png"
;
static
PNG_CONST
char
*
outname
=
"pngout.png"
;
#endif
#endif
int
int
...
...
pngwrite.c
浏览文件 @
983ec160
...
@@ -834,10 +834,10 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
...
@@ -834,10 +834,10 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
if
(
png_ptr
->
filter_weights
==
NULL
)
if
(
png_ptr
->
filter_weights
==
NULL
)
{
{
png_ptr
->
filter_weights
=
png_malloc
(
png_ptr
,
png_ptr
->
filter_weights
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
sizeof
(
png_uint_16
)
*
num_weights
));
(
png_uint_32
)(
sizeof
(
png_uint_16
)
*
num_weights
));
png_ptr
->
inv_filter_weights
=
png_malloc
(
png_ptr
,
png_ptr
->
inv_filter_weights
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
sizeof
(
png_uint_16
)
*
num_weights
));
(
png_uint_32
)(
sizeof
(
png_uint_16
)
*
num_weights
));
for
(
i
=
0
;
i
<
num_weights
;
i
++
)
for
(
i
=
0
;
i
<
num_weights
;
i
++
)
...
@@ -869,10 +869,10 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
...
@@ -869,10 +869,10 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
*/
*/
if
(
png_ptr
->
filter_costs
==
NULL
)
if
(
png_ptr
->
filter_costs
==
NULL
)
{
{
png_ptr
->
filter_costs
=
png_malloc
(
png_ptr
,
png_ptr
->
filter_costs
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
sizeof
(
png_uint_16
)
*
PNG_FILTER_VALUE_LAST
));
(
png_uint_32
)(
sizeof
(
png_uint_16
)
*
PNG_FILTER_VALUE_LAST
));
png_ptr
->
inv_filter_costs
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
png_ptr
->
inv_filter_costs
=
(
png_uint_16p
)
png_malloc
(
png_ptr
,
(
png_uint_32
)(
sizeof
(
png_uint_16
)
*
PNG_FILTER_VALUE_LAST
));
(
png_uint_32
)(
sizeof
(
png_uint_16
)
*
PNG_FILTER_VALUE_LAST
));
for
(
i
=
0
;
i
<
PNG_FILTER_VALUE_LAST
;
i
++
)
for
(
i
=
0
;
i
<
PNG_FILTER_VALUE_LAST
;
i
++
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录