mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Corrected simplified API default gamma for color-mapped output, added
a flag to change default. In 1.6.0 when the simplified API was used to produce color-mapped output from an input image with no gamma information the gamma assumed for the input could be different from that assumed for non-color-mapped output. In particular 16-bit depth input files were assumed to be sRGB encoded, whereas in the 'direct' case they were assumed to have linear data. This was an error. The fix makes the simplified API treat all input files the same way and adds a new flag to the png_image::flags member to allow the application/user to specify that 16-bit files contain sRGB data rather than the default linear. Fixed bugs in the pngpixel and makepng test programs.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
f46106fa04
commit
2e92b4dfa0
@@ -37,7 +37,7 @@ component(png_const_bytep row, png_uint_32 x, unsigned int c,
|
||||
* bytes wide. Since the row fitted into memory, however, the following must
|
||||
* work:
|
||||
*/
|
||||
png_uint_32 bit_offset_hi = bit_depth * ((x >> 6) * channels + c);
|
||||
png_uint_32 bit_offset_hi = bit_depth * ((x >> 6) * channels);
|
||||
png_uint_32 bit_offset_lo = bit_depth * ((x & 0x3f) * channels + c);
|
||||
|
||||
row = (png_const_bytep)(((PNG_CONST png_byte (*)[8])row) + bit_offset_hi);
|
||||
|
||||
Reference in New Issue
Block a user