📄 png.h
字号:
#if defined(PNG_TIME_RFC1123_SUPPORTED) png_charp time_buffer; /* String to hold RFC 1123 time text */#endif/* New members added in libpng-1.0.6 */#ifdef PNG_FREE_ME_SUPPORTED png_uint_32 free_me; /* flags items libpng is responsible for freeing */#endif#if defined(PNG_USER_CHUNKS_SUPPORTED) png_voidp user_chunk_ptr; png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */#endif#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) int num_chunk_list; png_bytep chunk_list;#endif/* New members added in libpng-1.0.3 */#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) png_byte rgb_to_gray_status; /* These were changed from png_byte in libpng-1.0.6 */ png_uint_16 rgb_to_gray_red_coeff; png_uint_16 rgb_to_gray_green_coeff; png_uint_16 rgb_to_gray_blue_coeff;#endif/* New member added in libpng-1.0.4 (renamed in 1.0.9) */#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)/* changed from png_byte to png_uint_32 at version 1.2.0 */#ifdef PNG_1_0_X png_byte mng_features_permitted;#else png_uint_32 mng_features_permitted;#endif /* PNG_1_0_X */#endif/* New member added in libpng-1.0.7 */#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) png_fixed_point int_gamma;#endif/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */#if defined(PNG_MNG_FEATURES_SUPPORTED) png_byte filter_type;#endif#if defined(PNG_1_0_X) || (defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD))/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */ png_uint_32 row_buf_size;#endif/* New members added in libpng-1.2.0 */#if !defined(PNG_1_0_X) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) png_byte mmx_bitdepth_threshold; png_uint_32 mmx_rowbytes_threshold; png_uint_32 asm_flags;#endif/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */#ifdef PNG_USER_MEM_SUPPORTED png_voidp mem_ptr; /* user supplied struct for mem functions */ png_malloc_ptr malloc_fn; /* function for allocating memory */ png_free_ptr free_fn; /* function for freeing memory */#endif/* New member added in libpng-1.0.13 and 1.2.0 */ png_bytep big_row_buf; /* buffer to save current (unfiltered) row */#if defined(PNG_READ_DITHER_SUPPORTED)/* The following three members were added at version 1.0.14 and 1.2.4 */ png_bytep dither_sort; /* working sort array */ png_bytep index_to_palette; /* where the original index currently is */ /* in the palette */ png_bytep palette_to_index; /* which original index points to this */ /* palette color */#endif};/* This prevents a compiler error in png.c if png.c and png.h are both at version 1.2.5 */typedef png_structp version_1_2_5;typedef png_struct FAR * FAR * png_structpp;/* Here are the function definitions most commonly used. This is not * the place to find out how to use libpng. See libpng.txt for the * full explanation, see example.c for the summary. This just provides * a simple one line description of the use of each function. *//* Returns the version number of the library */extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void));/* Tell lib we have already handled the first <num_bytes> magic bytes. * Handling more than 8 bytes from the beginning of the file is an error. */extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, int num_bytes));/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a * PNG file. Returns zero if the supplied bytes match the 8-byte PNG * signature, and non-zero otherwise. Having num_to_check == 0 or * start > 7 will always fail (ie return non-zero). */extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, png_size_t num_to_check));/* Simple signature checking function. This is the same as calling * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). */extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num));/* Allocate and initialize png_ptr struct for reading, and any other memory. */extern PNG_EXPORT(png_structp,png_create_read_struct) PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn));/* Allocate and initialize png_ptr struct for writing, and any other memory */extern PNG_EXPORT(png_structp,png_create_write_struct) PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn));extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size) PNGARG((png_structp png_ptr));extern PNG_EXPORT(void,png_set_compression_buffer_size) PNGARG((png_structp png_ptr, png_uint_32 size));/* Reset the compression stream */extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr));/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */#ifdef PNG_USER_MEM_SUPPORTEDextern PNG_EXPORT(png_structp,png_create_read_struct_2) PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn));extern PNG_EXPORT(png_structp,png_create_write_struct_2) PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn));#endif/* Write a PNG chunk - size, type, (optional) data, CRC. */extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, png_bytep chunk_name, png_bytep data, png_size_t length));/* Write the start of a PNG chunk - length and chunk name. */extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, png_bytep chunk_name, png_uint_32 length));/* Write the data of a PNG chunk started with png_write_chunk_start(). */extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, png_bytep data, png_size_t length));/* Finish a chunk started with png_write_chunk_start() (includes CRC). */extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr));/* Allocate and initialize the info structure */extern PNG_EXPORT(png_infop,png_create_info_struct) PNGARG((png_structp png_ptr));/* Initialize the info structure (old interface - DEPRECATED) */extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));#undef png_info_init#define png_info_init(info_ptr) png_info_init_3(&info_ptr, sizeof(png_info));extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, png_size_t png_info_struct_size));/* Writes all the PNG information before the image. */extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, png_infop info_ptr));extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, png_infop info_ptr));/* read the information before the actual image data. */extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, png_infop info_ptr));#if defined(PNG_TIME_RFC1123_SUPPORTED)extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) PNGARG((png_structp png_ptr, png_timep ptime));#endif#if !defined(_WIN32_WCE)/* "time.h" functions are not supported on WindowsCE */#if defined(PNG_WRITE_tIME_SUPPORTED)/* convert from a struct tm to png_time */extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, struct tm FAR * ttime));/* convert from time_t to png_time. Uses gmtime() */extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, time_t ttime));#endif /* PNG_WRITE_tIME_SUPPORTED */#endif /* _WIN32_WCE */#if defined(PNG_READ_EXPAND_SUPPORTED)/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr));extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr));extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr));extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)/* Use blue, green, red order for pixels. */extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)/* Expand the grayscale to 24-bit RGB if necessary. */extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)/* Reduce RGB to grayscale. */#ifdef PNG_FLOATING_POINT_SUPPORTEDextern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, int error_action, double red, double green ));#endifextern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, int error_action, png_fixed_point red, png_fixed_point green ));extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp png_ptr));#endifextern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, png_colorp palette));#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)/* Add a filler byte to 24-bit RGB images. */extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr, png_uint_32 filler, int flags));/* The values of the PNG_FILLER_ defines should NOT be changed */#define PNG_FILLER_BEFORE 0#define PNG_FILLER_AFTER 1#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)/* Swap bytes in 16-bit depth files. */extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)/* Swap packing order of pixels in bytes. */extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)/* Converts files to legal bit depths. */extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, png_color_8p true_bits));#endif#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ defined(PNG_WRITE_INTERLACING_SUPPORTED)/* Have the code handle the interlacing. Returns the number of passes. */extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)/* Invert monochrome files */extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr));#endif#if defined(PNG_READ_BACKGROUND_SUPPORTED)/* Handle alpha and tRNS by replacing with a background color. */#ifdef PNG_FLOATING_POINT_SUPPORTEDextern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, png_colo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -