mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Make the 16-to-8 scaling accurate. Dividing by 256 with no rounding is
wrong (high by one) 25% of the time. Dividing by 257 with rounding is
wrong in 128 out of 65536 cases. Getting the right answer all the time
without division is easy.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
cc2770850a
commit
b2bee3374c
@@ -346,12 +346,15 @@ option INCH_CONVERSIONS
|
||||
|
||||
option BUILD_GRAYSCALE_PALETTE
|
||||
|
||||
# This is no longer used - the scaling is always accurate - but the definition
|
||||
# is left in for older applications (including pngvalid) that check it. Do not
|
||||
# turn it off!
|
||||
option READ_16_TO_8_ACCURATE_SCALE requires READ
|
||||
|
||||
# IN DEVELOPMENT
|
||||
# These are currently experimental features, define them if you want
|
||||
# These are currently experimental features; define them if you want
|
||||
|
||||
# Very little testing, not enabled by default.
|
||||
|
||||
option READ_16_TO_8_ACCURATE_SCALE requires READ disabled
|
||||
# NOTHING HERE
|
||||
|
||||
# WRITE options
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
#define PNG_POINTER_INDEXING_SUPPORTED
|
||||
#define PNG_PROGRESSIVE_READ_SUPPORTED
|
||||
#define PNG_READ_16BIT_SUPPORTED
|
||||
#define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||
#define PNG_READ_16_TO_8_SUPPORTED
|
||||
#define PNG_READ_ALPHA_MODE_SUPPORTED
|
||||
#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
|
||||
@@ -154,7 +155,7 @@
|
||||
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
|
||||
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
||||
#define PNG_WRITE_INVERT_SUPPORTED
|
||||
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION
|
||||
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
|
||||
#define PNG_WRITE_iTXt_SUPPORTED
|
||||
#define PNG_WRITE_oFFs_SUPPORTED
|
||||
#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
|
||||
@@ -182,6 +183,5 @@
|
||||
#define PNG_zTXt_SUPPORTED
|
||||
#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
|
||||
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
|
||||
/*#undef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED*/
|
||||
/* end of options */
|
||||
#endif /* PNGLCONF_H */
|
||||
|
||||
Reference in New Issue
Block a user