LibGd 2.4.0-dev
GD Graphics library
Loading...
Searching...
No Matches
Data Fields
gdPngInfo Struct Reference

Basic information read from a PNG stream. More...

#include <gd.h>

Data Fields

int width
 
int height
 
int bit_depth
 
int color_type
 
int has_alpha
 
int has_transparency
 
int palette_entries
 
int interlace_method
 
int x_pixels_per_unit
 
int y_pixels_per_unit
 
int physical_unit
 
gdImageMetadata * metadata
 
int decoded_truecolor
 
int resolution_x
 
int resolution_y
 

Detailed Description

Basic information read from a PNG stream.

PNG stores physical pixel density in the pHYs chunk as two raw pixels-per-unit values plus a unit flag. When physical_unit is PNG_RESOLUTION_METER, x_pixels_per_unit and y_pixels_per_unit are pixels per meter and resolution_x/resolution_y contain the converted DPI values. When physical_unit is PNG_RESOLUTION_UNKNOWN, the raw values describe pixel aspect ratio only and resolution_x/resolution_y remain -1.

Field Documentation

◆ bit_depth

int gdPngInfo::bit_depth

PNG bit depth from the IHDR chunk.

◆ color_type

int gdPngInfo::color_type

PNG color type from the IHDR chunk.

◆ decoded_truecolor

int gdPngInfo::decoded_truecolor

Non-zero if gd decodes this PNG as truecolor.

◆ has_alpha

int gdPngInfo::has_alpha

Non-zero if the PNG color type includes alpha.

◆ has_transparency

int gdPngInfo::has_transparency

Non-zero if a tRNS transparency chunk is present.

◆ height

int gdPngInfo::height

Image height in pixels.

◆ interlace_method

int gdPngInfo::interlace_method

PNG interlace method from the IHDR chunk.

◆ metadata

gdImageMetadata* gdPngInfo::metadata

Optional metadata object populated while probing.

◆ palette_entries

int gdPngInfo::palette_entries

Number of palette entries, or -1 if no PLTE chunk was read.

◆ physical_unit

int gdPngInfo::physical_unit

pHYs unit flag: PNG_RESOLUTION_UNKNOWN, PNG_RESOLUTION_METER, or -1.

◆ resolution_x

int gdPngInfo::resolution_x

Horizontal DPI converted from meter pHYs, or -1 if not available.

◆ resolution_y

int gdPngInfo::resolution_y

Vertical DPI converted from meter pHYs, or -1 if not available.

◆ width

int gdPngInfo::width

Image width in pixels.

◆ x_pixels_per_unit

int gdPngInfo::x_pixels_per_unit

Raw pHYs horizontal pixels per unit, or -1 if not available.

◆ y_pixels_per_unit

int gdPngInfo::y_pixels_per_unit

Raw pHYs vertical pixels per unit, or -1 if not available.


The documentation for this struct was generated from the following file: