14d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 24d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann/* pnginfo.h - header file for PNG reference library 34d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * 44d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * Last changed in libpng 1.6.1 [March 28, 2013] 54d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson 64d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 74d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 84d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * 94d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * This code is released under the libpng license. 104d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * For conditions of distribution and use, see the disclaimer 114d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * and license in png.h 124d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 134d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 144d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* png_info is a structure that holds the information in a PNG file so 154d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * that the application can find out the characteristics of the image. 164d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * If you are reading the file, this structure will tell you what is 174d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * in the PNG file. If you are writing the file, fill in the information 184d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * you want to put into the PNG file, using png_set_*() functions, then 194d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * call png_write_info(). 204d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * 214d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * The names chosen should be very close to the PNG specification, so 224d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * consult that document for information about the meaning of each field. 234d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * 244d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * With libpng < 0.95, it was only possible to directly set and read the 254d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * the values in the png_info_struct, which meant that the contents and 264d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * order of the values had to remain fixed. With libpng 0.95 and later, 274d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * however, there are now functions that abstract the contents of 284d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * png_info_struct from the application, so this makes it easier to use 294d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * libpng with dynamic libraries, and even makes it possible to use 304d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * libraries that don't have all of the libpng ancillary chunk-handing 314d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * functionality. In libpng-1.5.0 this was moved into a separate private 324d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * file that is not visible to applications. 334d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * 344d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * The following members may have allocated storage attached that should be 354d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * cleaned up before the structure is discarded: palette, trans, text, 364d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, 374d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these 384d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * are automatically freed when the info structure is deallocated, if they were 394d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * allocated internally by libpng. This behavior can be changed by means 404d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * of the png_data_freer() function. 414d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * 424d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * More allocation details: all the chunk-reading functions that 434d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * change these members go through the corresponding png_set_* 444d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * functions. A function to clear these members is available: see 454d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * png_free_data(). The png_set_* functions do not depend on being 464d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * able to point info structure members to any of the storage they are 474d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * passed (they make their own copies), EXCEPT that the png_set_text 484d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * functions use the same storage passed to them in the text_ptr or 494d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns 504d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * functions do not make their own copies. 514d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 524d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifndef PNGINFO_H 534d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#define PNGINFO_H 544d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 554d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmannstruct png_info_def 564d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann{ 574d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The following are necessary for every PNG file */ 584d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_32 width; /* width of image in pixels (from IHDR) */ 594d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_32 height; /* height of image in pixels (from IHDR) */ 604d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ 614d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_size_t rowbytes; /* bytes needed to hold an untransformed row */ 624d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ 634d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ 644d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ 654d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ 664d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ 674d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The following three should have been named *_method not *_type */ 684d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ 694d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ 704d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ 714d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 724d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The following are set by png_set_IHDR, called from the application on 734d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * write, but the are never actually used by the write code. 744d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 754d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ 764d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte pixel_depth; /* number of bits per pixel */ 774d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte spare_byte; /* to align the data, and for future use */ 784d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 794d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_READ_SUPPORTED 804d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* This is never set during write */ 814d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte signature[8]; /* magic bytes read by libpng from start of file */ 824d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 834d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 844d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The rest of the data is optional. If you are reading, check the 854d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * valid field to see if the information in these are valid. If you 864d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * are writing, set the valid field to those chunks you want written, 874d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * and initialize the appropriate fields below. 884d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 894d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 904d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) 914d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are 924d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * defined. When COLORSPACE is switched on all the colorspace-defining 934d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * chunks should be enabled, when GAMMA is switched on all the gamma-defining 944d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * chunks should be enabled. If this is not done it becomes possible to read 954d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * inconsistent PNG files and assign a probably incorrect interpretation to 964d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * the information. (In other words, by carefully choosing which chunks to 974d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * recognize the system configuration can select an interpretation for PNG 984d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * files containing ambiguous data and this will result in inconsistent 994d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * behavior between different libpng builds!) 1004d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1014d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_colorspace colorspace; 1024d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1034d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1044d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_iCCP_SUPPORTED 1054d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* iCCP chunk data. */ 1064d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_charp iccp_name; /* profile name */ 1074d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_bytep iccp_profile; /* International Color Consortium profile data */ 1084d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_32 iccp_proflen; /* ICC profile data length */ 1094d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1104d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1114d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_TEXT_SUPPORTED 1124d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The tEXt, and zTXt chunks contain human-readable textual data in 1134d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * uncompressed, compressed, and optionally compressed forms, respectively. 1144d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * The data in "text" is an array of pointers to uncompressed, 1154d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * null-terminated C strings. Each chunk has a keyword that describes the 1164d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * textual data contained in that chunk. Keywords are not required to be 1174d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * unique, and the text string may be empty. Any number of text chunks may 1184d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * be in an image. 1194d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1204d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann int num_text; /* number of comments read or comments to write */ 1214d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann int max_text; /* current size of text array */ 1224d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_textp text; /* array of comments read or comments to write */ 1234d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif /* TEXT */ 1244d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1254d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_tIME_SUPPORTED 1264d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The tIME chunk holds the last time the displayed image data was 1274d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * modified. See the png_time struct for the contents of this struct. 1284d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1294d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_time mod_time; 1304d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1314d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1324d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_sBIT_SUPPORTED 1334d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The sBIT chunk specifies the number of significant high-order bits 1344d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * in the pixel data. Values are in the range [1, bit_depth], and are 1354d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * only specified for the channels in the pixel data. The contents of 1364d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * the low-order bits is not specified. Data is valid if 1374d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * (valid & PNG_INFO_sBIT) is non-zero. 1384d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1394d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_color_8 sig_bit; /* significant bits in color channels */ 1404d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1414d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1424d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ 1434d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmanndefined(PNG_READ_BACKGROUND_SUPPORTED) 1444d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The tRNS chunk supplies transparency data for paletted images and 1454d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * other image types that don't need a full alpha channel. There are 1464d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * "num_trans" transparency values for a paletted image, stored in the 1474d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * same order as the palette colors, starting from index 0. Values 1484d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * for the data are in the range [0, 255], ranging from fully transparent 1494d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * to fully opaque, respectively. For non-paletted images, there is a 1504d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * single color specified that should be treated as fully transparent. 1514d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. 1524d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1534d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_bytep trans_alpha; /* alpha values for paletted image */ 1544d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_color_16 trans_color; /* transparent color for non-palette image */ 1554d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1564d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1574d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) 1584d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The bKGD chunk gives the suggested image background color if the 1594d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * display program does not have its own background color and the image 1604d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * is needs to composited onto a background before display. The colors 1614d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * in "background" are normally in the same color space/depth as the 1624d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. 1634d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1644d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_color_16 background; 1654d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1664d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1674d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_oFFs_SUPPORTED 1684d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards 1694d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * and downwards from the top-left corner of the display, page, or other 1704d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * application-specific co-ordinate space. See the PNG_OFFSET_ defines 1714d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. 1724d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1734d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_int_32 x_offset; /* x offset on page */ 1744d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_int_32 y_offset; /* y offset on page */ 1754d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte offset_unit_type; /* offset units type */ 1764d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1774d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1784d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_pHYs_SUPPORTED 1794d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The pHYs chunk gives the physical pixel density of the image for 1804d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ 1814d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. 1824d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1834d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ 1844d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_32 y_pixels_per_unit; /* vertical pixel density */ 1854d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ 1864d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1874d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1884d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_hIST_SUPPORTED 1894d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The hIST chunk contains the relative frequency or importance of the 1904d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * various palette entries, so that a viewer can intelligently select a 1914d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * reduced-color palette, if required. Data is an array of "num_palette" 1924d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) 1934d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * is non-zero. 1944d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 1954d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_16p hist; 1964d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 1974d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 1984d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_pCAL_SUPPORTED 1994d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The pCAL chunk describes a transformation between the stored pixel 2004d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * values and original physical data values used to create the image. 2014d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * The integer range [0, 2^bit_depth - 1] maps to the floating-point 2024d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * range given by [pcal_X0, pcal_X1], and are further transformed by a 2034d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * (possibly non-linear) transformation function given by "pcal_type" 2044d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ 2054d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * defines below, and the PNG-Group's PNG extensions document for a 2064d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * complete description of the transformations and how they should be 2074d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * implemented, and for a description of the ASCII parameter strings. 2084d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. 2094d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 2104d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_charp pcal_purpose; /* pCAL chunk description string */ 2114d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_int_32 pcal_X0; /* minimum value */ 2124d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_int_32 pcal_X1; /* maximum value */ 2134d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_charp pcal_units; /* Latin-1 string giving physical units */ 2144d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_charpp pcal_params; /* ASCII strings containing parameter values */ 2154d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ 2164d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte pcal_nparams; /* number of parameters given in pcal_params */ 2174d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 2184d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 2194d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann/* New members added in libpng-1.0.6 */ 2204d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_uint_32 free_me; /* flags items libpng is responsible for freeing */ 2214d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 2224d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED 2234d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* Storage for unknown chunks that the library doesn't recognize. */ 2244d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_unknown_chunkp unknown_chunks; 2254d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 2264d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The type of this field is limited by the type of 2274d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * png_struct::user_chunk_cache_max, else overflow can occur. 2284d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 2294d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann int unknown_chunks_num; 2304d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 2314d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 2324d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_sPLT_SUPPORTED 2334d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* Data on sPLT chunks (there may be more than one). */ 2344d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_sPLT_tp splt_palettes; 2354d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann int splt_palettes_num; /* Match type returned by png_get API */ 2364d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 2374d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 2384d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_sCAL_SUPPORTED 2394d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* The sCAL chunk describes the actual physical dimensions of the 2404d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * subject matter of the graphic. The chunk contains a unit specification 2414d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * a byte value, and two ASCII strings representing floating-point 2424d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * values. The values are width and height corresponsing to one pixel 2434d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * in the image. Data values are valid if (valid & PNG_INFO_sCAL) is 2444d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann * non-zero. 2454d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann */ 2464d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_byte scal_unit; /* unit of physical scale */ 2474d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_charp scal_s_width; /* string containing height */ 2484d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_charp scal_s_height; /* string containing width */ 2494d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 2504d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 2514d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#ifdef PNG_INFO_IMAGE_SUPPORTED 2524d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) 2534d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann non-zero */ 2544d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ 2554d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann png_bytepp row_pointers; /* the image bits */ 2564d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif 2574d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 2584d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann}; 2594d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#endif /* PNGINFO_H */ 260