diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2010-04-16 19:27:08 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2010-04-16 19:28:42 -0500 |
commit | 3cd7cffd0c17c1bd31d7dc9c52923179a557caa0 (patch) | |
tree | 6645b12a0822e959a36ebb26dc2caf0084b91e5c /example.c | |
parent | 0f0a19e9ce14f86961c617165367af8813939c74 (diff) |
[devel] Imported from libpng-1.5.0beta17.tar
Diffstat (limited to 'example.c')
-rw-r--r-- | example.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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.0 [April 14, 2010] + * Last changed in libpng 1.5.0 [April 17, 2010] * This file has been placed in the public domain by the authors. * Maintained 1998-2010 Glenn Randers-Pehrson * Maintained 1996, 1997 Andreas Dilger) @@ -160,7 +160,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ * If you have enough memory to read in the entire image at once, * and you need to specify only transforms that can be controlled * with one of the PNG_TRANSFORM_* bits (this presently excludes - * dithering, filling, setting background, and doing gamma + * quantizing, filling, setting background, and doing gamma * adjustment), then you can read the entire image (including * pixels) into the info structure with this call: */ @@ -271,8 +271,8 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ png_set_gamma(png_ptr, screen_gamma, 0.45455); } -#ifdef PNG_READ_DITHER_SUPPORTED - /* Dither RGB files down to 8 bit palette or reduce palettes +#ifdef PNG_READ_QUANTIZE_SUPPORTED + /* Quantize RGB files down to 8 bit palette or reduce palettes * to the number of colors available on your screen. */ if (color_type & PNG_COLOR_MASK_COLOR) @@ -283,10 +283,10 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ /* This reduces the image to the application supplied palette */ if (/* We have our own palette */) { - /* An array of colors to which the image should be dithered */ + /* An array of colors to which the image should be quantized */ png_color std_color_cube[MAX_SCREEN_COLORS]; - png_set_dither(png_ptr, std_color_cube, MAX_SCREEN_COLORS, + png_set_quantize(png_ptr, std_color_cube, MAX_SCREEN_COLORS, MAX_SCREEN_COLORS, NULL, 0); } /* This reduces the image to the palette supplied in the file */ @@ -296,11 +296,11 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ png_get_hIST(png_ptr, info_ptr, &histogram); - png_set_dither(png_ptr, palette, num_palette, + png_set_quantize(png_ptr, palette, num_palette, max_screen_colors, histogram, 0); } } -#endif /* PNG_READ_DITHER_SUPPORTED */ +#endif /* PNG_READ_QUANTIZE_SUPPORTED */ /* Invert monochrome files to have 0 as white and 1 as black */ png_set_invert_mono(png_ptr); |