mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Revised contrib/visupng, gregbook, and pngminim
to demonstrate chop_16_to_8
This commit is contained in:
parent
5f0b9276ec
commit
850769f787
3
ANNOUNCE
3
ANNOUNCE
@ -217,7 +217,8 @@ Version 1.5.4beta04 [June 16, 2011]
|
||||
Added a missing "#ifdef PNG_READ_BACKGROUND_SUPPORTED/#endif" in pngrtran.c
|
||||
Added PNG_TRANSFORM_CHOP_16 to the high-level read transforms.
|
||||
Made PNG_READ_16_TO_8_ACCURATE_SCALE configurable again. If this is
|
||||
not enabled, png_set_strip_16() and png_do_scale_16_to_8 aren't built.
|
||||
not enabled, png_set_strip_16() and png_do_scale_16_to_8() aren't built.
|
||||
Revised contrib/visupng, gregbook, and pngminim to demonstrate chop_16_to_8
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
|
||||
(subscription required; visit
|
||||
|
||||
3
CHANGES
3
CHANGES
@ -3480,7 +3480,8 @@ Version 1.5.4beta04 [June 16, 2011]
|
||||
Added a missing "#ifdef PNG_READ_BACKGROUND_SUPPORTED/#endif" in pngrtran.c
|
||||
Added PNG_TRANSFORM_CHOP_16 to the high-level read transforms.
|
||||
Made PNG_READ_16_TO_8_ACCURATE_SCALE configurable again. If this is
|
||||
not enabled, png_set_strip_16() and png_do_scale_16_to_8 aren't built.
|
||||
not enabled, png_set_strip_16() and png_do_scale_16_to_8() aren't built.
|
||||
Revised contrib/visupng, gregbook, and pngminim to demonstrate chop_16_to_8
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
||||
@ -229,8 +229,14 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
png_set_expand(png_ptr);
|
||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
|
||||
png_set_expand(png_ptr);
|
||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||
if (bit_depth == 16)
|
||||
# ifdef PNG_READ_CHOP_16_TO_8_SUPPORTED
|
||||
png_set_chop_16(png_ptr);
|
||||
# else
|
||||
png_set_strip_16(png_ptr);
|
||||
# endif
|
||||
#endif
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY ||
|
||||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_gray_to_rgb(png_ptr);
|
||||
|
||||
@ -311,8 +311,14 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
png_set_expand(png_ptr);
|
||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
|
||||
png_set_expand(png_ptr);
|
||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||
if (bit_depth == 16)
|
||||
# ifdef PNG_READ_CHOP_16_TO_8_SUPPORTED
|
||||
png_set_chop_16(png_ptr);
|
||||
# else
|
||||
png_set_strip_16(png_ptr);
|
||||
# endif
|
||||
#endif
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY ||
|
||||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_gray_to_rgb(png_ptr);
|
||||
|
||||
@ -37,3 +37,4 @@ option SETJMP on
|
||||
option STDIO on
|
||||
option READ_EXPAND on
|
||||
option READ_16_TO_8 on
|
||||
option READ_16_TO_8_ACCURATE_SCALE on
|
||||
|
||||
@ -37,4 +37,5 @@ option READ_bKGD on
|
||||
option READ_GAMMA on
|
||||
option READ_EXPAND on
|
||||
option READ_16_TO_8 on
|
||||
option READ_CHOP_16_TO_8 on
|
||||
option READ_GRAY_TO_RGB on
|
||||
|
||||
@ -144,7 +144,7 @@ int main(int argc, char *argv[])
|
||||
if (png2pnm (fp_rd, fp_wr, fp_al, raw, alpha) == FALSE)
|
||||
{
|
||||
fprintf (stderr, "PNG2PNM\n");
|
||||
fprintf (stderr, "Error: unsuccessful convertion of PNG-image\n");
|
||||
fprintf (stderr, "Error: unsuccessful conversion of PNG-image\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@ -175,8 +175,14 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
|
||||
// expand images of all color-type and bit-depth to 3x8 bit RGB images
|
||||
// let the library process things like alpha, transparency, background
|
||||
|
||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||
if (iBitDepth == 16)
|
||||
# ifdef PNG_READ_CHOP_16_TO_8_SUPPORTED
|
||||
png_set_chop_16(png_ptr);
|
||||
# else
|
||||
png_set_strip_16(png_ptr);
|
||||
# endif
|
||||
#endif
|
||||
if (iColorType == PNG_COLOR_TYPE_PALETTE)
|
||||
png_set_expand(png_ptr);
|
||||
if (iBitDepth < 8)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user