mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Revised commentary about png_set_alpha_mode() to make it clearer
that this only affects how composited pixels are returned to the calling application; they don't affect the pixels that are written to a PNG file.
This commit is contained in:
parent
96cec0e1a3
commit
44e26d4149
18
png.h
18
png.h
@ -1118,15 +1118,19 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
|
|||||||
|
|
||||||
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
|
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
|
||||||
/* How the alpha channel is interpreted - this affects how the color channels of
|
/* How the alpha channel is interpreted - this affects how the color channels of
|
||||||
* a PNG file are output when an alpha channel, or tRNS chunk is a palette file,
|
* a PNG file are returned when an alpha channel, or tRNS chunk in a palette
|
||||||
* is present.
|
* file, is present.
|
||||||
*
|
*
|
||||||
* The default is to output data according to the PNG specification: the alpha
|
* This has no effect on the way pixels are written into a PNG output
|
||||||
|
* datastream. The color samples in a PNG datastream are never premultiplied
|
||||||
|
* with the alpha samples.
|
||||||
|
*
|
||||||
|
* The default is to return data according to the PNG specification: the alpha
|
||||||
* channel is a linear measure of the contribution of the pixel to the
|
* channel is a linear measure of the contribution of the pixel to the
|
||||||
* corresponding output pixel. The gamma encoded color channels must be scaled
|
* corresponding composited pixel. The gamma encoded color channels must be
|
||||||
* according to the contribution and to do this it is necessary to undo the
|
* scaled according to the contribution and to do this it is necessary to undo
|
||||||
* encoding, scale the color values, perform the composition and reencode the
|
* the encoding, scale the color values, perform the composition and reencode
|
||||||
* values. This is the 'PNG' format.
|
* the values. This is the 'PNG' mode.
|
||||||
*
|
*
|
||||||
* The alternative is to 'associate' the alpha with the color information by
|
* The alternative is to 'associate' the alpha with the color information by
|
||||||
* storing color channel values that have been scaled by the alpha. The
|
* storing color channel values that have been scaled by the alpha. The
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user