From 7d3e6732fbf529be0571fb89a5f778d89b2553ac Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 26 Aug 2010 17:14:07 -0500 Subject: [devel] Added PNG_WRITE_16BIT_SUPPORTED option. --- pngwtran.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pngwtran.c') diff --git a/pngwtran.c b/pngwtran.c index 8293a5941..1c2e7afb7 100644 --- a/pngwtran.c +++ b/pngwtran.c @@ -393,6 +393,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) } } +#ifdef PNG_WRITE_16BIT_SUPPORTED else { /* This converts from AARRGGBB to RRGGBBAA */ @@ -415,6 +416,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) *(dp++) = save[1]; } } +#endif /* PNG_WRITE_16BIT_SUPPORTED */ } else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) @@ -434,6 +436,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) } } +#ifdef PNG_WRITE_16BIT_SUPPORTED else { /* This converts from AAGG to GGAA */ @@ -452,6 +455,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) *(dp++) = save[1]; } } +#endif /* PNG_WRITE_16BIT_SUPPORTED */ } } } @@ -485,6 +489,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) } } +#ifdef PNG_WRITE_16BIT_SUPPORTED else { /* This inverts the alpha channel in RRGGBBAA */ @@ -507,6 +512,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) *(dp++) = (png_byte)(255 - *(sp++)); } } +#endif /* PNG_WRITE_16BIT_SUPPORTED */ } else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) @@ -525,6 +531,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) } } +#ifdef PNG_WRITE_16BIT_SUPPORTED else { /* This inverts the alpha channel in GGAA */ @@ -543,6 +550,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) *(dp++) = (png_byte)(255 - *(sp++)); } } +#endif /* PNG_WRITE_16BIT_SUPPORTED */ } } } @@ -580,6 +588,7 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row) } } +#ifdef PNG_WRITE_16BIT_SUPPORTED else if (row_info->bit_depth == 16) { png_bytep rp; @@ -607,6 +616,7 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row) *(rp + 5) = (png_byte)(blue & 0xff); } } +#endif /* PNG_WRITE_16BIT_SUPPORTED */ } } #endif /* PNG_MNG_FEATURES_SUPPORTED */ -- cgit v1.2.1