mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Revised example.c to demonstrate png_set_chop_16().
This commit is contained in:
parent
3fb7c07ea5
commit
857dbbe7cc
@ -187,8 +187,15 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
|
|||||||
* are mutually exclusive.
|
* are mutually exclusive.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Tell libpng to strip 16 bit/color files down to 8 bits/color */
|
/* Tell libpng to strip 16 bit/color files down to 8 bits/color.
|
||||||
|
* Use accurate scaling if it's available, otherwise just chop off the
|
||||||
|
* low byte.
|
||||||
|
*/
|
||||||
|
#ifdef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||||
png_set_strip_16(png_ptr);
|
png_set_strip_16(png_ptr);
|
||||||
|
#else
|
||||||
|
png_set_chop_16(png_ptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Strip alpha bytes from the input data without combining with the
|
/* Strip alpha bytes from the input data without combining with the
|
||||||
* background (not recommended).
|
* background (not recommended).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user