Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
8bfcb4c7
T
Third Party Libpng
项目概览
OpenHarmony
/
Third Party Libpng
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
8bfcb4c7
编写于
9月 18, 2015
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libpng16] Copied contrib/libtests/pngvalid.c from libpng17.
上级
eb0bf4f4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
14 deletion
+17
-14
contrib/libtests/pngvalid.c
contrib/libtests/pngvalid.c
+17
-14
未找到文件。
contrib/libtests/pngvalid.c
浏览文件 @
8bfcb4c7
/* pngvalid.c - validate libpng by constructing then reading png files.
*
* Last changed in libpng 1.6.1
9
[(PENDING RELEASE)]
* Last changed in libpng 1.6.1
8
[(PENDING RELEASE)]
* Copyright (c) 2014-2015 Glenn Randers-Pehrson
* Written by John Cunningham Bowler
*
...
...
@@ -5661,10 +5661,13 @@ image_pixel_convert_PLTE(image_pixel *this)
/* Add an alpha channel; this will import the tRNS information because tRNS is
* not valid in an alpha image. The bit depth will invariably be set to at
* least 8 prior to 1.7.0. Palette images will be converted to alpha (using
* the above API).
* the above API). With png_set_background the alpha channel is never expanded
* but this routine is used by pngvalid to simplify code; 'for_background'
* records this.
*/
static
void
image_pixel_add_alpha
(
image_pixel
*
this
,
const
standard_display
*
display
)
image_pixel_add_alpha
(
image_pixel
*
this
,
const
standard_display
*
display
,
int
for_background
)
{
if
(
this
->
colour_type
==
PNG_COLOR_TYPE_PALETTE
)
image_pixel_convert_PLTE
(
this
);
...
...
@@ -5674,7 +5677,7 @@ image_pixel_add_alpha(image_pixel *this, const standard_display *display)
if
(
this
->
colour_type
==
PNG_COLOR_TYPE_GRAY
)
{
# if PNG_LIBPNG_VER < 10700
if
(
this
->
bit_depth
<
8
)
if
(
!
for_background
&&
this
->
bit_depth
<
8
)
this
->
bit_depth
=
this
->
sample_depth
=
8
;
# endif
...
...
@@ -5684,7 +5687,7 @@ image_pixel_add_alpha(image_pixel *this, const standard_display *display)
* tRNS chunk to expand at this point.
*/
# if PNG_LIBPNG_VER >= 10700
if
(
this
->
bit_depth
<
8
)
if
(
!
for_background
&&
this
->
bit_depth
<
8
)
this
->
bit_depth
=
this
->
sample_depth
=
8
;
# endif
...
...
@@ -6574,7 +6577,7 @@ image_transform_png_set_tRNS_to_alpha_mod(const image_transform *this,
if
(
that
->
colour_type
!=
PNG_COLOR_TYPE_PALETTE
&&
(
that
->
colour_type
&
PNG_COLOR_MASK_ALPHA
)
==
0
)
# endif
image_pixel_add_alpha
(
that
,
&
display
->
this
);
image_pixel_add_alpha
(
that
,
&
display
->
this
,
0
/*!for background*/
);
#if PNG_LIBPNG_VER < 10700
/* LIBPNG BUG: otherwise libpng still expands to 8 bits! */
...
...
@@ -6601,8 +6604,8 @@ image_transform_png_set_tRNS_to_alpha_add(image_transform *this,
/* We don't know yet whether there will be a tRNS chunk, but we know that
* this transformation should do nothing if there already is an alpha
* channel. In addition, after the bug fix in 1.7.0, there is no longer
any
* action on a palette image.
* channel. In addition, after the bug fix in 1.7.0, there is no longer
* a
ny a
ction on a palette image.
*/
return
# if PNG_LIBPNG_VER >= 10700
...
...
@@ -6638,7 +6641,7 @@ image_transform_png_set_gray_to_rgb_mod(const image_transform *this,
* doesn't do this, so we don't either.
*/
if
((
that
->
colour_type
&
PNG_COLOR_MASK_COLOR
)
==
0
&&
that
->
have_tRNS
)
image_pixel_add_alpha
(
that
,
&
display
->
this
);
image_pixel_add_alpha
(
that
,
&
display
->
this
,
0
/*!for background*/
);
/* Simply expand the bit depth and alter the colour type as required. */
if
(
that
->
colour_type
==
PNG_COLOR_TYPE_GRAY
)
...
...
@@ -6702,7 +6705,7 @@ image_transform_png_set_expand_mod(const image_transform *this,
that
->
sample_depth
=
that
->
bit_depth
=
8
;
if
(
that
->
have_tRNS
)
image_pixel_add_alpha
(
that
,
&
display
->
this
);
image_pixel_add_alpha
(
that
,
&
display
->
this
,
0
/*!for background*/
);
this
->
next
->
mod
(
this
->
next
,
that
,
pp
,
display
);
}
...
...
@@ -6812,7 +6815,7 @@ image_transform_png_set_expand_16_mod(const image_transform *this,
image_pixel_convert_PLTE
(
that
);
if
(
that
->
have_tRNS
)
image_pixel_add_alpha
(
that
,
&
display
->
this
);
image_pixel_add_alpha
(
that
,
&
display
->
this
,
0
/*!for background*/
);
if
(
that
->
bit_depth
<
16
)
that
->
sample_depth
=
that
->
bit_depth
=
16
;
...
...
@@ -7755,7 +7758,7 @@ image_transform_png_set_background_mod(const image_transform *this,
{
/* Check for tRNS first: */
if
(
that
->
have_tRNS
&&
that
->
colour_type
!=
PNG_COLOR_TYPE_PALETTE
)
image_pixel_add_alpha
(
that
,
&
display
->
this
);
image_pixel_add_alpha
(
that
,
&
display
->
this
,
1
/*for background*/
);
/* This is only necessary if the alpha value is less than 1. */
if
(
that
->
alphaf
<
1
)
...
...
@@ -11109,9 +11112,9 @@ int main(int argc, char **argv)
# endif
pm
.
test_lbg
=
0
;
pm
.
test_lbg_gamma_threshold
=
1
;
pm
.
test_lbg_gamma_transform
=
0
/*PNG_LIBPNG_VER >= 10700*/
;
pm
.
test_lbg_gamma_transform
=
PNG_LIBPNG_VER
>=
10600
;
pm
.
test_lbg_gamma_sbit
=
1
;
pm
.
test_lbg_gamma_composition
=
0
;
pm
.
test_lbg_gamma_composition
=
PNG_LIBPNG_VER
>=
1070
0
;
/* And the test encodings */
pm
.
encodings
=
test_encodings
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录