Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
4daae301
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,发现更多精彩内容 >>
提交
4daae301
编写于
10月 06, 2011
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libpng15] #ifdef out png_progressive_combine_row() when interlacing is
not supported.
上级
d5bc89ef
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
12 deletion
+45
-12
example.c
example.c
+8
-1
png.h
png.h
+7
-5
pngpread.c
pngpread.c
+16
-5
pngvalid.c
pngvalid.c
+14
-1
未找到文件。
example.c
浏览文件 @
4daae301
...
...
@@ -2,7 +2,7 @@
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
* Last changed in libpng 1.5.
4 [July 7, 2011
]
* Last changed in libpng 1.5.
6 [(PENDING RELEASE)
]
* This file has been placed in the public domain by the authors.
* Maintained 1998-2011 Glenn Randers-Pehrson
* Maintained 1996, 1997 Andreas Dilger)
...
...
@@ -341,11 +341,16 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
/* Add filler (or alpha) byte (before/after each RGB triplet) */
png_set_filler
(
png_ptr
,
0xff
,
PNG_FILLER_AFTER
);
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Turn on interlace handling. REQUIRED if you are not using
* png_read_image(). To see how to handle interlacing passes,
* see the png_read_row() method below:
*/
number_passes
=
png_set_interlace_handling
(
png_ptr
);
#else
number_passes
=
1
;
#endif
/* PNG_READ_INTERLACING_SUPPORTED */
/* Optional call to gamma correct and add the background to the palette
* and update info structure. REQUIRED if you are expecting libpng to
...
...
@@ -527,6 +532,7 @@ row_callback(png_structp png_ptr, png_bytep new_row,
*/
png_bytep
old_row
=
((
png_bytep
*
)
our_data
)[
row_num
];
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* If both rows are allocated then copy the new row
* data to the corresponding row data.
*/
...
...
@@ -555,6 +561,7 @@ row_callback(png_structp png_ptr, png_bytep new_row,
* to pass the current row as new_row, and the function will combine
* the old row and the new row.
*/
#endif
/* PNG_READ_INTERLACING_SUPPORTED */
}
end_callback
(
png_structp
png_ptr
,
png_infop
info
)
...
...
png.h
浏览文件 @
4daae301
/* png.h - header file for PNG reference library
*
* libpng version 1.5.6beta05 - October
5
, 2011
* libpng version 1.5.6beta05 - October
7
, 2011
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
...
...
@@ -11,7 +11,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.5.6beta05 - October
5
, 2011: Glenn
* libpng versions 0.97, January 1998, through 1.5.6beta05 - October
7
, 2011: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
...
...
@@ -192,7 +192,7 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.5.6beta05, October
5
, 2011, are
* libpng versions 1.2.6, August 15, 2004, through 1.5.6beta05, October
7
, 2011, are
* Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
...
...
@@ -304,7 +304,7 @@
* Y2K compliance in libpng:
* =========================
*
* October
5
, 2011
* October
7
, 2011
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
...
...
@@ -367,7 +367,7 @@
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.5.6beta05"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.5.6beta05 - October
5
, 2011\n"
" libpng version 1.5.6beta05 - October
7
, 2011\n"
#define PNG_LIBPNG_VER_SONUM 15
#define PNG_LIBPNG_VER_DLLNUM 15
...
...
@@ -1831,6 +1831,7 @@ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structp, int save));
*/
PNG_EXPORT
(
220
,
png_uint_32
,
png_process_data_skip
,
(
png_structp
));
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Function that combines rows. 'new_row' is a flag that should come from
* the callback and be non-NULL if anything needs to be done; the library
* stores its own version of the new data internally and ignores the passed
...
...
@@ -1838,6 +1839,7 @@ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structp));
*/
PNG_EXPORT
(
93
,
void
,
png_progressive_combine_row
,
(
png_structp
png_ptr
,
png_bytep
old_row
,
png_const_bytep
new_row
));
#endif
/* PNG_READ_INTERLACING_SUPPORTED */
#endif
/* PNG_PROGRESSIVE_READ_SUPPORTED */
PNG_EXPORTA
(
94
,
png_voidp
,
png_malloc
,
...
...
pngpread.c
浏览文件 @
4daae301
...
...
@@ -239,8 +239,16 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
chunk_name
=
png_ptr
->
chunk_name
;
if
(
chunk_name
==
png_IDAT
)
{
/* This is here above the if/else case statement below because if the
* unknown handling marks 'IDAT' as unknown then the IDAT handling case is
* completely skipped.
*
* TODO: there must be a better way of doing this.
*/
if
(
png_ptr
->
mode
&
PNG_AFTER_IDAT
)
png_ptr
->
mode
|=
PNG_HAVE_CHUNK_AFTER_IDAT
;
}
if
(
chunk_name
==
png_IHDR
)
{
...
...
@@ -1795,19 +1803,22 @@ png_push_have_row(png_structp png_ptr, png_bytep row)
(
int
)
png_ptr
->
pass
);
}
#ifdef PNG_READ_INTERLACING_SUPPORTED
void
PNGAPI
png_progressive_combine_row
(
png_structp
png_ptr
,
png_bytep
old_row
,
png_const_bytep
new_row
)
{
static
PNG_CONST
png_byte
FARDATA
png_pass_dsp_mask
[
7
]
=
{
0xff
,
0x0f
,
0xff
,
0x33
,
0xff
,
0x55
,
0xff
};
if
(
png_ptr
==
NULL
)
return
;
if
(
new_row
!=
NULL
)
/* new_row must == png_ptr->row_buf here. */
png_combine_row
(
png_ptr
,
old_row
,
png_pass_dsp_mask
[
png_ptr
->
pass
]);
/* new_row is a flag here - if it is NULL then the app callback was called
* from an empty row (see the calls to png_struct::row_fn below), otherwise
* it must be png_ptr->row_buf+1
*/
if
(
new_row
!=
NULL
)
png_combine_row
(
png_ptr
,
old_row
,
1
/*display*/
);
}
#endif
/* PNG_READ_INTERLACING_SUPPORTED */
void
PNGAPI
png_set_progressive_read_fn
(
png_structp
png_ptr
,
png_voidp
progressive_ptr
,
...
...
pngvalid.c
浏览文件 @
4daae301
...
...
@@ -4330,6 +4330,7 @@ progressive_row(png_structp pp, png_bytep new_row, png_uint_32 y, int pass)
row
=
store_image_row
(
dp
->
ps
,
pp
,
0
,
y
);
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Combine the new row into the old: */
if
(
dp
->
do_interlace
)
{
...
...
@@ -4344,6 +4345,7 @@ progressive_row(png_structp pp, png_bytep new_row, png_uint_32 y, int pass)
PNG_ROW_IN_INTERLACE_PASS
(
y
,
pass
)
&&
PNG_PASS_COLS
(
dp
->
w
,
pass
)
>
0
)
png_error
(
pp
,
"missing row in progressive de-interlacing"
);
#endif
/* PNG_READ_INTERLACING_SUPPORTED */
}
static
void
...
...
@@ -4549,6 +4551,8 @@ standard_test(png_store* PNG_CONST psIn, png_uint_32 PNG_CONST id,
*/
if
(
!
d
.
speed
)
standard_image_validate
(
&
d
,
pp
,
0
,
1
);
else
d
.
ps
->
validated
=
1
;
}
}
...
...
@@ -5488,7 +5492,10 @@ transform_end(png_structp pp, png_infop pi)
transform_display
*
dp
=
voidcast
(
transform_display
*
,
png_get_progressive_ptr
(
pp
));
transform_image_validate
(
dp
,
pp
,
pi
);
if
(
!
dp
->
this
.
speed
)
transform_image_validate
(
dp
,
pp
,
pi
);
else
dp
->
this
.
ps
->
validated
=
1
;
}
/* A single test run. */
...
...
@@ -5561,6 +5568,8 @@ transform_test(png_modifier *pmIn, PNG_CONST png_uint_32 idIn,
if
(
!
d
.
this
.
speed
)
transform_image_validate
(
&
d
,
pp
,
pi
);
else
d
.
this
.
ps
->
validated
=
1
;
}
modifier_reset
(
d
.
pm
);
...
...
@@ -8080,6 +8089,8 @@ gamma_end(png_structp pp, png_infop pi)
if
(
!
dp
->
this
.
speed
)
gamma_image_validate
(
dp
,
pp
,
pi
);
else
dp
->
this
.
ps
->
validated
=
1
;
}
/* A single test run checking a gamma transformation.
...
...
@@ -8161,6 +8172,8 @@ gamma_test(png_modifier *pmIn, PNG_CONST png_byte colour_typeIn,
if
(
!
d
.
this
.
speed
)
gamma_image_validate
(
&
d
,
pp
,
pi
);
else
d
.
this
.
ps
->
validated
=
1
;
}
modifier_reset
(
d
.
pm
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录