📄 png.h
字号:
* Data is valid if (valid & PNG_INFO_gAMA) is non-zero. */ float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */#endif /* PNG_READ_gAMA_SUPPORTED || PNG_WRITE_gAMA_SUPPORTED */#if defined(PNG_READ_sRGB_SUPPORTED) || defined(PNG_WRITE_sRGB_SUPPORTED) /* GR-P, 0.96a */ /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */ png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */#endif /* PNG_READ_sRGB_SUPPORTED || PNG_WRITE_sRGB_SUPPORTED */#if defined(PNG_READ_tEXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_WRITE_zTXt_SUPPORTED) /* The tEXt and zTXt chunks contain human-readable textual data in * uncompressed and compressed forms, respectively. The data in "text" * is an array of pointers to uncompressed, null-terminated C strings. * Each chunk has a keyword that describes the textual data contained * in that chunk. Keywords are not required to be unique, and the text * string may be empty. Any number of text chunks may be in an image. */ int num_text; /* number of comments read/to write */ int max_text; /* current size of text array */ png_textp text; /* array of comments read/to write */#endif /* PNG_READ_OR_WRITE_tEXt_OR_zTXt_SUPPORTED */#if defined(PNG_READ_tIME_SUPPORTED) || defined(PNG_WRITE_tIME_SUPPORTED) /* The tIME chunk holds the last time the displayed image data was * modified. See the png_time struct for the contents of this struct. */ png_time mod_time;#endif /* PNG_READ_tIME_SUPPORTED || PNG_WRITE_tIME_SUPPORTED */#if defined(PNG_READ_sBIT_SUPPORTED) || defined(PNG_WRITE_sBIT_SUPPORTED) /* The sBIT chunk specifies the number of significant high-order bits * in the pixel data. Values are in the range [1, bit_depth], and are * only specified for the channels in the pixel data. The contents of * the low-order bits is not specified. Data is valid if * (valid & PNG_INFO_sBIT) is non-zero. */ png_color_8 sig_bit; /* significant bits in color channels */#endif /* PNG_READ_sBIT_SUPPORTED || PNG_WRITE_sBIT_SUPPORTED */#if defined(PNG_READ_tRNS_SUPPORTED) || defined(PNG_WRITE_tRNS_SUPPORTED) || \ defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) /* The tRNS chunk supplies transparency data for paletted images and * other image types that don't need a full alpha channel. There are * "num_trans" transparency values for a paletted image, stored in the * same order as the palette colors, starting from index 0. Values * for the data are in the range [0, 255], ranging from fully transparent * to fully opaque, respectively. For non-paletted images, there is a * single color specified that should be treated as fully transparent. * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. */ png_bytep trans; /* transparent values for paletted image */ png_color_16 trans_values; /* transparent color for non-palette image */#endif /* PNG_READ_tRNS_SUPPORTED || PNG_WRITE_tRNS_SUPPORTED */#if defined(PNG_READ_bKGD_SUPPORTED) || defined(PNG_WRITE_bKGD_SUPPORTED) || \ defined(PNG_READ_BACKGROUND_SUPPORTED) /* The bKGD chunk gives the suggested image background color if the * display program does not have its own background color and the image * is needs to composited onto a background before display. The colors * in "background" are normally in the same color space/depth as the * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. */ png_color_16 background;#endif /* PNG_READ_bKGD_SUPPORTED || PNG_WRITE_bKGD_SUPPORTED */#if defined(PNG_READ_oFFs_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED) /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards * and downwards from the top-left corner of the display, page, or other * application-specific co-ordinate space. See the PNG_OFFSET_ defines * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. */ png_uint_32 x_offset; /* x offset on page */ png_uint_32 y_offset; /* y offset on page */ png_byte offset_unit_type; /* offset units type */#endif /* PNG_READ_oFFs_SUPPORTED || PNG_WRITE_oFFs_SUPPORTED */#if defined(PNG_READ_pHYs_SUPPORTED) || defined(PNG_WRITE_pHYs_SUPPORTED) /* The pHYs chunk gives the physical pixel density of the image for * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. */ png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ png_uint_32 y_pixels_per_unit; /* vertical pixel density */ png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */#endif /* PNG_READ_pHYs_SUPPORTED || PNG_WRITE_pHYs_SUPPORTED */#if defined(PNG_READ_hIST_SUPPORTED) || defined(PNG_WRITE_hIST_SUPPORTED) /* The hIST chunk contains the relative frequency or importance of the * various palette entries, so that a viewer can intelligently select a * reduced-color palette, if required. Data is an array of "num_palette" * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) * is non-zero. */ png_uint_16p hist;#endif /* PNG_READ_hIST_SUPPORTED || PNG_WRITE_hIST_SUPPORTED */#if defined(PNG_READ_cHRM_SUPPORTED) || defined(PNG_WRITE_cHRM_SUPPORTED) /* The cHRM chunk describes the CIE color characteristics of the monitor * on which the PNG was created. This data allows the viewer to do gamut * mapping of the input image to ensure that the viewer sees the same * colors in the image as the creator. Values are in the range * [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero. */ float x_white; float y_white; float x_red; float y_red; float x_green; float y_green; float x_blue; float y_blue;#endif /* PNG_READ_cHRM_SUPPORTED || PNG_WRITE_cHRM_SUPPORTED */#if defined(PNG_READ_pCAL_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) /* The pCAL chunk describes a transformation between the stored pixel * values and original physcical data values used to create the image. * The integer range [0, 2^bit_depth - 1] maps to the floating-point * range given by [pcal_X0, pcal_X1], and are further transformed by a * (possibly non-linear) transformation function given by "pcal_type" * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ * defines below, and the PNG-Group's Scientific Visualization extension * chunks document png-scivis-19970203 for a complete description of the * transformations and how they should be implemented, as well as the * png-extensions document for a description of the ASCII parameter * strings. Data values are valid if (valid & PNG_INFO_pCAL) non-zero. */ png_charp pcal_purpose; /* pCAL chunk description string */ png_int_32 pcal_X0; /* minimum value */ png_int_32 pcal_X1; /* maximum value */ png_charp pcal_units; /* Latin-1 string giving physical units */ png_charpp pcal_params; /* ASCII strings containing parameter values */ png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ png_byte pcal_nparams; /* number of parameters given in pcal_params */#endif /* PNG_READ_pCAL_SUPPORTED || PNG_WRITE_pCAL_SUPPORTED */} png_info;typedef png_info FAR * png_infop;typedef png_info FAR * FAR * png_infopp;/* These describe the color_type field in png_info. *//* color type masks */#define PNG_COLOR_MASK_PALETTE 1#define PNG_COLOR_MASK_COLOR 2#define PNG_COLOR_MASK_ALPHA 4/* color types. Note that not all combinations are legal */#define PNG_COLOR_TYPE_GRAY 0#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR)#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)/* This is for compression type. PNG 1.0 only defines the single type. */#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE/* This is for filter type. PNG 1.0 only defines the single type. */#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE/* These are for the interlacing type. These values should NOT be changed. */#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */#define PNG_INTERLACE_LAST 2 /* Not a valid value *//* These are for the oFFs chunk. These values should NOT be changed. */#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */#define PNG_OFFSET_LAST 2 /* Not a valid value *//* These are for the pCAL chunk. These values should NOT be changed. */#define PNG_EQUATION_LINEAR 0 /* Linear transformation */#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */#define PNG_EQUATION_LAST 4 /* Not a valid value *//* These are for the pHYs chunk. These values should NOT be changed. */#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */#define PNG_RESOLUTION_METER 1 /* pixels/meter */#define PNG_RESOLUTION_LAST 2 /* Not a valid value *//* These are for the sRGB chunk. These values should NOT be changed. */#define PNG_sRGB_INTENT_SATURATION 0#define PNG_sRGB_INTENT_PERCEPTUAL 1#define PNG_sRGB_INTENT_ABSOLUTE 2#define PNG_sRGB_INTENT_RELATIVE 3#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ /* These determine if an ancillary chunk's data has been successfully read * from the PNG header, or if the application has filled in the corresponding * data in the info_struct to be written into the output file. The values * of the PNG_INFO_<chunk> defines should NOT be changed. */#define PNG_INFO_gAMA 0x0001#define PNG_INFO_sBIT 0x0002#define PNG_INFO_cHRM 0x0004#define PNG_INFO_PLTE 0x0008#define PNG_INFO_tRNS 0x0010#define PNG_INFO_bKGD 0x0020#define PNG_INFO_hIST 0x0040#define PNG_INFO_pHYs 0x0080#define PNG_INFO_oFFs 0x0100#define PNG_INFO_tIME 0x0200#define PNG_INFO_pCAL 0x0400#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a *//* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using * the routines for other purposes. */typedef struct png_row_info_struct{ png_uint_32 width; /* width of row */ png_uint_32 rowbytes; /* number of bytes in row */ png_byte color_type; /* color type of row */ png_byte bit_depth; /* bit depth of row */ png_byte channels; /* number of channels (1, 2, 3, or 4) */ png_byte pixel_depth; /* bits per pixel (depth * channels) */} png_row_info;typedef png_row_info FAR * png_row_infop;typedef png_row_info FAR * FAR * png_row_infopp;/* These are the function types for the I/O functions and for the functions * that allow the user to override the default I/O functions with his or her * own. The png_error_ptr type should match that of user-supplied warning * and error functions, while the png_rw_ptr type should match that of the * user read/write data functions. */typedef struct png_struct_def png_struct;typedef png_struct FAR * png_structp;typedef void (*png_error_ptr) PNGARG((png_structp, png_const_charp));typedef void (*png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t));typedef void (*png_flush_ptr) PNGARG((png_structp));typedef void (*png_read_status_ptr) PNGARG((png_structp, png_uint_32, int));typedef void (*png_write_status_ptr) PNGARG((png_structp, png_uint_32, int));#ifdef PNG_PROGRESSIVE_READ_SUPPORTEDtypedef void (*png_progressive_info_ptr) PNGARG((png_structp, png_infop));typedef void (*png_progressive_end_ptr) PNGARG((png_structp, png_infop));typedef void (*png_progressive_row_ptr) PNGARG((png_structp, png_bytep, png_uint_32, int));#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)typedef void (*png_user_transform_ptr) PNGARG((png_structp, png_row_infop, png_bytep));#endif /* PNG_READ|WRITE_USER_TRANSFORM_SUPPORTED */typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t));typedef void (*png_free_ptr) PNGARG((png_structp, png_structp));/* The structure that holds the information to read and write PNG files. * The only people who need to care about what is inside of this are the * people who will be modifying the library for their own special needs. * It should NOT be accessed directly by an application, except to store * the jmp_buf. */struct png_struct_def{ jmp_buf jmpbuf; /* used in png_error */ png_error_ptr error_fn; /* function for printing errors and aborting */ png_error_ptr warning_fn; /* function for printing warnings */ png_voidp error_ptr; /* user supplied struct for error functions */ png_rw_ptr write_data_fn; /* function for writing output data */ png_rw_ptr read_data_fn; /* function for reading input data */#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) png_user_transform_ptr read_user_transform_fn; /* user read transform */ png_user_transform_ptr write_user_transform_fn; /* user write transform */#endif png_voidp io_ptr; /* ptr to application struct for I/O functions*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -