39# define _POSIX_SOURCE 1
42#ifndef PNG_VERSION_INFO_ONLY
59#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
63# define PNG_RESTRICT restrict
76#if defined(PNG_PREFIX) && !defined(PNGPREFIX_H)
77# include "pngprefix.h"
83# ifndef PNG_USER_PRIVATEBUILD
84# define PNG_USER_PRIVATEBUILD "Custom libpng build"
86# ifndef PNG_USER_DLLFNAME_POSTFIX
87# define PNG_USER_DLLFNAME_POSTFIX "Cb"
110#ifndef PNG_ARM_NEON_OPT
130# if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
131 defined(PNG_ALIGNED_MEMORY_SUPPORTED)
132# define PNG_ARM_NEON_OPT 2
134# define PNG_ARM_NEON_OPT 0
138#if PNG_ARM_NEON_OPT > 0
142# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
158# ifndef PNG_ARM_NEON_IMPLEMENTATION
159# if defined(__ARM_NEON__) || defined(__ARM_NEON)
160# if defined(__clang__)
166# elif defined(__GNUC__)
170# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
171# define PNG_ARM_NEON_IMPLEMENTATION 2
177# if !defined(__aarch64__) && !defined(_M_ARM64)
179# define PNG_ARM_NEON_IMPLEMENTATION 2
184# ifndef PNG_ARM_NEON_IMPLEMENTATION
186# define PNG_ARM_NEON_IMPLEMENTATION 1
189# define PNG_ARM_NEON_IMPLEMENTATION 0
192#ifndef PNG_MIPS_MSA_OPT
193# if defined(__mips_msa) && (__mips_isa_rev >= 5) && defined(PNG_ALIGNED_MEMORY_SUPPORTED)
194# define PNG_MIPS_MSA_OPT 2
196# define PNG_MIPS_MSA_OPT 0
200#ifndef PNG_POWERPC_VSX_OPT
201# if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)
202# define PNG_POWERPC_VSX_OPT 2
204# define PNG_POWERPC_VSX_OPT 0
208#ifndef PNG_INTEL_SSE_OPT
214# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
215 defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
216 (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
217# define PNG_INTEL_SSE_OPT 1
219# define PNG_INTEL_SSE_OPT 0
222# define PNG_INTEL_SSE_OPT 0
226#if PNG_INTEL_SSE_OPT > 0
227# ifndef PNG_INTEL_SSE_IMPLEMENTATION
228# if defined(__SSE4_1__) || defined(__AVX__)
232# define PNG_INTEL_SSE_IMPLEMENTATION 3
233# elif defined(__SSSE3__)
234# define PNG_INTEL_SSE_IMPLEMENTATION 2
235# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
236 (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
237# define PNG_INTEL_SSE_IMPLEMENTATION 1
239# define PNG_INTEL_SSE_IMPLEMENTATION 0
243# if PNG_INTEL_SSE_IMPLEMENTATION > 0
244# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
247# define PNG_INTEL_SSE_IMPLEMENTATION 0
250#if PNG_MIPS_MSA_OPT > 0
251# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
252# ifndef PNG_MIPS_MSA_IMPLEMENTATION
253# if defined(__mips_msa)
254# if defined(__clang__)
255# elif defined(__GNUC__)
256# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
257# define PNG_MIPS_MSA_IMPLEMENTATION 2
261# define PNG_MIPS_MSA_IMPLEMENTATION 2
265# ifndef PNG_MIPS_MSA_IMPLEMENTATION
266# define PNG_MIPS_MSA_IMPLEMENTATION 1
269# define PNG_MIPS_MSA_IMPLEMENTATION 0
272#if PNG_POWERPC_VSX_OPT > 0
273# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_vsx
274# define PNG_POWERPC_VSX_IMPLEMENTATION 1
276# define PNG_POWERPC_VSX_IMPLEMENTATION 0
294# define PNG_BUILD_DLL
303# define PNG_BUILD_DLL
309# define PNG_BUILD_DLL
327# define PNG_IMPEXP PNG_DLL_EXPORT
337#ifndef PNG_DEPRECATED
338# define PNG_DEPRECATED
349#ifndef PNG_INTERNAL_DATA
350# define PNG_INTERNAL_DATA(type, name, array) PNG_LINKAGE_DATA type name array
353#ifndef PNG_INTERNAL_FUNCTION
354# define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\
355 PNG_LINKAGE_FUNCTION PNG_FUNCTION(type, name, args, PNG_EMPTY attributes)
358#ifndef PNG_INTERNAL_CALLBACK
359# define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\
360 PNG_LINKAGE_CALLBACK PNG_FUNCTION(type, (PNGCBAPI name), args,\
361 PNG_EMPTY attributes)
374# ifndef PNG_FLOATING_POINT_SUPPORTED
375# define PNG_FP_EXPORT(ordinal, type, name, args)\
376 PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY);
377# ifndef PNG_VERSION_INFO_ONLY
385#ifndef PNG_FIXED_EXPORT
386# ifndef PNG_FIXED_POINT_SUPPORTED
387# define PNG_FIXED_EXPORT(ordinal, type, name, args)\
388 PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY);
395#ifndef PNG_DLL_EXPORT
396# define PNG_DLL_EXPORT
411#ifndef PNG_RELEASE_BUILD
412# define PNG_RELEASE_BUILD (PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC)
433#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
434# define PNG_MAX_MALLOC_64K
444# define PNG_UNUSED(param) (void)param;
450#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
452# define PNG_ZBUF_SIZE 65536L
459#ifdef PNG_WARNINGS_SUPPORTED
460# define PNG_WARNING_PARAMETERS(p) png_warning_parameters p;
462# define png_warning_parameter(p,number,string) ((void)0)
463# define png_warning_parameter_unsigned(p,number,format,value) ((void)0)
464# define png_warning_parameter_signed(p,number,format,value) ((void)0)
465# define png_formatted_warning(pp,p,message) ((void)(pp))
466# define PNG_WARNING_PARAMETERS(p)
468#ifndef PNG_ERROR_TEXT_SUPPORTED
469# define png_fixed_error(s1,s2) png_err(s1)
476#ifdef PNG_FIXED_POINT_SUPPORTED
477# define PNGFAPI PNGAPI
482#ifndef PNG_VERSION_INFO_ONLY
493# define png_voidcast(type, value) static_cast<type>(value)
494# define png_constcast(type, value) const_cast<type>(value)
495# define png_aligncast(type, value) \
496 static_cast<type>(static_cast<void*>(value))
497# define png_aligncastconst(type, value) \
498 static_cast<type>(static_cast<const void*>(value))
500# define png_voidcast(type, value) (value)
501# define png_constcast(type, value) ((type)(void*)(const void*)(value))
502# define png_aligncast(type, value) ((void*)(value))
503# define png_aligncastconst(type, value) ((const void*)(value))
506#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
507 defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
517# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
518 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
523# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
529# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
538#if defined(__TURBOC__) && defined(__MSDOS__)
543#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
555# define PNG_ABORT() abort()
559#define PNG_ALIGN_NONE 0
560#define PNG_ALIGN_ALWAYS 1
562# define PNG_ALIGN_OFFSET 2
564# define PNG_ALIGN_OFFSET -1
566#define PNG_ALIGN_SIZE 3
568#ifndef PNG_ALIGN_TYPE
573# define PNG_ALIGN_TYPE PNG_ALIGN_SIZE
576#if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE
583# define png_alignof(type) (sizeof(type))
585# if PNG_ALIGN_TYPE == PNG_ALIGN_OFFSET
586# define png_alignof(type) offsetof(struct{char c; type t;}, t)
588# if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS
589# define png_alignof(type) 1
597# define png_isaligned(ptr, type) \
598 (((type)(size_t)((const void*)(ptr)) & (type)(png_alignof(type)-1)) == 0)
600# define png_isaligned(ptr, type) 0
617#define PNG_HAVE_IDAT 0x04U
619#define PNG_HAVE_IEND 0x10U
623#define PNG_HAVE_CHUNK_HEADER 0x100U
624#define PNG_WROTE_tIME 0x200U
625#define PNG_WROTE_INFO_BEFORE_PLTE 0x400U
626#define PNG_BACKGROUND_IS_GRAY 0x800U
627#define PNG_HAVE_PNG_SIGNATURE 0x1000U
628#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U
630#define PNG_IS_READ_STRUCT 0x8000U
633#define PNG_BGR 0x0001U
634#define PNG_INTERLACE 0x0002U
635#define PNG_PACK 0x0004U
636#define PNG_SHIFT 0x0008U
637#define PNG_SWAP_BYTES 0x0010U
638#define PNG_INVERT_MONO 0x0020U
639#define PNG_QUANTIZE 0x0040U
640#define PNG_COMPOSE 0x0080U
641#define PNG_BACKGROUND_EXPAND 0x0100U
642#define PNG_EXPAND_16 0x0200U
643#define PNG_16_TO_8 0x0400U
644#define PNG_RGBA 0x0800U
645#define PNG_EXPAND 0x1000U
646#define PNG_GAMMA 0x2000U
647#define PNG_GRAY_TO_RGB 0x4000U
648#define PNG_FILLER 0x8000U
649#define PNG_PACKSWAP 0x10000U
650#define PNG_SWAP_ALPHA 0x20000U
651#define PNG_STRIP_ALPHA 0x40000U
652#define PNG_INVERT_ALPHA 0x80000U
653#define PNG_USER_TRANSFORM 0x100000U
654#define PNG_RGB_TO_GRAY_ERR 0x200000U
655#define PNG_RGB_TO_GRAY_WARN 0x400000U
656#define PNG_RGB_TO_GRAY 0x600000U
657#define PNG_ENCODE_ALPHA 0x800000U
658#define PNG_ADD_ALPHA 0x1000000U
659#define PNG_EXPAND_tRNS 0x2000000U
660#define PNG_SCALE_16_TO_8 0x4000000U
666#define PNG_STRUCT_PNG 0x0001U
667#define PNG_STRUCT_INFO 0x0002U
670#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001U
671#define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002U
673#define PNG_FLAG_ZSTREAM_ENDED 0x0008U
676#define PNG_FLAG_ROW_INIT 0x0040U
677#define PNG_FLAG_FILLER_AFTER 0x0080U
678#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100U
679#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200U
680#define PNG_FLAG_CRC_CRITICAL_USE 0x0400U
681#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800U
682#define PNG_FLAG_ASSUME_sRGB 0x1000U
683#define PNG_FLAG_OPTIMIZE_ALPHA 0x2000U
684#define PNG_FLAG_DETECT_UNINITIALIZED 0x4000U
687#define PNG_FLAG_LIBRARY_MISMATCH 0x20000U
688#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000U
689#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000U
690#define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000U
691#define PNG_FLAG_APP_WARNINGS_WARN 0x200000U
692#define PNG_FLAG_APP_ERRORS_WARN 0x400000U
702#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
703 PNG_FLAG_CRC_ANCILLARY_NOWARN)
705#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \
706 PNG_FLAG_CRC_CRITICAL_IGNORE)
708#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \
709 PNG_FLAG_CRC_CRITICAL_MASK)
713#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
714 abs((int)((c1).green) - (int)((c2).green)) + \
715 abs((int)((c1).blue) - (int)((c2).blue)))
725#define PNG_DIV65535(v24) (((v24) + 32895) >> 16)
726#define PNG_DIV257(v16) PNG_DIV65535((png_uint_32)(v16) * 255)
729#define PNG_ROWBYTES(pixel_bits, width) \
730 ((pixel_bits) >= 8 ? \
731 ((size_t)(width) * (((size_t)(pixel_bits)) >> 3)) : \
732 (( ((size_t)(width) * ((size_t)(pixel_bits))) + 7) >> 3) )
746#define PNG_TRAILBITS(pixel_bits, width) \
747 (((pixel_bits) * ((width) % (png_uint_32)8)) % 8)
749#define PNG_PADBITS(pixel_bits, width) \
750 ((8 - PNG_TRAILBITS(pixel_bits, width)) % 8)
757#define PNG_OUT_OF_RANGE(value, ideal, delta) \
758 ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
764#ifdef PNG_FLOATING_POINT_SUPPORTED
772#define png_float(png_ptr, fixed, s) (.00001 * (fixed))
790#ifdef PNG_FIXED_POINT_MACRO_SUPPORTED
791#define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\
792 ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0))
812#define PNG_32b(b,s) ((png_uint_32)(b) << (s))
813#define PNG_U32(b1,b2,b3,b4) \
814 (PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0))
839#define png_IDAT PNG_U32( 73, 68, 65, 84)
840#define png_IEND PNG_U32( 73, 69, 78, 68)
841#define png_IHDR PNG_U32( 73, 72, 68, 82)
842#define png_PLTE PNG_U32( 80, 76, 84, 69)
843#define png_bKGD PNG_U32( 98, 75, 71, 68)
844#define png_cHRM PNG_U32( 99, 72, 82, 77)
845#define png_eXIf PNG_U32(101, 88, 73, 102)
846#define png_fRAc PNG_U32(102, 82, 65, 99)
847#define png_gAMA PNG_U32(103, 65, 77, 65)
848#define png_gIFg PNG_U32(103, 73, 70, 103)
849#define png_gIFt PNG_U32(103, 73, 70, 116)
850#define png_gIFx PNG_U32(103, 73, 70, 120)
851#define png_hIST PNG_U32(104, 73, 83, 84)
852#define png_iCCP PNG_U32(105, 67, 67, 80)
853#define png_iTXt PNG_U32(105, 84, 88, 116)
854#define png_oFFs PNG_U32(111, 70, 70, 115)
855#define png_pCAL PNG_U32(112, 67, 65, 76)
856#define png_pHYs PNG_U32(112, 72, 89, 115)
857#define png_sBIT PNG_U32(115, 66, 73, 84)
858#define png_sCAL PNG_U32(115, 67, 65, 76)
859#define png_sPLT PNG_U32(115, 80, 76, 84)
860#define png_sRGB PNG_U32(115, 82, 71, 66)
861#define png_sTER PNG_U32(115, 84, 69, 82)
862#define png_tEXt PNG_U32(116, 69, 88, 116)
863#define png_tIME PNG_U32(116, 73, 77, 69)
864#define png_tRNS PNG_U32(116, 82, 78, 83)
865#define png_zTXt PNG_U32(122, 84, 88, 116)
870#define PNG_CHUNK_FROM_STRING(s)\
871 PNG_U32(0xff & (s)[0], 0xff & (s)[1], 0xff & (s)[2], 0xff & (s)[3])
877#define PNG_STRING_FROM_CHUNK(s,c)\
878 (void)(((char*)(s))[0]=(char)(((c)>>24) & 0xff), \
879 ((char*)(s))[1]=(char)(((c)>>16) & 0xff),\
880 ((char*)(s))[2]=(char)(((c)>>8) & 0xff), \
881 ((char*)(s))[3]=(char)((c & 0xff)))
884#define PNG_CSTRING_FROM_CHUNK(s,c)\
885 (void)(PNG_STRING_FROM_CHUNK(s,c), ((char*)(s))[4] = 0)
888#define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29))
889#define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c))
890#define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21))
891#define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13))
892#define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5))
895#define PNG_GAMMA_MAC_OLD 151724
896#define PNG_GAMMA_MAC_INVERSE 65909
897#define PNG_GAMMA_sRGB_INVERSE 45455
902#ifndef PNG_VERSION_INFO_ONLY
910#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM
911# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
912 "-I (include path) error: see the notes in pngpriv.h"
931#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\
932 defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
933#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
943#define PNG_sRGB_FROM_LINEAR(linear) \
944 ((png_byte)(0xff & ((png_sRGB_base[(linear)>>15] \
945 + ((((linear) & 0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8)))
964#define PNG_UNEXPECTED_ZLIB_RETURN (-7)
971#ifdef PNG_WRITE_SUPPORTED
977#if defined(PNG_FLOATING_POINT_SUPPORTED) && \
978 !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \
979 (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \
980 defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \
981 defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \
982 (defined(PNG_sCAL_SUPPORTED) && \
983 defined(PNG_FLOATING_ARITHMETIC_SUPPORTED))
1001#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\
1002 defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED)
1026 png_error_ptr warn_fn,
png_voidp mem_ptr, png_malloc_ptr malloc_fn,
1051#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
1059#ifdef PNG_WRITE_FLUSH_SUPPORTED
1060# ifdef PNG_STDIO_SUPPORTED
1103#ifdef PNG_WRITE_FLUSH_SUPPORTED
1114 int compression_method,
int filter_method,
int interlace_method),
PNG_EMPTY);
1125#ifdef PNG_WRITE_gAMA_SUPPORTED
1130#ifdef PNG_WRITE_sBIT_SUPPORTED
1135#ifdef PNG_WRITE_cHRM_SUPPORTED
1141#ifdef PNG_WRITE_sRGB_SUPPORTED
1146#ifdef PNG_WRITE_eXIf_SUPPORTED
1151#ifdef PNG_WRITE_iCCP_SUPPORTED
1160#ifdef PNG_WRITE_sPLT_SUPPORTED
1165#ifdef PNG_WRITE_tRNS_SUPPORTED
1171#ifdef PNG_WRITE_bKGD_SUPPORTED
1176#ifdef PNG_WRITE_hIST_SUPPORTED
1182#ifdef PNG_WRITE_tEXt_SUPPORTED
1187#ifdef PNG_WRITE_zTXt_SUPPORTED
1192#ifdef PNG_WRITE_iTXt_SUPPORTED
1198#ifdef PNG_TEXT_SUPPORTED
1203#ifdef PNG_WRITE_oFFs_SUPPORTED
1205 png_int_32 x_offset, png_int_32 y_offset,
int unit_type),
PNG_EMPTY);
1208#ifdef PNG_WRITE_pCAL_SUPPORTED
1210 png_charp purpose, png_int_32 X0, png_int_32 X1,
int type,
int nparams,
1214#ifdef PNG_WRITE_pHYs_SUPPORTED
1220#ifdef PNG_WRITE_tIME_SUPPORTED
1225#ifdef PNG_WRITE_sCAL_SUPPORTED
1261#ifndef PNG_USE_COMPILE_TIME_MASKS
1262# define PNG_USE_COMPILE_TIME_MASKS 1
1267#ifdef PNG_READ_INTERLACING_SUPPORTED
1280#ifdef PNG_WRITE_INTERLACING_SUPPORTED
1292#if PNG_ARM_NEON_OPT > 0
1309#if PNG_MIPS_MSA_OPT > 0
1326#if PNG_POWERPC_VSX_OPT > 0
1343#if PNG_INTEL_SSE_IMPLEMENTATION > 0
1362#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
1384#if ZLIB_VERNUM >= 0x1240
1387# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush)
1389# define PNG_INFLATE(pp, flush) inflate(&(pp)->zstream, flush)
1392#ifdef PNG_READ_TRANSFORMS_SUPPORTED
1399#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
1400 defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
1405#ifdef PNG_16BIT_SUPPORTED
1406#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
1412#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
1413 defined(PNG_WRITE_PACKSWAP_SUPPORTED)
1418#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
1423#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
1440#ifdef PNG_READ_bKGD_SUPPORTED
1445#ifdef PNG_READ_cHRM_SUPPORTED
1450#ifdef PNG_READ_eXIf_SUPPORTED
1455#ifdef PNG_READ_gAMA_SUPPORTED
1460#ifdef PNG_READ_hIST_SUPPORTED
1465#ifdef PNG_READ_iCCP_SUPPORTED
1470#ifdef PNG_READ_iTXt_SUPPORTED
1475#ifdef PNG_READ_oFFs_SUPPORTED
1480#ifdef PNG_READ_pCAL_SUPPORTED
1485#ifdef PNG_READ_pHYs_SUPPORTED
1490#ifdef PNG_READ_sBIT_SUPPORTED
1495#ifdef PNG_READ_sCAL_SUPPORTED
1500#ifdef PNG_READ_sPLT_SUPPORTED
1505#ifdef PNG_READ_sRGB_SUPPORTED
1510#ifdef PNG_READ_tEXt_SUPPORTED
1515#ifdef PNG_READ_tIME_SUPPORTED
1520#ifdef PNG_READ_tRNS_SUPPORTED
1525#ifdef PNG_READ_zTXt_SUPPORTED
1544#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\
1545 defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
1554#ifdef PNG_READ_TRANSFORMS_SUPPORTED
1558#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
1563#ifdef PNG_READ_TRANSFORMS_SUPPORTED
1568#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
1597# ifdef PNG_READ_tEXt_SUPPORTED
1603# ifdef PNG_READ_zTXt_SUPPORTED
1609# ifdef PNG_READ_iTXt_SUPPORTED
1619#ifdef PNG_GAMMA_SUPPORTED
1639#ifdef PNG_COLORSPACE_SUPPORTED
1651#ifdef PNG_sRGB_SUPPORTED
1661#ifdef PNG_iCCP_SUPPORTED
1669#ifdef PNG_READ_iCCP_SUPPORTED
1683#ifdef PNG_sRGB_SUPPORTED
1694#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
1704 int color_type,
int interlace_type,
int compression_type,
1708#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
1709 defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
1714#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
1729#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED)
1739#define PNG_FORMAT_NUMBER(buffer,format,number) \
1740 png_format_number(buffer, buffer + (sizeof buffer), format, number)
1743#define PNG_NUMBER_BUFFER_SIZE 24
1748#define PNG_NUMBER_FORMAT_u 1
1749#define PNG_NUMBER_FORMAT_02u 2
1750#define PNG_NUMBER_FORMAT_d 1
1751#define PNG_NUMBER_FORMAT_02d 2
1752#define PNG_NUMBER_FORMAT_x 3
1753#define PNG_NUMBER_FORMAT_02x 4
1754#define PNG_NUMBER_FORMAT_fixed 5
1757#ifdef PNG_WARNINGS_SUPPORTED
1759# define PNG_WARNING_PARAMETER_SIZE 32
1760# define PNG_WARNING_PARAMETER_COUNT 8
1765typedef char png_warning_parameters[PNG_WARNING_PARAMETER_COUNT][
1766 PNG_WARNING_PARAMETER_SIZE];
1791#ifdef PNG_BENIGN_ERRORS_SUPPORTED
1818# define png_app_warning(pp,s) png_warning(pp,s)
1819# define png_app_error(pp,s) png_error(pp,s)
1833#define PNG_CHUNK_WARNING 0
1834#define PNG_CHUNK_WRITE_ERROR 1
1835#define PNG_CHUNK_ERROR 2
1840#if defined(PNG_sCAL_SUPPORTED)
1846#define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1+1+10)
1848#ifdef PNG_FLOATING_POINT_SUPPORTED
1854#ifdef PNG_FIXED_POINT_SUPPORTED
1860#if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED)
1891#define PNG_FP_INTEGER 0
1892#define PNG_FP_FRACTION 1
1893#define PNG_FP_EXPONENT 2
1894#define PNG_FP_STATE 3
1895#define PNG_FP_SAW_SIGN 4
1896#define PNG_FP_SAW_DIGIT 8
1897#define PNG_FP_SAW_DOT 16
1898#define PNG_FP_SAW_E 32
1899#define PNG_FP_SAW_ANY 60
1903#define PNG_FP_WAS_VALID 64
1904#define PNG_FP_NEGATIVE 128
1905#define PNG_FP_NONZERO 256
1906#define PNG_FP_STICKY 448
1911#define PNG_FP_INVALID 512
1916#define PNG_FP_MAYBE 0
1924#define PNG_FP_NZ_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NEGATIVE | PNG_FP_NONZERO)
1926#define PNG_FP_Z_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NONZERO)
1929#define PNG_FP_IS_ZERO(state) (((state) & PNG_FP_Z_MASK) == PNG_FP_SAW_DIGIT)
1930#define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK)
1931#define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK)
1961#if defined(PNG_GAMMA_SUPPORTED) ||\
1962 defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED)
1970 png_int_32 multiplied_by, png_int_32 divided_by),
PNG_EMPTY);
1973#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
1980#ifdef PNG_GAMMA_SUPPORTED
1988#ifdef PNG_READ_GAMMA_SUPPORTED
2002#ifdef PNG_READ_GAMMA_SUPPORTED
2023#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\
2024 defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
2026typedef struct png_control
2035 unsigned int for_write :1;
2036 unsigned int owned_file :1;
2043# define png_control_jmp_buf(pc) (((jmp_buf*)((pc)->error_buf))[0])
2045# define png_control_jmp_buf(pc) ((pc)->error_buf)
2055#ifdef PNG_WARNINGS_SUPPORTED
2059# define png_safe_warning 0
2071#ifndef PNG_SIMPLIFIED_READ_SUPPORTED
2083#ifdef PNG_FILTER_OPTIMIZATIONS
2092# if PNG_ARM_NEON_OPT > 0
2097#if PNG_MIPS_MSA_OPT > 0
2102# if PNG_INTEL_SSE_IMPLEMENTATION > 0
2111#if PNG_ARM_NEON_IMPLEMENTATION == 1
2113 png_riffle_palette_neon,
2117 png_do_expand_palette_rgba8_neon,
2125 png_do_expand_palette_rgb8_neon,
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
void error_message(HWND hwnd, const char *msg)
static HCRYPTKEY new_key(HCRYPTPROV hProv, ALG_ID aiAlgid, DWORD dwFlags, CRYPTKEY **ppCryptKey)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLboolean GLenum GLenum GLvoid * values
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint GLsizei GLsizei * length
GLenum GLuint GLsizei bufsize
GLboolean GLboolean GLboolean GLboolean a
GLenum GLint GLint * precision
static unsigned int number
static char memory[1024 *256]
png_const_structrp png_const_inforp int * unit
const png_struct *PNG_RESTRICT png_const_structrp
png_info *PNG_RESTRICT png_inforp
png_struct *PNG_RESTRICT png_structrp
png_const_structrp png_const_inforp info_ptr
png_int_32 png_fixed_point
const png_byte * png_const_bytep
const png_uint_16 * png_const_uint_16p
png_uint_16 * png_uint_16p
png_fixed_point * png_fixed_point_p
const char * png_const_charp
#define png_fixed_error(s1, s2)
#define png_warning_parameter_unsigned(p, number, format, value)
#define png_app_error(pp, s)
#define png_app_warning(pp, s)
#define png_warning_parameter_signed(p, number, format, value)
png_double ** png_doublepp
#define PNG_INTERNAL_DATA(type, name, array)
const png_uint_16p * png_const_uint_16pp
#define PNG_INTERNAL_CALLBACK(type, name, args, attributes)
struct png_incomplete png_double
#define PNG_INTERNAL_FUNCTION(type, name, args, attributes)
#define png_warning_parameter(p, number, string)
#define png_formatted_warning(pp, p, message)
const png_double * png_const_doublep
static const WCHAR lang[]