19#ifdef PNG_READ_SUPPORTED
32#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_READ_cHRM_SUPPORTED)
38#define PNG_FIXED_ERROR (-1)
56#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED
88 if ((uval & 0x80000000) == 0)
91 uval = (uval ^ 0xffffffff) + 1;
92 if ((uval & 0x80000000) == 0)
111 ((
unsigned int)(*buf) << 8) +
112 ((
unsigned int)(*(buf + 1)));
123 size_t num_checked, num_to_check;
129 num_checked =
png_ptr->sig_bytes;
130 num_to_check = 8 - num_checked;
132#ifdef PNG_IO_STATE_SUPPORTED
142 if (num_checked < 4 &&
161#ifdef PNG_IO_STATE_SUPPORTED
174 png_debug2(0,
"Reading %lx chunk, length = %lu",
187#ifdef PNG_IO_STATE_SUPPORTED
221 len = (
sizeof tmpbuf);
253 png_byte crc_bytes[4];
270#ifdef PNG_IO_STATE_SUPPORTED
287#if defined(PNG_READ_iCCP_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) ||\
288 defined(PNG_READ_pCAL_SUPPORTED) || defined(PNG_READ_sCAL_SUPPORTED) ||\
289 defined(PNG_READ_sPLT_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) ||\
290 defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_SEQUENTIAL_READ_SUPPORTED)
302 if (buffer !=
NULL && new_size >
png_ptr->read_buffer_size)
317 memset(buffer, 0, new_size);
319 png_ptr->read_buffer_size = new_size;
377#if ZLIB_VERNUM >= 0x1240
380# if defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_MAXIMUM_INFLATE_WINDOW)
381 if (((
png_ptr->options >> PNG_MAXIMUM_INFLATE_WINDOW) & 3) ==
402 png_ptr->zstream.avail_out = 0;
406#if ZLIB_VERNUM >= 0x1240
407 ret = inflateReset2(&
png_ptr->zstream, window_bits);
415#if ZLIB_VERNUM >= 0x1240
425#if ZLIB_VERNUM >= 0x1290 && \
426 defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
427 if (((
png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
429 ret = inflateValidate(&
png_ptr->zstream, 0);
446#if ZLIB_VERNUM >= 0x1240
458 if ((*
png_ptr->zstream.next_in >> 4) > 7)
460 png_ptr->zstream.msg =
"invalid window size (libpng)";
471#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED
472#if defined(PNG_READ_zTXt_SUPPORTED) || defined (PNG_READ_iTXt_SUPPORTED)
487 png_bytep output, png_alloc_size_t *output_size_ptr)
492 png_alloc_size_t avail_out = *output_size_ptr;
507 png_ptr->zstream.avail_out = 0;
513 png_ptr->zstream.next_out = output;
528 avail_in +=
png_ptr->zstream.avail_in;
532 if (avail_in < avail)
533 avail = (
uInt)avail_in;
536 png_ptr->zstream.avail_in = avail;
539 avail_out +=
png_ptr->zstream.avail_out;
548 png_ptr->zstream.next_out = local_buffer;
549 if ((
sizeof local_buffer) < avail)
550 avail = (
sizeof local_buffer);
553 if (avail_out < avail)
554 avail = (
uInt)avail_out;
556 png_ptr->zstream.avail_out = avail;
567 }
while (ret ==
Z_OK);
574 avail_in +=
png_ptr->zstream.avail_in;
575 avail_out +=
png_ptr->zstream.avail_out;
581 *output_size_ptr -= avail_out;
584 *input_size_ptr -= avail_in;
612 png_alloc_size_t *newlength ,
624# ifdef PNG_SET_USER_LIMITS_SUPPORTED
625 if (
png_ptr->user_chunk_malloc_max > 0 &&
628# elif PNG_USER_CHUNK_MALLOC_MAX > 0
629 if (PNG_USER_CHUNK_MALLOC_MAX <
limit)
630 limit = PNG_USER_CHUNK_MALLOC_MAX;
633 if (
limit >= prefix_size + (terminate != 0))
637 limit -= prefix_size + (terminate != 0);
639 if (
limit < *newlength)
650 png_ptr->read_buffer + prefix_size, &lzsize,
669 png_alloc_size_t new_size = *newlength;
670 png_alloc_size_t buffer_size = prefix_size + new_size +
677 memset(
text, 0, buffer_size);
680 png_ptr->read_buffer + prefix_size, &lzsize,
681 text + prefix_size, newlength);
685 if (new_size == *newlength)
688 text[prefix_size + *newlength] = 0;
697 png_ptr->read_buffer_size = buffer_size;
714 else if (ret ==
Z_OK)
726 chunklength - prefix_size != lzsize)
746 else if (ret ==
Z_OK)
769#ifdef PNG_READ_iCCP_SUPPORTED
783 png_ptr->zstream.next_out = next_out;
784 png_ptr->zstream.avail_out = 0;
788 if (
png_ptr->zstream.avail_in == 0)
790 if (read_size > *chunk_bytes)
791 read_size = (
uInt)*chunk_bytes;
792 *chunk_bytes -= read_size;
798 png_ptr->zstream.avail_in = read_size;
801 if (
png_ptr->zstream.avail_out == 0)
804 if (avail > *out_size)
805 avail = (
uInt)*out_size;
808 png_ptr->zstream.avail_out = avail;
818 while (ret ==
Z_OK && (*out_size > 0 ||
png_ptr->zstream.avail_out > 0));
820 *out_size +=
png_ptr->zstream.avail_out;
821 png_ptr->zstream.avail_out = 0;
843 int bit_depth, color_type, compression_type, filter_type;
864 compression_type = buf[10];
865 filter_type = buf[11];
866 interlace_type = buf[12];
871 png_ptr->bit_depth = (png_byte)bit_depth;
872 png_ptr->interlaced = (png_byte)interlace_type;
873 png_ptr->color_type = (png_byte)color_type;
874#ifdef PNG_MNG_FEATURES_SUPPORTED
875 png_ptr->filter_type = (png_byte)filter_type;
877 png_ptr->compression_type = (png_byte)compression_type;
908 color_type, interlace_type, compression_type, filter_type);
916 int max_palette_length, num,
i;
917#ifdef PNG_POINTER_INDEXING_SUPPORTED
953#ifndef PNG_READ_OPT_PLTE_SUPPORTED
983 max_palette_length = (1 <<
png_ptr->bit_depth);
987 if (num > max_palette_length)
988 num = max_palette_length;
990#ifdef PNG_POINTER_INDEXING_SUPPORTED
991 for (
i = 0, pal_ptr = palette;
i < num;
i++, pal_ptr++)
996 pal_ptr->
red = buf[0];
997 pal_ptr->
green = buf[1];
998 pal_ptr->
blue = buf[2];
1001 for (
i = 0;
i < num;
i++)
1007 palette[
i].
red = buf[0];
1008 palette[
i].
green = buf[1];
1009 palette[
i].
blue = buf[2];
1018#ifndef PNG_READ_OPT_PLTE_SUPPORTED
1025#ifndef PNG_READ_OPT_PLTE_SUPPORTED
1071#ifdef PNG_READ_tRNS_SUPPORTED
1088#ifdef PNG_READ_hIST_SUPPORTED
1093#ifdef PNG_READ_bKGD_SUPPORTED
1118#ifdef PNG_READ_gAMA_SUPPORTED
1156#ifdef PNG_READ_sBIT_SUPPORTED
1160 unsigned int truelen,
i;
1161 png_byte sample_depth;
1192 sample_depth =
png_ptr->bit_depth;
1202 buf[0] = buf[1] = buf[2] = buf[3] = sample_depth;
1208 for (
i=0;
i<truelen; ++
i)
1210 if (buf[
i] == 0 || buf[
i] > sample_depth)
1219 png_ptr->sig_bit.red = buf[0];
1220 png_ptr->sig_bit.green = buf[1];
1221 png_ptr->sig_bit.blue = buf[2];
1222 png_ptr->sig_bit.alpha = buf[3];
1227 png_ptr->sig_bit.gray = buf[0];
1228 png_ptr->sig_bit.red = buf[0];
1229 png_ptr->sig_bit.green = buf[0];
1230 png_ptr->sig_bit.blue = buf[0];
1231 png_ptr->sig_bit.alpha = buf[1];
1238#ifdef PNG_READ_cHRM_SUPPORTED
1310#ifdef PNG_READ_sRGB_SUPPORTED
1360#ifdef PNG_READ_iCCP_SUPPORTED
1409 uInt read_length, keyword_length;
1416 if (read_length >
length)
1433 while (keyword_length < 80 && keyword_length < read_length &&
1434 keyword[keyword_length] != 0)
1438 if (keyword_length >= 1 && keyword_length <= 79)
1443 if (keyword_length+1 < read_length &&
1446 read_length -= keyword_length+2;
1450 Byte profile_header[132]={0};
1452 png_alloc_size_t
size = (
sizeof profile_header);
1454 png_ptr->zstream.next_in = (
Bytef*)keyword + (keyword_length+2);
1455 png_ptr->zstream.avail_in = read_length;
1457 (
sizeof local_buffer), &
length, profile_header, &
size,
1467 keyword, profile_length) != 0)
1473 keyword, profile_length, profile_header,
1486 if (profile !=
NULL)
1488 memcpy(profile, profile_header,
1489 (
sizeof profile_header));
1491 size = 12 * tag_count;
1494 (
sizeof local_buffer), &
length,
1495 profile + (
sizeof profile_header), &
size, 0);
1503 &
png_ptr->colorspace, keyword, profile_length,
1509 size = profile_length - (
sizeof profile_header)
1513 (
sizeof local_buffer), &
length,
1514 profile + (
sizeof profile_header) +
1515 12 * tag_count, &
size, 1);
1519 errmsg =
"extra compressed data";
1530 "extra compressed data");
1536# if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0
1539 &
png_ptr->colorspace, profile,
1568 errmsg =
"out of memory";
1587 errmsg =
png_ptr->zstream.msg;
1592 errmsg =
png_ptr->zstream.msg;
1596 errmsg =
"out of memory";
1606 errmsg =
png_ptr->zstream.msg;
1613 errmsg =
png_ptr->zstream.msg;
1617 errmsg =
"bad compression method";
1621 errmsg =
"bad keyword";
1625 errmsg =
"too many profiles";
1638#ifdef PNG_READ_sPLT_SUPPORTED
1654#ifdef PNG_USER_LIMITS_SUPPORTED
1655 if (
png_ptr->user_chunk_cache_max != 0)
1657 if (
png_ptr->user_chunk_cache_max == 1)
1663 if (--
png_ptr->user_chunk_cache_max == 1)
1682#ifdef PNG_MAX_MALLOC_64K
1711 for (entry_start = buffer; *entry_start; entry_start++)
1723 new_palette.
depth = *entry_start++;
1724 entry_size = (new_palette.
depth == 8 ? 6 : 10);
1731 if ((data_length % (
unsigned int)entry_size) != 0)
1737 dl = (
png_uint_32)(data_length / (
unsigned int)entry_size);
1757#ifdef PNG_POINTER_INDEXING_SUPPORTED
1762 if (new_palette.
depth == 8)
1764 pp->red = *entry_start++;
1765 pp->green = *entry_start++;
1766 pp->blue = *entry_start++;
1767 pp->alpha = *entry_start++;
1786 if (new_palette.
depth == 8)
1788 pp[
i].red = *entry_start++;
1789 pp[
i].green = *entry_start++;
1790 pp[
i].blue = *entry_start++;
1791 pp[
i].alpha = *entry_start++;
1815#ifdef PNG_READ_tRNS_SUPPORTED
1919#ifdef PNG_READ_bKGD_SUPPORTED
1923 unsigned int truelen;
1976 background.
index = buf[0];
1980 if (buf[0] >=
info_ptr->num_palette)
1992 background.
red = background.
green = background.
blue = 0;
1994 background.
gray = 0;
2001 if (buf[0] != 0 || buf[1] >= (
unsigned int)(1 <<
png_ptr->bit_depth))
2008 background.
index = 0;
2019 if (buf[0] != 0 || buf[2] != 0 || buf[4] != 0)
2026 background.
index = 0;
2030 background.
gray = 0;
2037#ifdef PNG_READ_eXIf_SUPPORTED
2079 if (
i == 1 && buf[0] !=
'M' && buf[0] !=
'I'
2080 &&
info_ptr->eXIf_buf[0] != buf[0])
2100#ifdef PNG_READ_hIST_SUPPORTED
2104 unsigned int num,
i;
2129 if (num != (
unsigned int)
png_ptr->num_palette ||
2137 for (
i = 0;
i < num;
i++)
2152#ifdef PNG_READ_pHYs_SUPPORTED
2198#ifdef PNG_READ_oFFs_SUPPORTED
2244#ifdef PNG_READ_pCAL_SUPPORTED
2250 png_byte
type, nparams;
2274 png_debug1(2,
"Allocating and reading pCAL chunk data (%u bytes)",
2293 png_debug(3,
"Finding end of pCAL purpose string");
2294 for (buf = buffer; *buf; buf++)
2297 endptr = buffer +
length;
2302 if (endptr - buf <= 12)
2308 png_debug(3,
"Reading pCAL X0, X1, type, nparams, and units");
2315 png_debug(3,
"Checking pCAL equation type and number of parameters");
2333 for (buf =
units; *buf; buf++)
2336 png_debug(3,
"Allocating pCAL parameters array");
2348 for (
i = 0;
i < nparams;
i++)
2354 for (params[
i] = (
png_charp)buf; buf <= endptr && *buf != 0; buf++)
2373#ifdef PNG_READ_sCAL_SUPPORTED
2409 png_debug1(2,
"Allocating and reading sCAL chunk data (%u bytes)",
2428 if (buffer[0] != 1 && buffer[0] != 2)
2467#ifdef PNG_READ_tIME_SUPPORTED
2501 mod_time.
second = buf[6];
2502 mod_time.
minute = buf[5];
2503 mod_time.
hour = buf[4];
2504 mod_time.
day = buf[3];
2505 mod_time.
month = buf[2];
2512#ifdef PNG_READ_tEXt_SUPPORTED
2525#ifdef PNG_USER_LIMITS_SUPPORTED
2526 if (
png_ptr->user_chunk_cache_max != 0)
2528 if (
png_ptr->user_chunk_cache_max == 1)
2534 if (--
png_ptr->user_chunk_cache_max == 1)
2549#ifdef PNG_MAX_MALLOC_64K
2593#ifdef PNG_READ_zTXt_SUPPORTED
2604#ifdef PNG_USER_LIMITS_SUPPORTED
2605 if (
png_ptr->user_chunk_cache_max != 0)
2607 if (
png_ptr->user_chunk_cache_max == 1)
2613 if (--
png_ptr->user_chunk_cache_max == 1)
2646 for (keyword_length = 0;
2647 keyword_length <
length && buffer[keyword_length] != 0;
2651 if (keyword_length > 79 || keyword_length < 1)
2652 errmsg =
"bad keyword";
2658 else if (keyword_length + 3 >
length)
2659 errmsg =
"truncated";
2662 errmsg =
"unknown compression type";
2678 errmsg=
"Read failure in png_handle_zTXt";
2685 buffer =
png_ptr->read_buffer;
2686 buffer[uncompressed_length+(keyword_length+2)] = 0;
2691 text.text_length = uncompressed_length;
2692 text.itxt_length = 0;
2697 errmsg =
"insufficient memory";
2702 errmsg =
png_ptr->zstream.msg;
2710#ifdef PNG_READ_iTXt_SUPPORTED
2721#ifdef PNG_USER_LIMITS_SUPPORTED
2722 if (
png_ptr->user_chunk_cache_max != 0)
2724 if (
png_ptr->user_chunk_cache_max == 1)
2730 if (--
png_ptr->user_chunk_cache_max == 1)
2760 for (prefix_length=0;
2761 prefix_length <
length && buffer[prefix_length] != 0;
2766 if (prefix_length > 79 || prefix_length < 1)
2767 errmsg =
"bad keyword";
2773 else if (prefix_length + 5 >
length)
2774 errmsg =
"truncated";
2776 else if (buffer[prefix_length+1] == 0 ||
2777 (buffer[prefix_length+1] == 1 &&
2780 int compressed = buffer[prefix_length+1] != 0;
2781 png_uint_32 language_offset, translated_keyword_offset;
2782 png_alloc_size_t uncompressed_length = 0;
2786 language_offset = prefix_length;
2788 for (; prefix_length <
length && buffer[prefix_length] != 0;
2793 translated_keyword_offset = ++prefix_length;
2795 for (; prefix_length <
length && buffer[prefix_length] != 0;
2806 if (compressed == 0 && prefix_length <=
length)
2807 uncompressed_length =
length - prefix_length;
2809 else if (compressed != 0 && prefix_length <
length)
2819 buffer =
png_ptr->read_buffer;
2822 errmsg =
png_ptr->zstream.msg;
2826 errmsg =
"truncated";
2832 buffer[uncompressed_length+prefix_length] = 0;
2834 if (compressed == 0)
2842 text.lang_key = (
png_charp)buffer + translated_keyword_offset;
2844 text.text_length = 0;
2845 text.itxt_length = uncompressed_length;
2848 errmsg =
"insufficient memory";
2853 errmsg =
"bad compression info";
2860#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
2873# ifdef PNG_SET_USER_LIMITS_SUPPORTED
2874 if (
png_ptr->user_chunk_malloc_max > 0 &&
2878# elif PNG_USER_CHUNK_MALLOC_MAX > 0
2879 if (PNG_USER_CHUNK_MALLOC_MAX <
limit)
2880 limit = PNG_USER_CHUNK_MALLOC_MAX;
2929#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
2941# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
2942# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
2951# ifdef PNG_READ_USER_CHUNKS_SUPPORTED
2990# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
2995 "forcing save of an unhandled chunk;"
2996 " please call png_set_keep_unknown_chunks");
3020# ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
3028 keep =
png_ptr->unknown_default;
3042# ifndef PNG_READ_USER_CHUNKS_SUPPORTED
3043# error no method to support READ_UNKNOWN_CHUNKS
3060# ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
3068# ifdef PNG_USER_LIMITS_SUPPORTED
3069 switch (
png_ptr->user_chunk_cache_max)
3072 png_ptr->user_chunk_cache_max = 1;
3082 --(
png_ptr->user_chunk_cache_max);
3092# ifdef PNG_USER_LIMITS_SUPPORTED
3139 png_debug(1,
"in png_check_chunk_name");
3141 for (
i=1;
i<=4; ++
i)
3157# ifdef PNG_SET_USER_LIMITS_SUPPORTED
3158 if (
png_ptr->user_chunk_malloc_max > 0 &&
3161# elif PNG_USER_CHUNK_MALLOC_MAX > 0
3162 if (PNG_USER_CHUNK_MALLOC_MAX <
limit)
3163 limit = PNG_USER_CHUNK_MALLOC_MAX;
3171 * (
png_ptr->bit_depth > 8? 2: 1)
3173 + (
png_ptr->interlaced? 6: 0);
3177 idat_limit =
png_ptr->height * row_factor;
3178 row_factor = row_factor > 32566? 32566 : row_factor;
3179 idat_limit += 6 + 5*(idat_limit/row_factor+1);
3202 unsigned int pixel_depth =
png_ptr->transformed_pixel_depth;
3204 png_alloc_size_t row_width =
png_ptr->width;
3205 unsigned int pass =
png_ptr->pass;
3207 png_byte end_byte = 0;
3208 unsigned int end_mask;
3215 if (pixel_depth == 0)
3234 end_mask = (pixel_depth * row_width) & 7;
3239 end_byte = *end_ptr;
3240# ifdef PNG_READ_PACKSWAP_SUPPORTED
3243 end_mask = (
unsigned int)(0xff << end_mask);
3247 end_mask = 0xff >> end_mask;
3257#ifdef PNG_READ_INTERLACING_SUPPORTED
3258 if (
png_ptr->interlaced != 0 &&
3260 pass < 6 && (display == 0 ||
3262 (display == 1 && (pass & 1) != 0)))
3270 if (pixel_depth < 8)
3309# if PNG_USE_COMPILE_TIME_MASKS
3310# define PNG_LSR(x,s) ((x)>>((s) & 0x1f))
3311# define PNG_LSL(x,s) ((x)<<((s) & 0x1f))
3313# define PNG_LSR(x,s) ((x)>>(s))
3314# define PNG_LSL(x,s) ((x)<<(s))
3316# define S_COPY(p,x) (((p)<4 ? PNG_LSR(0x80088822,(3-(p))*8+(7-(x))) :\
3317 PNG_LSR(0xaa55ff00,(7-(p))*8+(7-(x)))) & 1)
3318# define B_COPY(p,x) (((p)<4 ? PNG_LSR(0xff0fff33,(3-(p))*8+(7-(x))) :\
3319 PNG_LSR(0xff55ff00,(7-(p))*8+(7-(x)))) & 1)
3327# define PIXEL_MASK(p,x,d,s) \
3328 (PNG_LSL(((PNG_LSL(1U,(d)))-1),(((x)*(d))^((s)?8-(d):0))))
3332# define S_MASKx(p,x,d,s) (S_COPY(p,x)?PIXEL_MASK(p,x,d,s):0)
3333# define B_MASKx(p,x,d,s) (B_COPY(p,x)?PIXEL_MASK(p,x,d,s):0)
3339# define MASK_EXPAND(m,d) ((m)*((d)==1?0x01010101:((d)==2?0x00010001:1)))
3341# define S_MASK(p,d,s) MASK_EXPAND(S_MASKx(p,0,d,s) + S_MASKx(p,1,d,s) +\
3342 S_MASKx(p,2,d,s) + S_MASKx(p,3,d,s) + S_MASKx(p,4,d,s) +\
3343 S_MASKx(p,5,d,s) + S_MASKx(p,6,d,s) + S_MASKx(p,7,d,s), d)
3345# define B_MASK(p,d,s) MASK_EXPAND(B_MASKx(p,0,d,s) + B_MASKx(p,1,d,s) +\
3346 B_MASKx(p,2,d,s) + B_MASKx(p,3,d,s) + B_MASKx(p,4,d,s) +\
3347 B_MASKx(p,5,d,s) + B_MASKx(p,6,d,s) + B_MASKx(p,7,d,s), d)
3349#if PNG_USE_COMPILE_TIME_MASKS
3355# define S_MASKS(d,s) { S_MASK(0,d,s), S_MASK(1,d,s), S_MASK(2,d,s),\
3356 S_MASK(3,d,s), S_MASK(4,d,s), S_MASK(5,d,s) }
3358# define B_MASKS(d,s) { B_MASK(1,d,s), B_MASK(3,d,s), B_MASK(5,d,s) }
3360# define DEPTH_INDEX(d) ((d)==1?0:((d)==2?1:2))
3384# define MASK(pass,depth,display,png)\
3385 ((display)?display_mask[png][DEPTH_INDEX(depth)][pass>>1]:\
3386 row_mask[png][DEPTH_INDEX(depth)][pass])
3392# define MASK(pass,depth,display,png)\
3393 ((display)?B_MASK(pass,depth,png):S_MASK(pass,depth,png))
3404# ifdef PNG_READ_PACKSWAP_SUPPORTED
3406 mask =
MASK(pass, pixel_depth, display, 0);
3410 mask =
MASK(pass, pixel_depth, display, 1);
3421 mask = (
m >> 8) | (
m << 24);
3427 *
dp = (png_byte)((*
dp & ~
m) | (*
sp &
m));
3436 if (row_width <= pixels_per_byte)
3439 row_width -= pixels_per_byte;
3447 unsigned int bytes_to_copy, bytes_to_jump;
3450 if (pixel_depth & 7)
3454 row_width *= pixel_depth;
3463 row_width -= offset;
3475 bytes_to_copy = (1<<((6-pass)>>1)) * pixel_depth;
3478 if (bytes_to_copy > row_width)
3479 bytes_to_copy = (
unsigned int)row_width;
3483 bytes_to_copy = pixel_depth;
3496 switch (bytes_to_copy)
3503 if (row_width <= bytes_to_jump)
3506 dp += bytes_to_jump;
3507 sp += bytes_to_jump;
3508 row_width -= bytes_to_jump;
3519 if (row_width <= bytes_to_jump)
3522 sp += bytes_to_jump;
3523 dp += bytes_to_jump;
3524 row_width -= bytes_to_jump;
3526 while (row_width > 1);
3540 if (row_width <= bytes_to_jump)
3543 sp += bytes_to_jump;
3544 dp += bytes_to_jump;
3545 row_width -= bytes_to_jump;
3549#if PNG_ALIGN_TYPE != PNG_ALIGN_NONE
3555 if (bytes_to_copy < 16 &&
3572 size_t skip = (bytes_to_jump-bytes_to_copy) /
3577 size_t c = bytes_to_copy;
3585 if (row_width <= bytes_to_jump)
3590 row_width -= bytes_to_jump;
3592 while (bytes_to_copy <= row_width);
3602 while (--row_width > 0);
3614 size_t skip = (bytes_to_jump-bytes_to_copy) /
3619 size_t c = bytes_to_copy;
3627 if (row_width <= bytes_to_jump)
3632 row_width -= bytes_to_jump;
3634 while (bytes_to_copy <= row_width);
3641 while (--row_width > 0);
3652 if (row_width <= bytes_to_jump)
3655 sp += bytes_to_jump;
3656 dp += bytes_to_jump;
3657 row_width -= bytes_to_jump;
3658 if (bytes_to_copy > row_width)
3659 bytes_to_copy = (
unsigned int)row_width;
3678 if (end_ptr !=
NULL)
3679 *end_ptr = (png_byte)((end_byte & end_mask) | (*end_ptr & ~end_mask));
3682#ifdef PNG_READ_INTERLACING_SUPPORTED
3689 static const unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
3691 png_debug(1,
"in png_do_read_interlace");
3692 if (row !=
NULL && row_info !=
NULL)
3696 final_width = row_info->
width * png_pass_inc[pass];
3703 png_bytep dp = row + (size_t)((final_width - 1) >> 3);
3704 unsigned int sshift, dshift;
3705 unsigned int s_start, s_end;
3707 int jstop = (
int)png_pass_inc[pass];
3712#ifdef PNG_READ_PACKSWAP_SUPPORTED
3715 sshift = ((row_info->
width + 7) & 0x07);
3716 dshift = ((final_width + 7) & 0x07);
3725 sshift = 7 - ((row_info->
width + 7) & 0x07);
3726 dshift = 7 - ((final_width + 7) & 0x07);
3732 for (
i = 0;
i < row_info->
width;
i++)
3734 v = (png_byte)((*
sp >> sshift) & 0x01);
3735 for (
j = 0;
j < jstop;
j++)
3737 unsigned int tmp = *
dp & (0x7f7f >> (7 - dshift));
3738 tmp |= (
unsigned int)(
v << dshift);
3739 *
dp = (png_byte)(tmp & 0xff);
3741 if (dshift == s_end)
3748 dshift = (
unsigned int)((
int)dshift + s_inc);
3751 if (sshift == s_end)
3758 sshift = (
unsigned int)((
int)sshift + s_inc);
3767 unsigned int sshift, dshift;
3768 unsigned int s_start, s_end;
3770 int jstop = (
int)png_pass_inc[pass];
3773#ifdef PNG_READ_PACKSWAP_SUPPORTED
3776 sshift = (((row_info->
width + 3) & 0x03) << 1);
3777 dshift = (((final_width + 3) & 0x03) << 1);
3786 sshift = ((3 - ((row_info->
width + 3) & 0x03)) << 1);
3787 dshift = ((3 - ((final_width + 3) & 0x03)) << 1);
3793 for (
i = 0;
i < row_info->
width;
i++)
3798 v = (png_byte)((*
sp >> sshift) & 0x03);
3799 for (
j = 0;
j < jstop;
j++)
3801 unsigned int tmp = *
dp & (0x3f3f >> (6 - dshift));
3802 tmp |= (
unsigned int)(
v << dshift);
3803 *
dp = (png_byte)(tmp & 0xff);
3805 if (dshift == s_end)
3812 dshift = (
unsigned int)((
int)dshift + s_inc);
3815 if (sshift == s_end)
3822 sshift = (
unsigned int)((
int)sshift + s_inc);
3830 png_bytep dp = row + (size_t)((final_width - 1) >> 1);
3831 unsigned int sshift, dshift;
3832 unsigned int s_start, s_end;
3835 int jstop = (
int)png_pass_inc[pass];
3837#ifdef PNG_READ_PACKSWAP_SUPPORTED
3840 sshift = (((row_info->
width + 1) & 0x01) << 2);
3841 dshift = (((final_width + 1) & 0x01) << 2);
3850 sshift = ((1 - ((row_info->
width + 1) & 0x01)) << 2);
3851 dshift = ((1 - ((final_width + 1) & 0x01)) << 2);
3857 for (
i = 0;
i < row_info->
width;
i++)
3859 png_byte
v = (png_byte)((*
sp >> sshift) & 0x0f);
3862 for (
j = 0;
j < jstop;
j++)
3864 unsigned int tmp = *
dp & (0xf0f >> (4 - dshift));
3865 tmp |= (
unsigned int)(
v << dshift);
3866 *
dp = (png_byte)(tmp & 0xff);
3868 if (dshift == s_end)
3875 dshift = (
unsigned int)((
int)dshift + s_inc);
3878 if (sshift == s_end)
3885 sshift = (
unsigned int)((
int)sshift + s_inc);
3892 size_t pixel_bytes = (row_info->
pixel_depth >> 3);
3897 png_bytep dp = row + (size_t)(final_width - 1) * pixel_bytes;
3899 int jstop = (
int)png_pass_inc[pass];
3902 for (
i = 0;
i < row_info->
width;
i++)
3909 for (
j = 0;
j < jstop;
j++)
3921 row_info->
width = final_width;
3924#ifndef PNG_READ_PACKSWAP_SUPPORTED
3936 unsigned int bpp = (row_info->
pixel_depth + 7) >> 3;
3941 for (
i = bpp;
i < istop;
i++)
3943 *rp = (png_byte)(((
int)(*rp) + (
int)(*(rp-bpp))) & 0xff);
3957 for (
i = 0;
i < istop;
i++)
3959 *rp = (png_byte)(((
int)(*rp) + (
int)(*
pp++)) & 0xff);
3971 unsigned int bpp = (row_info->
pixel_depth + 7) >> 3;
3972 size_t istop = row_info->
rowbytes - bpp;
3974 for (
i = 0;
i < bpp;
i++)
3976 *rp = (png_byte)(((
int)(*rp) +
3977 ((
int)(*
pp++) / 2 )) & 0xff);
3982 for (
i = 0;
i < istop;
i++)
3984 *rp = (png_byte)(((
int)(*rp) +
3985 (
int)(*
pp++ + *(rp-bpp)) / 2 ) & 0xff);
4001 *row++ = (png_byte)
a;
4004 while (row < rp_end)
4019 pa =
p < 0 ? -
p :
p;
4038 *row++ = (png_byte)
a;
4046 unsigned int bpp = (row_info->
pixel_depth + 7) >> 3;
4052 while (row < rp_end)
4054 int a = *row + *prev_row++;
4055 *row++ = (png_byte)
a;
4059 rp_end = rp_end + (row_info->
rowbytes - bpp);
4061 while (row < rp_end)
4065 c = *(prev_row - bpp);
4077 pa =
p < 0 ? -
p :
p;
4089 *row++ = (png_byte)
a;
4105 unsigned int bpp = (
pp->pixel_depth + 7) >> 3;
4117#ifdef PNG_FILTER_OPTIMIZATIONS
4126 PNG_FILTER_OPTIMIZATIONS(
pp, bpp);
4140 if (
pp->read_filter[0] ==
NULL)
4143 pp->read_filter[filter-1](row_info, row, prev_row);
4147#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
4150 png_alloc_size_t avail_out)
4153 png_ptr->zstream.next_out = output;
4154 png_ptr->zstream.avail_out = 0;
4164 if (
png_ptr->zstream.avail_in == 0)
4169 while (
png_ptr->idat_size == 0)
4181 avail_in =
png_ptr->IDAT_read_size;
4183 if (avail_in >
png_ptr->idat_size)
4194 png_ptr->idat_size -= avail_in;
4196 png_ptr->zstream.next_in = buffer;
4197 png_ptr->zstream.avail_in = avail_in;
4205 if (
out > avail_out)
4214 png_ptr->zstream.next_out = tmpbuf;
4215 png_ptr->zstream.avail_out = (
sizeof tmpbuf);
4229 avail_out +=
png_ptr->zstream.avail_out;
4232 avail_out += (
sizeof tmpbuf) -
png_ptr->zstream.avail_out;
4234 png_ptr->zstream.avail_out = 0;
4262 }
while (avail_out > 0);
4311 png_ptr->zstream.avail_in = 0;
4331 static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
4334 static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
4337 static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
4340 static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
4364 png_pass_inc[
png_ptr->pass] - 1 -
4365 png_pass_start[
png_ptr->pass]) /
4371 png_pass_yinc[
png_ptr->pass] - 1 -
4372 png_pass_ystart[
png_ptr->pass]) /
4396 static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
4399 static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
4402 static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
4405 static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
4407 unsigned int max_pixel_depth;
4412#ifdef PNG_READ_TRANSFORMS_SUPPORTED
4419 png_pass_ystart[0]) / png_pass_yinc[0];
4425 png_pass_inc[
png_ptr->pass] - 1 -
4426 png_pass_start[
png_ptr->pass]) /
4436 max_pixel_depth = (
unsigned int)
png_ptr->pixel_depth;
4448#ifdef PNG_READ_PACK_SUPPORTED
4450 max_pixel_depth = 8;
4453#ifdef PNG_READ_EXPAND_SUPPORTED
4459 max_pixel_depth = 32;
4462 max_pixel_depth = 24;
4467 if (max_pixel_depth < 8)
4468 max_pixel_depth = 8;
4471 max_pixel_depth *= 2;
4478 max_pixel_depth *= 4;
4479 max_pixel_depth /= 3;
4485#ifdef PNG_READ_EXPAND_16_SUPPORTED
4488# ifdef PNG_READ_EXPAND_SUPPORTED
4495 max_pixel_depth *= 2;
4503#ifdef PNG_READ_FILLER_SUPPORTED
4508 if (max_pixel_depth <= 8)
4509 max_pixel_depth = 16;
4512 max_pixel_depth = 32;
4518 if (max_pixel_depth <= 32)
4519 max_pixel_depth = 32;
4522 max_pixel_depth = 64;
4527#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
4540 if (max_pixel_depth <= 16)
4541 max_pixel_depth = 32;
4544 max_pixel_depth = 64;
4549 if (max_pixel_depth <= 8)
4552 max_pixel_depth = 32;
4555 max_pixel_depth = 24;
4559 max_pixel_depth = 64;
4562 max_pixel_depth = 48;
4567#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) && \
4568defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
4571 unsigned int user_pixel_depth =
png_ptr->user_transform_depth *
4572 png_ptr->user_transform_channels;
4574 if (user_pixel_depth > max_pixel_depth)
4575 max_pixel_depth = user_pixel_depth;
4582 png_ptr->maximum_pixel_depth = (png_byte)max_pixel_depth;
4583 png_ptr->transformed_pixel_depth = 0;
4593 1 + ((max_pixel_depth + 7) >> 3U);
4595#ifdef PNG_MAX_MALLOC_64K
4600 if (row_bytes + 48 >
png_ptr->old_big_row_buf_size)
4614#ifdef PNG_ALIGNED_MEMORY_SUPPORTED
4625 png_ptr->row_buf = temp - extra - 1;
4627 temp =
png_ptr->big_prev_row + 32;
4629 png_ptr->prev_row = temp - extra - 1;
4637 png_ptr->old_big_row_buf_size = row_bytes + 48;
4640#ifdef PNG_MAX_MALLOC_64K
4641 if (
png_ptr->rowbytes > 65535)
4666 png_ptr->read_buffer_size = 0;
uint8_t a
Definition Spc_Cpu.h:141
int dp
Definition Spc_Cpu.h:149
uint8_t sp
Definition Spc_Cpu.h:145
uint16_t pc
Definition Spc_Cpu.h:144
T limit(T val, T min, T max)
Definition Util.h:78
float abs(const fft_t *freqs, off_t x)
Definition OscilGen.cpp:52
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
static const unsigned long mask[]
Definition bitwise.c:31
unsigned * m
Definition inflate.c:1559
register unsigned j
Definition inflate.c:1576
unsigned v[N_MAX]
Definition inflate.c:1584
register unsigned i
Definition inflate.c:1575
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
int val
Definition jpeglib.h:956
#define png_get_uint_16(buf)
#define PNG_UNEXPECTED_ZLIB_RETURN
#define PNG_UNUSED(param)
#define PNG_HANDLE_CHUNK_IF_SAFE
#define PNG_HAVE_PNG_SIGNATURE
#define png_error(s1, s2)
#define PNG_ROWBYTES(pixel_bits, width)
#define PNG_FLAG_CRC_CRITICAL_USE
#define PNG_COLOR_TYPE_RGB
#define png_get_int_32(buf)
#define PNG_COLORSPACE_INVALID
Definition juce_PNGLoader.cpp:141
#define PNG_MAX_PALETTE_LENGTH
#define PNG_ITXT_COMPRESSION_NONE
#define PNG_FLAG_CRC_ANCILLARY_USE
#define PNG_FLAG_BENIGN_ERRORS_WARN
#define PNG_COLORSPACE_FROM_cHRM
Definition juce_PNGLoader.cpp:137
#define PNG_FLAG_CRC_ANCILLARY_NOWARN
#define PNG_FP_IS_POSITIVE(state)
#define PNG_INFLATE(pp, flush)
#define PNG_INFLATE_BUF_SIZE
Definition juce_PNGLoader.cpp:249
#define PNG_EQUATION_ARBITRARY
#define PNG_TEXT_COMPRESSION_zTXt
#define PNG_USER_TRANSFORM
#define png_debug1(a, b, c)
Definition juce_PNGLoader.cpp:278
#define png_debug2(a, b, c, d)
Definition juce_PNGLoader.cpp:279
#define PNG_COLOR_TYPE_RGB_ALPHA
#define PNG_READ_EXPAND_SUPPORTED
Definition juce_PNGLoader.cpp:112
#define png_aligncastconst(type, value)
#define PNG_COLORSPACE_HAVE_INTENT
Definition juce_PNGLoader.cpp:135
#define png_aligncast(type, value)
#define PNG_COLOR_TYPE_GRAY_ALPHA
#define PNG_EQUATION_BASE_E
#define PNG_PASS_START_COL(pass)
#define PNG_TEXT_COMPRESSION_NONE
#define png_debug(a, b)
Definition juce_PNGLoader.cpp:277
#define PNG_FLAG_CRC_ANCILLARY_MASK
#define PNG_EQUATION_LAST
#define PNG_CSTRING_FROM_CHUNK(s, c)
#define PNG_FILTER_VALUE_AVG
#define PNG_COLOR_MASK_COLOR
#define PNG_FLAG_CRC_CRITICAL_IGNORE
#define PNG_CHUNK_FROM_STRING(s)
#define PNGZ_INPUT_CAST(b)
#define PNG_READ_FILLER_SUPPORTED
Definition juce_PNGLoader.cpp:113
#define PNG_FILTER_VALUE_LAST
#define PNG_FILTER_VALUE_UP
#define PNG_FLAG_ZSTREAM_ENDED
#define PNG_IO_CHUNK_DATA
#define PNG_FLAG_ZSTREAM_INITIALIZED
#define png_get_uint_32(buf)
#define png_isaligned(ptr, type)
#define PNG_HANDLE_CHUNK_NEVER
#define PNG_FLAG_ROW_INIT
#define PNG_HANDLE_CHUNK_ALWAYS
#define PNG_CHUNK_CRITICAL(c)
#define PNG_CHUNK_ANCILLARY(c)
#define PNG_COLOR_TYPE_GRAY
#define png_voidcast(type, value)
#define PNG_COLOR_TYPE_PALETTE
#define PNG_EQUATION_HYPERBOLIC
#define PNG_FILTER_VALUE_PAETH
#define PNG_FILTER_VALUE_NONE
#define PNG_PASS_COL_OFFSET(pass)
#define PNG_EQUATION_LINEAR
#define PNG_STRING_FROM_CHUNK(s, c)
#define PNG_COMPRESSION_TYPE_BASE
#define PNG_FILTER_VALUE_SUB
#define png_chunk_error(s1, s2)
#define PNG_HANDLE_CHUNK_AS_DEFAULT
#define PNG_ITXT_COMPRESSION_zTXt
float out
Definition lilv_test.c:1461
const char * msg
Definition missing_descriptor.c:20
int png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length)
Definition png.c:1981
png_uint_32 length
Definition png.c:2247
void png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
Definition png.c:1215
int png_colorspace_set_chromaticities(png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy, int preferred)
Definition png.c:1720
void png_icc_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_bytep profile, uLong adler)
Definition png.c:2428
void png_reset_crc(png_structrp png_ptr)
Definition png.c:127
int PNGAPI png_sig_cmp(png_const_bytep sig, size_t start, size_t num_to_check)
Definition png.c:74
int png_check_fp_number(png_const_charp string, size_t size, int *statep, png_size_tp whereami)
Definition png.c:2712
int png_chunk_unknown_handling(png_const_structrp png_ptr, png_uint_32 chunk_name)
Definition png.c:961
void png_zstream_error(png_structrp png_ptr, int ret)
Definition png.c:998
void png_colorspace_set_gamma(png_const_structrp png_ptr, png_colorspacerp colorspace, png_fixed_point gAMA)
Definition png.c:1114
int png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, int color_type)
Definition png.c:2014
int png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile)
Definition png.c:2197
int png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, int intent)
Definition png.c:1872
png_uint_32 crc
Definition png.c:2247
void png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, size_t length)
Definition png.c:139
png_uint_16 intent
Definition png.c:2251
void PNGAPI png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, int num)
Definition png.c:471
png_color * png_colorp
Definition png.h:483
png_fixed_point
Definition png.h:1902
png_structrp png_ptr
Definition png.h:1082
png_row_info * png_row_infop
Definition png.h:763
struct png_sPLT_struct png_sPLT_t
png_sPLT_entry * png_sPLT_entryp
Definition png.h:523
struct png_text_struct png_text
struct png_time_struct png_time
struct png_sPLT_entry_struct png_sPLT_entry
struct png_color_struct png_color
const png_struct *PNG_RESTRICT png_const_structrp
Definition png.h:469
png_info *PNG_RESTRICT png_inforp
Definition png.h:470
png_uint_32
Definition png.h:1938
struct png_color_16_struct png_color_16
png_struct *PNG_RESTRICT png_structrp
Definition png.h:468
png_const_structrp png_const_inforp info_ptr
Definition png.h:1939
char * png_charp
Definition pngconf.h:589
const png_byte * png_const_bytep
Definition pngconf.h:580
const png_uint_16 * png_const_uint_16p
Definition pngconf.h:586
char ** png_charpp
Definition pngconf.h:612
png_byte * png_bytep
Definition pngconf.h:579
png_uint_16 * png_uint_16p
Definition pngconf.h:585
png_uint_32 * png_uint_32p
Definition pngconf.h:581
const png_uint_32 * png_const_uint_32p
Definition pngconf.h:582
const char * png_const_charp
Definition pngconf.h:590
void png_app_warning(png_const_structrp png_ptr, png_const_charp error_message)
Definition pngerror.c:392
void PNGAPI png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)
Definition pngerror.c:497
size_t png_safecat(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string)
Definition pngerror.c:112
void PNGAPI png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
Definition pngerror.c:514
void PNGAPI png_warning(png_const_structrp png_ptr, png_const_charp warning_message)
Definition pngerror.c:216
void png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
Definition pngerror.c:405
void PNGAPI png_free(png_const_structrp png_ptr, png_voidp ptr)
Definition pngmem.c:232
void png_read_data(png_structrp png_ptr, png_bytep data, size_t length)
Definition pngrio.c:32
void png_init_read_transformations(png_structrp png_ptr)
Definition pngrtran.c:1269
void png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1921
void png_handle_IHDR(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:839
void png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1362
void png_read_finish_IDAT(png_structrp png_ptr)
Definition pngrutil.c:4278
static png_fixed_point png_get_fixed_point(png_structrp png_ptr, png_const_bytep buf)
Definition pngrutil.c:41
png_int_32(PNGAPI png_get_int_32)(png_const_bytep buf)
Definition pngrutil.c:84
void png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2376
void png_handle_gAMA(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1120
void png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1640
void png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep)
Definition pngrutil.c:2922
void png_handle_sRGB(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1312
void png_handle_pHYs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2154
void png_handle_tEXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2515
void png_handle_tIME(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2469
void png_handle_cHRM(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1240
void png_handle_IEND(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1100
static int png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
Definition pngrutil.c:342
void png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2596
void png_check_chunk_length(png_const_structrp png_ptr, png_uint_32 length)
Definition pngrutil.c:3153
void png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2713
void png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2247
int png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
Definition pngrutil.c:211
static void png_read_filter_row_avg(png_row_infop row_info, png_bytep row, png_const_bytep prev_row)
Definition pngrutil.c:3965
png_uint_16(PNGAPI png_get_uint_16)(png_const_bytep buf)
Definition pngrutil.c:102
void png_crc_read(png_structrp png_ptr, png_bytep buf, png_uint_32 length)
Definition pngrutil.c:196
void png_handle_oFFs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2200
static void png_read_filter_row_sub(png_row_infop row_info, png_bytep row, png_const_bytep prev_row)
Definition pngrutil.c:3931
static int png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish, png_const_bytep input, png_uint_32p input_size_ptr, png_bytep output, png_alloc_size_t *output_size_ptr)
Definition pngrutil.c:485
int png_crc_error(png_structrp png_ptr)
Definition pngrutil.c:251
void png_read_finish_row(png_structrp png_ptr)
Definition pngrutil.c:4326
static void png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row, png_const_bytep prev_row)
Definition pngrutil.c:4043
static void png_read_filter_row_up(png_row_infop row_info, png_bytep row, png_const_bytep prev_row)
Definition pngrutil.c:3949
static int png_decompress_chunk(png_structrp png_ptr, png_uint_32 chunklength, png_uint_32 prefix_size, png_alloc_size_t *newlength, int terminate)
Definition pngrutil.c:610
static int png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size, png_uint_32p chunk_bytes, png_bytep next_out, png_alloc_size_t *out_size, int finish)
Definition pngrutil.c:774
static int png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length)
Definition pngrutil.c:2863
#define MASK(pass, depth, display, png)
void png_handle_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1817
void png_read_sig(png_structrp png_ptr, png_inforp info_ptr)
Definition pngrutil.c:121
void png_check_chunk_name(png_const_structrp png_ptr, png_uint_32 chunk_name)
Definition pngrutil.c:3134
static void png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row, png_const_bytep prev_row)
Definition pngrutil.c:3992
png_uint_32 PNGAPI png_get_uint_31(png_const_structrp png_ptr, png_const_bytep buf)
Definition pngrutil.c:22
png_uint_32 png_read_chunk_header(png_structrp png_ptr)
Definition pngrutil.c:156
void png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:913
void png_read_start_row(png_structrp png_ptr)
Definition pngrutil.c:4391
void png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:2102
void png_read_IDAT_data(png_structrp png_ptr, png_bytep output, png_alloc_size_t avail_out)
Definition pngrutil.c:4149
static void png_init_filter_functions(png_structrp pp)
Definition pngrutil.c:4094
void png_handle_sBIT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition pngrutil.c:1158
void png_read_filter_row(png_structrp pp, png_row_infop row_info, png_bytep row, png_const_bytep prev_row, int filter)
Definition pngrutil.c:4131
void png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
Definition pngrutil.c:3200
static png_bytep png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size, int warn)
Definition pngrutil.c:298
void png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, png_uint_32 transformations)
Definition pngrutil.c:3684
void PNGAPI png_set_tIME(png_const_structrp png_ptr, png_inforp info_ptr, png_const_timep mod_time)
Definition pngset.c:968
void PNGAPI png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params)
Definition pngset.c:312
void PNGAPI png_set_bKGD(png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_16p background)
Definition pngset.c:25
void PNGAPI png_set_IHDR(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type)
Definition pngset.c:254
void PNGAPI png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette)
Definition pngset.c:572
void PNGAPI png_set_pHYs(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)
Definition pngset.c:556
void PNGAPI png_set_oFFs(png_const_structrp png_ptr, png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type)
Definition pngset.c:295
void PNGAPI png_set_sBIT(png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_8p sig_bit)
Definition pngset.c:638
void PNGAPI png_set_sPLT(png_const_structrp png_ptr, png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)
Definition pngset.c:1062
void PNGAPI png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)
Definition pngset.c:210
void PNGAPI png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color)
Definition pngset.c:994
void PNGAPI png_set_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)
Definition pngset.c:1200
int png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text)
Definition pngset.c:773
void PNGAPI png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_const_charp swidth, png_const_charp sheight)
Definition pngset.c:430
static void units(std::ostream &o, const char *u)
Definition ports.cpp:1772
png_uint_16 red
Definition png.h:490
png_byte index
Definition png.h:489
png_uint_16 gray
Definition png.h:493
png_uint_16 green
Definition png.h:491
png_uint_16 blue
Definition png.h:492
png_byte blue
Definition png.h:481
png_byte red
Definition png.h:479
png_byte green
Definition png.h:480
png_uint_32 width
Definition png.h:755
png_byte pixel_depth
Definition png.h:760
size_t rowbytes
Definition png.h:756
png_sPLT_entryp entries
Definition png.h:536
png_byte depth
Definition png.h:535
png_int_32 nentries
Definition png.h:537
png_charp name
Definition png.h:534
png_charp text
Definition png.h:569
png_charp lang_key
Definition png.h:575
size_t text_length
Definition png.h:571
png_charp lang
Definition png.h:573
png_charp key
Definition png.h:568
int compression
Definition png.h:563
size_t itxt_length
Definition png.h:572
png_byte month
Definition png.h:602
png_uint_16 year
Definition png.h:601
png_byte hour
Definition png.h:604
png_byte second
Definition png.h:606
png_byte minute
Definition png.h:605
png_byte day
Definition png.h:603
const char * text
Definition swell-functions.h:167
static rev_t read_buffer(rev_t *buffer, unsigned long buflen, unsigned long pos, unsigned long n)
Definition tap_reverb.h:90
uch * p
Definition crypt.c:594
return c
Definition crypt.c:175
memcpy(hh, h, RAND_HEAD_LEN)
ZCONST char * key
Definition crypt.c:587
unsigned readbuf(__G__ buf, size) __GDEF char *buf
int flush(__G__ rawbuf, size, unshrink) __GDEF uch *rawbuf
char * pp
Definition unix.c:513
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396
#define uInt
Definition zconf.h:64
#define inflate
Definition zconf.h:29
#define Byte
Definition zconf.h:63
#define inflateReset
Definition zconf.h:47
#define Bytef
Definition zconf.h:66
#define inflateInit2(strm, windowBits)
Definition zlib.h:1339
#define Z_STREAM_END
Definition zlib.h:172
#define Z_FINISH
Definition zlib.h:167
#define Z_OK
Definition zlib.h:171
#define Z_DATA_ERROR
Definition zlib.h:176
#define Z_SYNC_FLUSH
Definition zlib.h:165
#define Z_STREAM_ERROR
Definition zlib.h:175
#define Z_NO_FLUSH
Definition zlib.h:163
#define inflateInit(strm)
Definition zlib.h:1334
#define Z_MEM_ERROR
Definition zlib.h:177