[libpng16] Make builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail).

This commit is contained in:
John Bowler 2012-10-26 08:29:45 -05:00 committed by Glenn Randers-Pehrson
parent f8dfd123e2
commit f0fb1746b0
4 changed files with 9 additions and 3 deletions

View File

@ -538,6 +538,7 @@ Version 1.6.0beta31 [October 26, 2012]
has been changed to allow an external CMS to be used. This code is
temporarily disabled until a suitable set of test cases using one or more
external CMS implementations have been implemented.
Make builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -4290,6 +4290,7 @@ Version 1.6.0beta31 [October 26, 2012]
has been changed to allow an external CMS to be used. This code is
temporarily disabled until a suitable set of test cases using one or more
external CMS implementations have been implemented.
Make builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -2004,6 +2004,7 @@ static double abserr(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
return pm->maxabs8;
}
#ifdef PNG_READ_GAMMA_SUPPORTED
static double calcerr(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
{
/* Error in the linear composition arithmetic - only relevant when
@ -2120,6 +2121,7 @@ static int output_quantization_factor(PNG_CONST png_modifier *pm, int in_depth,
else
return 1;
}
#endif /* PNG_READ_GAMMA_SUPPORTED */
/* One modification structure must be provided for each chunk to be modified (in
* fact more than one can be provided if multiple separate changes are desired
@ -2808,6 +2810,7 @@ srgb_modification_init(srgb_modification *me, png_modifier *pm, png_byte intent)
pm->modifications = &me->this;
}
#ifdef PNG_READ_GAMMA_SUPPORTED
typedef struct sbit_modification
{
png_modification this;
@ -2874,6 +2877,7 @@ sbit_modification_init(sbit_modification *me, png_modifier *pm, png_byte sbit)
me->this.next = pm->modifications;
pm->modifications = &me->this;
}
#endif /* PNG_READ_GAMMA_SUPPORTED */
#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
/***************************** STANDARD PNG FILES *****************************/

View File

@ -3284,7 +3284,7 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
if (row_info->bit_depth == 8)
{
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
#ifdef PNG_READ_GAMMA_SUPPORTED
/* Notice that gamma to/from 1 are not necessarily inverses (if
* there is an overall gamma correction). Prior to 1.5.5 this code
* checked the linearized values for equality; this doesn't match
@ -3361,7 +3361,7 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
else /* RGB bit_depth == 16 */
{
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
#ifdef PNG_READ_GAMMA_SUPPORTED
if (png_ptr->gamma_16_to_1 != NULL && png_ptr->gamma_16_from_1 != NULL)
{
png_bytep sp = row;
@ -3535,12 +3535,12 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
png_const_uint_16pp gamma_16_from_1 = png_ptr->gamma_16_from_1;
png_const_uint_16pp gamma_16_to_1 = png_ptr->gamma_16_to_1;
int gamma_shift = png_ptr->gamma_shift;
int optimize = (png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0;
#endif
png_bytep sp;
png_uint_32 i;
png_uint_32 row_width = row_info->width;
int optimize = (png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0;
int shift;
png_debug(1, "in png_do_compose");