png_get_tRNS

Name

png_get_tRNS -- get transparency data for images

Synopsis

#include <png.h>

png_uint_32 png_get_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep * trans, int * num_trans, png_color_16p * trans_values);

Description

png_get_tRNS() shall obtain the transparency data for paletted images and image types that don't need a full alpha channel from info_ptr. For a paletted image, the function retrieves the transparency values stored in the same order as the palette colors, starting from index 0. For non-paletted images, the function retrieves the single color value which is treated as fully transparent. If the transparency information is valid, i.e. PNG_INFO_tRNS bit is set for info_ptr->valid: *trans shall be set to the transparency values for a paletted image. Values for the data shall be in range [0,255], ranging from fully transparent to fully opaque, respectively. *num_trans shall be set to the number of transparency values *trans_values shall be set to the single color value specified for non-paletted images.

Return Value

Returns PNG_INFO_tRNS on successful return, 0 otherwise.