png_get_IHDR

Name

png_get_IHDR -- get PNG_IHDR chunk information from png_info structure

Synopsis

#include <png.h>

png_uint_32 png_get_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 * width, png_uint_32 * height, int * bit_depth, int * color_type, int * interlace_method, int * compression_method, int * filter_method);

Description

png_get_IHDR() gets PNG_IHDR chunk type information from png_info structure.

width 

holds the width of the image in pixels up to 2^31.

height 

holds the height of the image in pixels up to 2^31.

bit_depth 

holds the bit depth of one of the image channels. Valid values are 1, 2, 4, 8, 16 and also depend on the color_type.

color_type 

describes which color/alpha channels are present. Supported color types shall include:

PNG_COLOR_TYPE_GRAY (bit depths 1, 2, 4, 8, 16)
PNG_COLOR_TYPE_GRAY_ALPHA (bit depths 8, 16)
PNG_COLOR_TYPE_PALETTE (bit depths 1, 2, 4, 8)
PNG_COLOR_TYPE_RGB (bit_depths 8, 16)
PNG_COLOR_TYPE_RGB_ALPHA (bit_depths 8, 16)
PNG_COLOR_MASK_PALETTE
PNG_COLOR_MASK_COLOR
PNG_COLOR_MASK_ALPHA

filter_method 

holds the filter method. If this argument is NULL, the filter method will not be retrieved. Valid values after retrieval are

PNG_FILTER_TYPE_BASE
PNG_INTRAPIXEL_DIFFERENCING

compression_method 

holds the compression method. If this argument is NULL, the compression method will not be retrieved. Valid values after retrieval are PNG_COMPRESSION_TYPE_BASE

interlace_method 

holds the interlace method. If this argument is NULL, the interlacing method will not be retrieved. Valid values after retrieval are

PNG_INTERLACE_NONE
PNG_INTERLACE_ADAM7

Return Value

On success, png_get_HDR() shall return 1. Otherwise, png_get_IHDR() shall return 0.