📄 png.h
字号:
* * The integer is * "png_uint_16 year" in png_time_struct. * * The strings are * "png_charp time_buffer" in png_struct and * "near_time_buffer", which is a local character string in png.c. * * There are seven time-related functions: * png.c: png_convert_to_rfc_1123() in png.c * (formerly png_convert_to_rfc_1152() in error) * png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c * png_convert_from_time_t() in pngwrite.c * png_get_tIME() in pngget.c * png_handle_tIME() in pngrutil.c, called in pngread.c * png_set_tIME() in pngset.c * png_write_tIME() in pngwutil.c, called in pngwrite.c * * All handle dates properly in a Y2K environment. The * png_convert_from_time_t() function calls gmtime() to convert from system * clock time, which returns (year - 1900), which we properly convert to * the full 4-digit year. There is a possibility that applications using * libpng are not passing 4-digit years into the png_convert_to_rfc_1123() * function, or that they are incorrectly passing only a 2-digit year * instead of "year - 1900" into the png_convert_from_struct_tm() function, * but this is not under our control. The libpng documentation has always * stated that it works with 4-digit years, and the APIs have been * documented as such. * * The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned * integer to hold the year, and can hold years as large as 65535. * * zlib, upon which libpng depends, is also Y2K compliant. It contains * no date-related code. * * Glenn Randers-Pehrson * libpng maintainer * PNG Development Group */#ifndef PNG_H#define PNG_H/* This is not the place to learn how to use libpng. The file libpng.txt * describes how to use libpng, and the file example.c summarizes it * with some code on which to build. This file is useful for looking * at the actual function definitions and structure components. *//* Version information for png.h - this should match the version in png.c */#define PNG_LIBPNG_VER_STRING "1.2.16"#define PNG_HEADER_VERSION_STRING \ " libpng version 1.2.16 - January 31, 2007 (header)\n"#define PNG_LIBPNG_VER_SONUM 0#define PNG_LIBPNG_VER_DLLNUM 13/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */#define PNG_LIBPNG_VER_MAJOR 1#define PNG_LIBPNG_VER_MINOR 2#define PNG_LIBPNG_VER_RELEASE 16/* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */#define PNG_LIBPNG_VER_BUILD 0/* Release Status */#define PNG_LIBPNG_BUILD_ALPHA 1#define PNG_LIBPNG_BUILD_BETA 2#define PNG_LIBPNG_BUILD_RC 3#define PNG_LIBPNG_BUILD_STABLE 4#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7 /* Release-Specific Flags */#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with PNG_LIBPNG_BUILD_STABLE only */#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with PNG_LIBPNG_BUILD_SPECIAL */#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with PNG_LIBPNG_BUILD_PRIVATE */#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE/* Careful here. At one time, Guy wanted to use 082, but that would be octal. * We must not include leading zeros. * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */#define PNG_LIBPNG_VER 10216 /* 1.2.16 */#ifndef PNG_VERSION_INFO_ONLY/* include the compression library's header */#include "zlib.h"#endif/* include all user configurable info, including optional assembler routines */#include "pngconf.h"/* * Added at libpng-1.2.8 *//* Ref MSDN: Private as priority over Special * VS_FF_PRIVATEBUILD File *was not* built using standard release * procedures. If this value is given, the StringFileInfo block must * contain a PrivateBuild string. * * VS_FF_SPECIALBUILD File *was* built by the original company using * standard release procedures but is a variation of the standard * file of the same version number. If this value is given, the * StringFileInfo block must contain a SpecialBuild string. */#if defined(PNG_USER_PRIVATEBUILD)# define PNG_LIBPNG_BUILD_TYPE \ (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)#else# if defined(PNG_LIBPNG_SPECIALBUILD)# define PNG_LIBPNG_BUILD_TYPE \ (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)# else# define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)# endif#endif#ifndef PNG_VERSION_INFO_ONLY/* Inhibit C++ name-mangling for libpng functions but not for system calls. */#ifdef __cplusplusextern "C" {#endif /* __cplusplus *//* This file is arranged in several sections. The first section contains * structure and type definitions. The second section contains the external * library functions, while the third has the internal library functions, * which applications aren't expected to use directly. */#ifndef PNG_NO_TYPECAST_NULL#define int_p_NULL (int *)NULL#define png_bytep_NULL (png_bytep)NULL#define png_bytepp_NULL (png_bytepp)NULL#define png_doublep_NULL (png_doublep)NULL#define png_error_ptr_NULL (png_error_ptr)NULL#define png_flush_ptr_NULL (png_flush_ptr)NULL#define png_free_ptr_NULL (png_free_ptr)NULL#define png_infopp_NULL (png_infopp)NULL#define png_malloc_ptr_NULL (png_malloc_ptr)NULL#define png_read_status_ptr_NULL (png_read_status_ptr)NULL#define png_rw_ptr_NULL (png_rw_ptr)NULL#define png_structp_NULL (png_structp)NULL#define png_uint_16p_NULL (png_uint_16p)NULL#define png_voidp_NULL (png_voidp)NULL#define png_write_status_ptr_NULL (png_write_status_ptr)NULL#else#define int_p_NULL NULL#define png_bytep_NULL NULL#define png_bytepp_NULL NULL#define png_doublep_NULL NULL#define png_error_ptr_NULL NULL#define png_flush_ptr_NULL NULL#define png_free_ptr_NULL NULL#define png_infopp_NULL NULL#define png_malloc_ptr_NULL NULL#define png_read_status_ptr_NULL NULL#define png_rw_ptr_NULL NULL#define png_structp_NULL NULL#define png_uint_16p_NULL NULL#define png_voidp_NULL NULL#define png_write_status_ptr_NULL NULL#endif/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)/* Version information for C files, stored in png.c. This had better match * the version above. */#ifdef PNG_USE_GLOBAL_ARRAYSPNG_EXPORT_VAR (const char) png_libpng_ver[18]; /* need room for 99.99.99beta99z */#else#define png_libpng_ver png_get_header_ver(NULL)#endif#ifdef PNG_USE_GLOBAL_ARRAYS/* This was removed in version 1.0.5c *//* Structures to facilitate easy interlacing. See png.c for more details */PNG_EXPORT_VAR (const int FARDATA) png_pass_start[7];PNG_EXPORT_VAR (const int FARDATA) png_pass_inc[7];PNG_EXPORT_VAR (const int FARDATA) png_pass_ystart[7];PNG_EXPORT_VAR (const int FARDATA) png_pass_yinc[7];PNG_EXPORT_VAR (const int FARDATA) png_pass_mask[7];PNG_EXPORT_VAR (const int FARDATA) png_pass_dsp_mask[7];#ifdef PNG_USE_PNGGCCRDPNG_EXPORT_VAR (const int FARDATA) png_pass_width[7];#endif/* This isn't currently used. If you need it, see png.c for more details.PNG_EXPORT_VAR (const int FARDATA) png_pass_height[7];*/#endif#endif /* PNG_NO_EXTERN *//* Three color definitions. The order of the red, green, and blue, (and the * exact size) is not important, although the size of the fields need to * be png_byte or png_uint_16 (as defined below). */typedef struct png_color_struct{ png_byte red; png_byte green; png_byte blue;} png_color;typedef png_color FAR * png_colorp;typedef png_color FAR * FAR * png_colorpp;typedef struct png_color_16_struct{ png_byte index; /* used for palette files */ png_uint_16 red; /* for use in red green blue files */ png_uint_16 green; png_uint_16 blue; png_uint_16 gray; /* for use in grayscale files */} png_color_16;typedef png_color_16 FAR * png_color_16p;typedef png_color_16 FAR * FAR * png_color_16pp;typedef struct png_color_8_struct{ png_byte red; /* for use in red green blue files */ png_byte green; png_byte blue; png_byte gray; /* for use in grayscale files */ png_byte alpha; /* for alpha channel files */} png_color_8;typedef png_color_8 FAR * png_color_8p;typedef png_color_8 FAR * FAR * png_color_8pp;/* * The following two structures are used for the in-core representation * of sPLT chunks. */typedef struct png_sPLT_entry_struct{ png_uint_16 red; png_uint_16 green; png_uint_16 blue; png_uint_16 alpha; png_uint_16 frequency;} png_sPLT_entry;typedef png_sPLT_entry FAR * png_sPLT_entryp;typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp;/* When the depth of the sPLT palette is 8 bits, the color and alpha samples * occupy the LSB of their respective members, and the MSB of each member * is zero-filled. The frequency member always occupies the full 16 bits. */typedef struct png_sPLT_struct{ png_charp name; /* palette name */ png_byte depth; /* depth of palette samples */ png_sPLT_entryp entries; /* palette entries */ png_int_32 nentries; /* number of palette entries */} png_sPLT_t;typedef png_sPLT_t FAR * png_sPLT_tp;typedef png_sPLT_t FAR * FAR * png_sPLT_tpp;#ifdef PNG_TEXT_SUPPORTED/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, * and whether that contents is compressed or not. The "key" field * points to a regular zero-terminated C string. The "text", "lang", and * "lang_key" fields can be regular C strings, empty strings, or NULL pointers. * However, the * structure returned by png_get_text() will always contain * regular zero-terminated C strings (possibly empty), never NULL pointers, * so they can be safely used in printf() and other string-handling functions. */typedef struct png_text_struct{ int compression; /* compression value: -1: tEXt, none 0: zTXt, deflate 1: iTXt, none 2: iTXt, deflate */ png_charp key; /* keyword, 1-79 character description of "text" */ png_charp text; /* comment, may be an empty string (ie "") or a NULL pointer */ png_size_t text_length; /* length of the text string */#ifdef PNG_iTXt_SUPPORTED png_size_t itxt_length; /* length of the itxt string */ png_charp lang; /* language code, 0-79 characters or a NULL pointer */ png_charp lang_key; /* keyword translated UTF-8 string, 0 or more chars or a NULL pointer */#endif} png_text;typedef png_text FAR * png_textp;typedef png_text FAR * FAR * png_textpp;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -