Prusa MINI Firmware overview
|
#include "pngpriv.h"
#include <errno.h>
|
| PNG_FUNCTION (png_structp, PNGAPI png_create_read_struct,(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED) |
|
| PNG_FUNCTION (png_structp, PNGAPI png_create_read_struct_2,(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), PNG_ALLOCATED) |
|
void PNGAPI | png_read_info (png_structrp png_ptr, png_inforp info_ptr) |
|
void PNGAPI | png_read_update_info (png_structrp png_ptr, png_inforp info_ptr) |
|
void PNGAPI | png_start_read_image (png_structrp png_ptr) |
|
static void | png_do_read_intrapixel (png_row_infop row_info, png_bytep row) |
|
void PNGAPI | png_read_row (png_structrp png_ptr, png_bytep row, png_bytep dsp_row) |
|
void PNGAPI | png_read_rows (png_structrp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows) |
|
void PNGAPI | png_read_image (png_structrp png_ptr, png_bytepp image) |
|
void PNGAPI | png_read_end (png_structrp png_ptr, png_inforp info_ptr) |
|
static void | png_read_destroy (png_structrp png_ptr) |
|
void PNGAPI | png_destroy_read_struct (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr) |
|
void PNGAPI | png_set_read_status_fn (png_structrp png_ptr, png_read_status_ptr read_row_fn) |
|
void PNGAPI | png_read_png (png_structrp png_ptr, png_inforp info_ptr, int transforms, voidp params) |
|
static int | png_image_read_init (png_imagep image) |
|
static png_uint_32 | png_image_format (png_structrp png_ptr) |
|
static int | png_gamma_not_sRGB (png_fixed_point g) |
|
static int | png_image_read_header (png_voidp argument) |
|
int PNGAPI | png_image_begin_read_from_stdio (png_imagep image, FILE *file) |
|
int PNGAPI | png_image_begin_read_from_file (png_imagep image, const char *file_name) |
|
static void PNGCBAPI | png_image_memory_read (png_structp png_ptr, png_bytep out, size_t need) |
|
int PNGAPI | png_image_begin_read_from_memory (png_imagep image, png_const_voidp memory, size_t size) |
|
static void | png_image_skip_unused_chunks (png_structrp png_ptr) |
|
static void | set_file_encoding (png_image_read_control *display) |
|
static unsigned int | decode_gamma (png_image_read_control *display, png_uint_32 value, int encoding) |
|
static png_uint_32 | png_colormap_compose (png_image_read_control *display, png_uint_32 foreground, int foreground_encoding, png_uint_32 alpha, png_uint_32 background, int encoding) |
|
static void | png_create_colormap_entry (png_image_read_control *display, png_uint_32 ip, png_uint_32 red, png_uint_32 green, png_uint_32 blue, png_uint_32 alpha, int encoding) |
|
static int | make_gray_file_colormap (png_image_read_control *display) |
|
static int | make_gray_colormap (png_image_read_control *display) |
|
static int | make_ga_colormap (png_image_read_control *display) |
|
static int | make_rgb_colormap (png_image_read_control *display) |
|
static int | png_image_read_colormap (png_voidp argument) |
|
static int | png_image_read_and_map (png_voidp argument) |
|
static int | png_image_read_colormapped (png_voidp argument) |
|
static int | png_image_read_composite (png_voidp argument) |
|
static int | png_image_read_background (png_voidp argument) |
|
static int | png_image_read_direct (png_voidp argument) |
|
int PNGAPI | png_image_finish_read (png_imagep image, png_const_colorp background, void *buffer, png_int_32 row_stride, void *colormap) |
|
◆ P_NOTSET
#define P_NOTSET 0 /* File encoding not yet known */ |
◆ P_sRGB
#define P_sRGB 1 /* 8-bit encoded to sRGB gamma */ |
◆ P_LINEAR
#define P_LINEAR 2 /* 16-bit linear: not encoded, NOT pre-multiplied! */ |
◆ P_FILE
#define P_FILE 3 /* 8-bit encoded to file gamma, not sRGB or linear */ |
◆ P_LINEAR8
#define P_LINEAR8 4 /* 8-bit linear: only from a file value */ |
◆ PNG_CMAP_NONE
◆ PNG_CMAP_GA
#define PNG_CMAP_GA 1 /* Process GA data to a color-map with alpha */ |
◆ PNG_CMAP_TRANS
#define PNG_CMAP_TRANS 2 /* Process GA data to a background index */ |
◆ PNG_CMAP_RGB
#define PNG_CMAP_RGB 3 /* Process RGB data */ |
◆ PNG_CMAP_RGB_ALPHA
#define PNG_CMAP_RGB_ALPHA 4 /* Process RGBA data */ |
◆ PNG_CMAP_NONE_BACKGROUND
#define PNG_CMAP_NONE_BACKGROUND 256 |
◆ PNG_CMAP_GA_BACKGROUND
#define PNG_CMAP_GA_BACKGROUND 231 |
◆ PNG_CMAP_TRANS_BACKGROUND
#define PNG_CMAP_TRANS_BACKGROUND 254 |
◆ PNG_CMAP_RGB_BACKGROUND
#define PNG_CMAP_RGB_BACKGROUND 256 |
◆ PNG_CMAP_RGB_ALPHA_BACKGROUND
#define PNG_CMAP_RGB_ALPHA_BACKGROUND 216 |
◆ PNG_SKIP_CHUNKS
◆ PNG_DIV51
#define PNG_DIV51 |
( |
|
v8 | ) |
(((v8) * 5 + 130) >> 8) |
◆ PNG_GRAY_COLORMAP_ENTRIES
#define PNG_GRAY_COLORMAP_ENTRIES 256 |
◆ PNG_GA_COLORMAP_ENTRIES
#define PNG_GA_COLORMAP_ENTRIES 256 |
◆ PNG_RGB_COLORMAP_ENTRIES
#define PNG_RGB_COLORMAP_ENTRIES 216 |
◆ PNG_RGB_INDEX
◆ PNG_FUNCTION() [1/2]
29 #ifndef PNG_USER_MEM_SUPPORTED
33 return png_create_read_struct_2(user_png_ver, error_ptr, error_fn,
◆ PNG_FUNCTION() [2/2]
46 error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
56 # ifdef PNG_SEQUENTIAL_READ_SUPPORTED
60 # ifdef PNG_BENIGN_READ_ERRORS_SUPPORTED
66 # if PNG_RELEASE_BUILD
◆ png_read_info()
94 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
117 png_chunk_error(
png_ptr,
"Missing IHDR before IDAT");
121 png_chunk_error(
png_ptr,
"Missing PLTE before IDAT");
144 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
168 #ifdef PNG_READ_bKGD_SUPPORTED
173 #ifdef PNG_READ_cHRM_SUPPORTED
178 #ifdef PNG_READ_eXIf_SUPPORTED
183 #ifdef PNG_READ_gAMA_SUPPORTED
188 #ifdef PNG_READ_hIST_SUPPORTED
193 #ifdef PNG_READ_oFFs_SUPPORTED
198 #ifdef PNG_READ_pCAL_SUPPORTED
203 #ifdef PNG_READ_sCAL_SUPPORTED
208 #ifdef PNG_READ_pHYs_SUPPORTED
213 #ifdef PNG_READ_sBIT_SUPPORTED
218 #ifdef PNG_READ_sRGB_SUPPORTED
223 #ifdef PNG_READ_iCCP_SUPPORTED
228 #ifdef PNG_READ_sPLT_SUPPORTED
233 #ifdef PNG_READ_tEXt_SUPPORTED
238 #ifdef PNG_READ_tIME_SUPPORTED
243 #ifdef PNG_READ_tRNS_SUPPORTED
248 #ifdef PNG_READ_zTXt_SUPPORTED
253 #ifdef PNG_READ_iTXt_SUPPORTED
◆ png_read_update_info()
277 # ifdef PNG_READ_TRANSFORMS_SUPPORTED
287 "png_read_update_info/png_start_read_image: duplicate call");
◆ png_start_read_image()
310 "png_start_read_image/png_read_update_info: duplicate call");
◆ png_do_read_intrapixel()
323 png_debug(1,
"in png_do_read_intrapixel");
345 for (
i = 0, rp = row;
i < row_width;
i++, rp += bytes_per_pixel)
347 *(rp) = (png_byte)((256 + *rp + *(rp + 1)) & 0xff);
348 *(rp+2) = (png_byte)((256 + *(rp + 2) + *(rp + 1)) & 0xff);
365 for (
i = 0, rp = row;
i < row_width;
i++, rp += bytes_per_pixel)
372 *(rp ) = (png_byte)((
red >> 8) & 0xff);
373 *(rp + 1) = (png_byte)(
red & 0xff);
374 *(rp + 4) = (png_byte)((blue >> 8) & 0xff);
375 *(rp + 5) = (png_byte)(blue & 0xff);
◆ png_read_row()
390 png_debug2(1,
"in png_read_row (row %lu, pass %d)",
407 #ifdef PNG_WARNINGS_SUPPORTED
411 #if defined(PNG_WRITE_INVERT_SUPPORTED) && !defined(PNG_READ_INVERT_SUPPORTED)
416 #if defined(PNG_WRITE_FILLER_SUPPORTED) && !defined(PNG_READ_FILLER_SUPPORTED)
421 #if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && \
422 !defined(PNG_READ_PACKSWAP_SUPPORTED)
427 #if defined(PNG_WRITE_PACK_SUPPORTED) && !defined(PNG_READ_PACK_SUPPORTED)
432 #if defined(PNG_WRITE_SHIFT_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED)
437 #if defined(PNG_WRITE_BGR_SUPPORTED) && !defined(PNG_READ_BGR_SUPPORTED)
442 #if defined(PNG_WRITE_SWAP_SUPPORTED) && !defined(PNG_READ_SWAP_SUPPORTED)
449 #ifdef PNG_READ_INTERLACING_SUPPORTED
456 if (
png_ptr->interlaced != 0 &&
462 if (
png_ptr->row_number & 0x07)
483 if ((
png_ptr->row_number & 0x07) != 4)
505 if ((
png_ptr->row_number & 3) != 2)
528 if ((
png_ptr->row_number & 1) == 0)
561 #ifdef PNG_MNG_FEATURES_SUPPORTED
570 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
576 if (
png_ptr->transformed_pixel_depth == 0)
586 #ifdef PNG_READ_INTERLACING_SUPPORTED
588 if (
png_ptr->interlaced != 0 &&
◆ png_read_rows()
660 for (
i = 0;
i < num_rows;
i++)
669 for (
i = 0;
i < num_rows;
i++)
677 for (
i = 0;
i < num_rows;
i++)
◆ png_read_image()
711 #ifdef PNG_READ_INTERLACING_SUPPORTED
720 if (
png_ptr->interlaced != 0 &&
728 "using png_read_image");
741 "Cannot read interlaced image -- interlace handler disabled");
748 for (j = 0; j < pass; j++)
751 for (
i = 0;
i < image_height;
i++)
◆ png_read_end()
768 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
780 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
785 #ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
809 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
841 #ifdef PNG_READ_bKGD_SUPPORTED
846 #ifdef PNG_READ_cHRM_SUPPORTED
851 #ifdef PNG_READ_eXIf_SUPPORTED
856 #ifdef PNG_READ_gAMA_SUPPORTED
861 #ifdef PNG_READ_hIST_SUPPORTED
866 #ifdef PNG_READ_oFFs_SUPPORTED
871 #ifdef PNG_READ_pCAL_SUPPORTED
876 #ifdef PNG_READ_sCAL_SUPPORTED
881 #ifdef PNG_READ_pHYs_SUPPORTED
886 #ifdef PNG_READ_sBIT_SUPPORTED
891 #ifdef PNG_READ_sRGB_SUPPORTED
896 #ifdef PNG_READ_iCCP_SUPPORTED
901 #ifdef PNG_READ_sPLT_SUPPORTED
906 #ifdef PNG_READ_tEXt_SUPPORTED
911 #ifdef PNG_READ_tIME_SUPPORTED
916 #ifdef PNG_READ_tRNS_SUPPORTED
921 #ifdef PNG_READ_zTXt_SUPPORTED
926 #ifdef PNG_READ_iTXt_SUPPORTED
◆ png_read_destroy()
944 #ifdef PNG_READ_GAMMA_SUPPORTED
955 #ifdef PNG_READ_QUANTIZE_SUPPORTED
969 #if defined(PNG_tRNS_SUPPORTED) || \
970 defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
981 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
986 #if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) && \
987 defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
992 #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
◆ png_destroy_read_struct()
1010 png_debug(1,
"in png_destroy_read_struct");
1012 if (png_ptr_ptr !=
NULL)
1025 *png_ptr_ptr =
NULL;
◆ png_set_read_status_fn()
1036 png_ptr->read_row_fn = read_row_fn;
◆ png_read_png()
1065 if ((transforms & PNG_TRANSFORM_SCALE_16) != 0)
1069 #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
1080 #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
1090 #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
1100 #ifdef PNG_READ_PACK_SUPPORTED
1110 #ifdef PNG_READ_PACKSWAP_SUPPORTED
1122 #ifdef PNG_READ_EXPAND_SUPPORTED
1134 #ifdef PNG_READ_INVERT_SUPPORTED
1145 #ifdef PNG_READ_SHIFT_SUPPORTED
1154 #ifdef PNG_READ_BGR_SUPPORTED
1162 #ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
1170 #ifdef PNG_READ_SWAP_SUPPORTED
1179 #ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
1188 #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
1196 #ifdef PNG_READ_EXPAND_16_SUPPORTED
1225 for (iptr=0; iptr<
info_ptr->height; iptr++)
1230 for (iptr = 0; iptr <
info_ptr->height; iptr++)
◆ png_image_read_init()
static int png_image_read_init |
( |
png_imagep |
image | ) |
|
|
static |
1310 memset(image, 0, (
sizeof *image));
1320 png_malloc_warn(
png_ptr, (
sizeof *control)));
1322 if (control !=
NULL)
1324 memset(control, 0, (
sizeof *control));
1344 return png_image_error(image,
"png_image_read: opaque pointer not NULL");
◆ png_image_format()
1364 else if (
png_ptr->num_trans > 0)
◆ png_gamma_not_sRGB()
◆ png_image_read_header()
static int png_image_read_header |
( |
png_voidp |
argument | ) |
|
|
static |
1407 #ifdef PNG_BENIGN_ERRORS_SUPPORTED
1421 #ifdef PNG_COLORSPACE_SUPPORTED
1428 & (PNG_COLORSPACE_HAVE_ENDPOINTS|PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB|
1429 PNG_COLORSPACE_INVALID)) == PNG_COLORSPACE_HAVE_ENDPOINTS))
1443 cmap_entries = 1U <<
png_ptr->bit_depth;
1455 if (cmap_entries > 256)
◆ png_image_begin_read_from_stdio()
1485 "png_image_begin_read_from_stdio: invalid argument");
1488 else if (image !=
NULL)
1490 "png_image_begin_read_from_stdio: incorrect PNG_IMAGE_VERSION");
◆ png_image_begin_read_from_file()
1500 if (file_name !=
NULL)
1502 FILE *fp = fopen(file_name,
"rb");
1523 "png_image_begin_read_from_file: invalid argument");
1526 else if (image !=
NULL)
1528 "png_image_begin_read_from_file: incorrect PNG_IMAGE_VERSION");
◆ png_image_memory_read()
1548 if (memory !=
NULL &&
size >= need)
1550 memcpy(out, memory, need);
1551 cp->
memory = memory + need;
◆ png_image_begin_read_from_memory()
1588 "png_image_begin_read_from_memory: invalid argument");
1591 else if (image !=
NULL)
1593 "png_image_begin_read_from_memory: incorrect PNG_IMAGE_VERSION");
◆ png_image_skip_unused_chunks()
1624 static const png_byte chunks_to_process[] = {
1625 98, 75, 71, 68,
'\0',
1626 99, 72, 82, 77,
'\0',
1627 103, 65, 77, 65,
'\0',
1628 # ifdef PNG_READ_iCCP_SUPPORTED
1629 105, 67, 67, 80,
'\0',
1631 115, 66, 73, 84,
'\0',
1632 115, 82, 71, 66,
'\0',
1643 chunks_to_process, (
int)(
sizeof chunks_to_process)/5);
◆ set_file_encoding()
◆ decode_gamma()
1683 encoding =
display->file_encoding;
1688 encoding =
display->file_encoding;
1711 "unexpected encoding (internal error)");
◆ png_colormap_compose()
1734 f = f * alpha +
b * (255-alpha);
1743 f = (f+32768) >> 16;
◆ png_create_colormap_entry()
1764 (
red != green || green != blue);
1780 encoding =
display->file_encoding;
1791 if (convert_to_Y != 0 || output_encoding ==
P_LINEAR)
1818 else if (encoding ==
P_sRGB &&
1819 (convert_to_Y != 0 || output_encoding ==
P_LINEAR))
1834 if (convert_to_Y != 0)
1841 y = (y + 16384) >> 15;
1853 blue =
red = green = y;
1856 else if (output_encoding ==
P_sRGB)
1866 if (encoding != output_encoding)
1871 # ifdef PNG_FORMAT_AFIRST_SUPPORTED
1877 # ifdef PNG_FORMAT_BGR_SUPPORTED
1904 blue = (blue * alpha + 32767U)/65535U;
1905 green = (green * alpha + 32767U)/65535U;
1906 red = (
red * alpha + 32767U)/65535U;
1910 red = green = blue = 0;
1925 green = (green * alpha + 32767U)/65535U;
1947 entry[afirst ? 0 : 3] = (png_byte)alpha;
1950 entry[afirst + (2 ^ bgr)] = (png_byte)blue;
1951 entry[afirst + 1] = (png_byte)green;
1952 entry[afirst + bgr] = (png_byte)
red;
1956 entry[1 ^ afirst] = (png_byte)alpha;
1959 entry[afirst] = (png_byte)green;
◆ make_gray_file_colormap()
1981 for (
i=0;
i<256; ++
i)
◆ make_gray_colormap()
1992 for (
i=0;
i<256; ++
i)
◆ make_ga_colormap()
2031 unsigned int gray = (
i * 256 + 115) / 231;
◆ make_rgb_colormap()
2060 for (
i=r=0; r<6; ++r)
◆ png_image_read_colormap()
static int png_image_read_colormap |
( |
png_voidp |
argument | ) |
|
|
static |
2095 unsigned int cmap_entries;
2096 unsigned int output_processing;
2097 unsigned int data_encoding =
P_NOTSET;
2102 unsigned int background_index = 256;
2106 int expand_tRNS = 0;
2118 back_b = back_g = back_r = 0;
2122 "background color must be supplied to remove alpha/transparency");
2130 back_g =
display->background->green;
2133 back_r =
display->background->red;
2134 back_b =
display->background->blue;
2137 back_b = back_r = back_g;
2141 else if (output_encoding ==
P_LINEAR)
2142 back_b = back_r = back_g = 65535;
2145 back_b = back_r = back_g = 255;
2152 if ((
png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) == 0)
2159 if (
png_ptr->bit_depth == 16 &&
2166 png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA;
2182 unsigned int step,
i, val, trans = 256, back_alpha = 0;
2184 cmap_entries = 1U <<
png_ptr->bit_depth;
2188 step = 255 / (cmap_entries - 1);
2196 trans =
png_ptr->trans_color.gray;
2199 back_alpha = output_encoding ==
P_LINEAR ? 65535 : 255;
2209 for (
i=val=0;
i<cmap_entries; ++
i, val += step)
2229 back_alpha, output_encoding);
2271 unsigned int back_alpha;
2278 if (back_r == back_g && back_g == back_b)
2320 back_alpha = output_encoding ==
P_LINEAR ? 65535 : 255;
2333 background_index = 254;
2339 back_alpha, output_encoding);
2390 (back_r == back_g && back_g == back_b))
2444 background_index =
i;
2451 output_encoding ==
P_LINEAR ? 65535U : 255U,
2463 if (output_encoding ==
P_sRGB)
2584 if (data_encoding ==
P_FILE)
2591 if (output_encoding ==
P_sRGB)
2601 back_g, 0, output_encoding);
2604 else if (output_encoding ==
P_LINEAR)
2666 background_index = cmap_entries++;
2669 for (r=0; r<256; r = (r << 1) | 0x7f)
2673 for (g=0; g<256; g = (g << 1) | 0x7f)
2680 for (
b=0;
b<256;
b = (
b << 1) | 0x7f)
2699 unsigned int sample_size =
2709 back_g, back_b, 0, output_encoding);
2731 sample_size * cmap_entries,
2737 background_index = cmap_entries++;
2742 for (r=0; r<256; r = (r << 1) | 0x7f)
2744 for (g=0; g<256; g = (g << 1) | 0x7f)
2749 for (
b=0;
b<256;
b = (
b << 1) | 0x7f)
2752 back_r, output_encoding),
2754 back_g, output_encoding),
2756 back_b, output_encoding),
2757 0, output_encoding);
2802 unsigned int num_trans =
png_ptr->num_trans;
2805 int do_background = trans !=
NULL &&
2815 cmap_entries = (
unsigned int)
png_ptr->num_palette;
2816 if (cmap_entries > 256)
2822 for (
i=0;
i < cmap_entries; ++
i)
2824 if (do_background != 0 &&
i < num_trans && trans[
i] < 255)
2828 back_b, 0, output_encoding);
2837 P_FILE, trans[
i], back_r, output_encoding),
2839 P_FILE, trans[
i], back_g, output_encoding),
2841 P_FILE, trans[
i], back_b, output_encoding),
2842 output_encoding ==
P_LINEAR ? trans[
i] * 257U :
2850 colormap[
i].green, colormap[
i].blue,
2851 i < num_trans ? trans[
i] : 255U,
P_FILE);
2868 if (expand_tRNS != 0 &&
png_ptr->num_trans > 0 &&
2872 switch (data_encoding)
2896 switch (output_processing)
2900 goto bad_background;
2905 goto bad_background;
2909 if (background_index >= cmap_entries ||
2911 goto bad_background;
2916 goto bad_background;
2921 goto bad_background;
2931 display->colormap_processing = (
int)output_processing;
◆ png_image_read_and_map()
static int png_image_read_and_map |
( |
png_voidp |
argument | ) |
|
|
static |
2967 int proc =
display->colormap_processing;
2969 ptrdiff_t step_row =
display->row_bytes;
2972 for (pass = 0; pass < passes; ++pass)
2974 unsigned int startx, stepx, stepy;
2996 for (; y<height; y += stepy)
2999 png_bytep outrow = first_row + y * step_row;
3013 for (; outrow < end_row; outrow += stepx)
3016 unsigned int gray = *inrow++;
3017 unsigned int alpha = *inrow++;
3026 entry = (231 * gray + 128) >> 8;
3028 else if (alpha < 26)
3037 *outrow = (png_byte)entry;
3042 for (; outrow < end_row; outrow += stepx)
3044 png_byte gray = *inrow++;
3045 png_byte alpha = *inrow++;
3059 for (; outrow < end_row; outrow += stepx)
3067 for (; outrow < end_row; outrow += stepx)
3069 unsigned int alpha = inrow[3];
3080 else if (alpha < 64)
3102 if (inrow[0] & 0x80) back_i += 9;
3103 if (inrow[0] & 0x40) back_i += 9;
3104 if (inrow[0] & 0x80) back_i += 3;
3105 if (inrow[0] & 0x40) back_i += 3;
3106 if (inrow[0] & 0x80) back_i += 1;
3107 if (inrow[0] & 0x40) back_i += 1;
3109 *outrow = (png_byte)back_i;
◆ png_image_read_colormapped()
static int png_image_read_colormapped |
( |
png_voidp |
argument | ) |
|
|
static |
3150 switch (
display->colormap_processing)
3208 ptrdiff_t row_bytes =
display->row_stride;
3216 ptr += (image->
height-1) * (-row_bytes);
3220 display->first_row = first_row;
3221 display->row_bytes = row_bytes;
3241 while (--passes >= 0)
◆ png_image_read_composite()
static int png_image_read_composite |
( |
png_voidp |
argument | ) |
|
|
static |
3284 ptrdiff_t step_row =
display->row_bytes;
3285 unsigned int channels =
3289 for (pass = 0; pass < passes; ++pass)
3291 unsigned int startx, stepx, stepy;
3314 for (; y<height; y += stepy)
3324 outrow += y * step_row;
3325 end_row = outrow +
width * channels;
3329 for (; outrow < end_row; outrow += stepx)
3331 png_byte alpha = inrow[channels];
3337 for (c=0; c<channels; ++c)
3349 component *= 257*255;
3359 outrow[c] = (png_byte)component;
3363 inrow += channels+1;
◆ png_image_read_background()
static int png_image_read_background |
( |
png_voidp |
argument | ) |
|
|
static |
3445 ptrdiff_t step_row =
display->row_bytes;
3447 for (pass = 0; pass < passes; ++pass)
3450 unsigned int startx, stepx, stepy;
3474 for (; y<height; y += stepy)
3478 png_bytep outrow = first_row + y * step_row;
3486 for (; outrow < end_row; outrow += stepx)
3488 png_byte alpha = inrow[1];
3506 outrow[0] = (png_byte)component;
3516 png_byte background8 =
display->background->green;
3519 for (; y<height; y += stepy)
3523 png_bytep outrow = first_row + y * step_row;
3531 for (; outrow < end_row; outrow += stepx)
3533 png_byte alpha = inrow[1];
3542 component += background * (255-alpha);
3546 outrow[0] = (png_byte)component;
3550 outrow[0] = background8;
3573 ptrdiff_t step_row =
display->row_bytes / 2;
3574 unsigned int preserve_alpha = (image->
format &
3576 unsigned int outchannels = 1U+preserve_alpha;
3579 # ifdef PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
3580 if (preserve_alpha != 0 &&
3585 for (pass = 0; pass < passes; ++pass)
3587 unsigned int startx, stepx, stepy;
3608 stepx = outchannels;
3612 for (; y<height; y += stepy)
3626 for (; outrow < end_row; outrow += stepx)
3645 if (preserve_alpha != 0)
3646 outrow[1 ^ swap_alpha] = alpha;
◆ png_image_read_direct()
static int png_image_read_direct |
( |
png_voidp |
argument | ) |
|
|
static |
3676 int do_local_compose = 0;
3677 int do_local_background = 0;
3717 do_local_background = 1;
3775 if (do_local_background != 0)
3786 do_local_background = 0;
3790 do_local_background = 2;
3823 if (do_local_background != 0)
3824 do_local_background = 2;
3827 else if (linear != 0)
3854 do_local_compose = 1;
3880 #ifdef PNG_FORMAT_AFIRST_SUPPORTED
3904 # ifdef PNG_FORMAT_BGR_SUPPORTED
3920 # ifdef PNG_FORMAT_AFIRST_SUPPORTED
3933 if (do_local_background != 2)
3968 if (do_local_compose == 0 && do_local_background != 2)
3982 if (do_local_compose == 0)
3985 if (do_local_background != 2 ||
3991 else if (do_local_compose != 0)
4001 #ifdef PNG_FORMAT_BGR_SUPPORTED
4006 #ifdef PNG_FORMAT_AFIRST_SUPPORTED
4007 if (do_local_background == 2)
4017 if (do_local_background == 2)
4025 if (info_format != format)
4036 ptrdiff_t row_bytes =
display->row_stride;
4047 ptr += (image->
height-1) * (-row_bytes);
4051 display->first_row = first_row;
4052 display->row_bytes = row_bytes;
4055 if (do_local_compose != 0)
4068 else if (do_local_background == 2)
4085 while (--passes >= 0)
◆ png_image_finish_read()
4119 if (image->
width <= 0x7fffffffU/channels)
4124 if (row_stride == 0)
4137 if (image->
opaque !=
NULL && buffer !=
NULL && check >= png_row_stride)
4167 display.row_stride = row_stride;
4169 display.background = background;
4193 "png_image_finish_read[color-map]: no color-map");
4198 "png_image_finish_read: image too large");
4203 "png_image_finish_read: invalid argument");
4208 "png_image_finish_read: row_stride too large");
4211 else if (image !=
NULL)
4213 "png_image_finish_read: damaged PNG_IMAGE_VERSION");
#define PNG_BGR
Definition: pngpriv.h:642
png_uint_32 width
Definition: png.h:2675
void png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1640
void png_handle_IHDR(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:839
void png_read_finish_row(png_structrp png_ptr)
Definition: pngrutil.c:4326
#define P_sRGB
Definition: pngread.c:1256
png_uint_32 colormap_entries
Definition: png.h:2679
void png_read_finish_IDAT(png_structrp png_ptr)
Definition: pngrutil.c:4278
#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)
Definition: png.h:2887
#define PNG_FREE_TRNS
Definition: png.h:1759
const typedef png_byte * png_const_bytep
Definition: pngconf.h:580
#define PNG_AFTER_IDAT
Definition: png.h:646
#define PNG_FREE_ROWS
Definition: png.h:1751
#define P_LINEAR8
Definition: pngread.c:1259
#define PNG_RGB_INDEX(r, g, b)
Definition: pngread.c:2080
void PNGAPI png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)
Definition: pngread.c:1005
png_set_rgb_to_gray_fixed
Definition: png.h:1083
int png_safe_execute(png_imagep image_in, int(*function)(png_voidp), png_voidp arg)
Definition: pngerror.c:936
#define png_sCAL
Definition: pngpriv.h:867
#define PNG_FILLER_AFTER
Definition: png.h:1249
png_fixed_point png_reciprocal(png_fixed_point a)
Definition: png.c:3488
#define PNG_UNUSED(param)
Definition: pngpriv.h:438
#define PNG_sRGB_FROM_LINEAR(linear)
Definition: pngpriv.h:952
#define PNG_GRAY_COLORMAP_ENTRIES
Definition: pngread.c:1997
png_rw_ptr read_data_fn
Definition: pngstruct.h:157
static void PNGCBAPI png_image_memory_read(png_structp png_ptr, png_bytep out, size_t need)
Definition: pngread.c:1535
#define PNG_RGB_COLORMAP_ENTRIES
Definition: pngread.c:2077
#define png_eXIf
Definition: pngpriv.h:854
#define PNG_DEFAULT_sRGB
Definition: png.h:1147
#define PNG_ALPHA_STANDARD
Definition: png.h:1131
#define PNG_FORMAT_FLAG_ASSOCIATED_ALPHA
Definition: png.h:2790
#define PNG_TRANSFORM_STRIP_ALPHA
Definition: png.h:834
png_uint_16 blue
Definition: png.h:493
void png_handle_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1817
#define png_tRNS
Definition: pngpriv.h:873
#define PNG_CMAP_RGB
Definition: pngread.c:1267
#define PNG_IMAGE_FLAG_16BIT_sRGB
Definition: png.h:2953
#define PNG_HAVE_PLTE
Definition: png.h:645
void * png_voidp
Definition: pngconf.h:577
#define PNG_TRANSFORM_EXPAND
Definition: png.h:837
void PNGAPI png_read_update_info(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngread.c:267
#define PNG_CMAP_RGB_ALPHA_BACKGROUND
Definition: pngread.c:1275
#define PNG_FLAG_APP_WARNINGS_WARN
Definition: pngpriv.h:700
#define png_PLTE
Definition: pngpriv.h:851
#define PNG_CMAP_RGB_BACKGROUND
Definition: pngread.c:1274
void PNGAPI png_free(png_const_structrp png_ptr, png_voidp ptr)
Definition: pngmem.c:232
#define png_zTXt
Definition: pngpriv.h:874
#define png_iTXt
Definition: pngpriv.h:862
void PNGAPI png_set_swap_alpha(png_structrp png_ptr)
Definition: pngtrans.c:223
#define PNG_IMAGE_VERSION
Definition: png.h:2668
png_set_alpha_mode_fixed
Definition: png.h:1139
static int png_image_read_init(png_imagep image)
Definition: pngread.c:1300
#define PNG_GAMMA_sRGB
Definition: png.h:1149
#define PNG_TRANSFORM_INVERT_MONO
Definition: png.h:838
int PNGAPI png_set_interlace_handling(png_structrp png_ptr)
Definition: pngtrans.c:99
void PNGAPI png_set_scale_16(png_structrp png_ptr)
Definition: pngrtran.c:183
png_uint_32 flags
Definition: png.h:2678
#define PNG_CMAP_TRANS_BACKGROUND
Definition: pngread.c:1273
#define PNG_INTERLACE_NONE
Definition: png.h:687
png_info *PNG_RESTRICT png_inforp
Definition: png.h:471
png_byte ** png_bytepp
Definition: pngconf.h:606
#define PNG_COMPOSE
Definition: pngpriv.h:649
void png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2376
static int make_gray_file_colormap(png_image_read_control *display)
Definition: pngread.c:1977
#define PNG_FLAG_ROW_INIT
Definition: pngpriv.h:685
#define PNG_IS_READ_STRUCT
Definition: pngpriv.h:639
void png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:913
#define PNG_UINT_32_MAX
Definition: png.h:650
png_uint_16 gray
Definition: png.h:494
png_byte * png_bytep
Definition: pngconf.h:579
uint8_t i
Definition: screen_test_graph.c:72
#define PNG_PASS_COLS(width, pass)
Definition: png.h:2468
#define PNG_INVERT_MONO
Definition: pngpriv.h:647
static int make_gray_colormap(png_image_read_control *display)
Definition: pngread.c:1988
static int png_image_read_colormap(png_voidp argument)
Definition: pngread.c:2084
void PNGAPI png_set_shift(png_structrp png_ptr, png_const_color_8p true_bits)
Definition: pngtrans.c:84
static void png_read_destroy(png_structrp png_ptr)
Definition: pngread.c:940
#define PNG_IMAGE_SAMPLE_SIZE(fmt)
Definition: png.h:2855
void PNGAPI png_set_invert_mono(png_structrp png_ptr)
Definition: pngtrans.c:250
void png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, png_uint_32 transformations)
Definition: pngrutil.c:3684
const typedef png_color * png_const_colorp
Definition: png.h:485
void png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
Definition: pngrutil.c:3200
#define PNG_FORMAT_FLAG_AFIRST
Definition: png.h:2787
#define PNG_FORMAT_FLAG_BGR
Definition: png.h:2783
#define PNG_COLOR_TYPE_RGB_ALPHA
Definition: png.h:671
unsigned int for_write
Definition: pngpriv.h:2044
#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB
Definition: png.h:2937
png_const_structrp png_const_inforp int png_fixed_point * width
Definition: png.h:2161
void png_handle_tEXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2515
static int png_image_read_background(png_voidp argument)
Definition: pngread.c:3386
void PNGAPI png_set_strip_16(png_structrp png_ptr)
Definition: pngrtran.c:197
#define png_debug2(l, m, p1, p2)
Definition: pngdebug.h:151
#define PNG_GAMMA_LINEAR
Definition: png.h:1150
#define png_iCCP
Definition: pngpriv.h:861
#define png_tEXt
Definition: pngpriv.h:871
#define PNG_HAVE_CHUNK_AFTER_IDAT
Definition: pngpriv.h:637
#define PNG_INTRAPIXEL_DIFFERENCING
Definition: png.h:683
static int png_image_read_colormapped(png_voidp argument)
Definition: pngread.c:3127
#define png_voidcast(type, value)
Definition: pngpriv.h:494
#define NULL
Definition: usbd_def.h:53
png_uint_32 width
Definition: png.h:756
png_set_background_fixed
Definition: png.h:1302
void png_handle_pHYs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2154
#define png_IEND
Definition: pngpriv.h:849
void PNGAPI png_set_strip_alpha(png_structrp png_ptr)
Definition: pngrtran.c:210
png_structrp png_ptr
Definition: png.h:1083
#define PNG_FORMAT_FLAG_LINEAR
Definition: png.h:2779
#define png_sPLT
Definition: pngpriv.h:868
#define PNG_COLOR_TYPE_RGB
Definition: png.h:670
png_const_structrp png_const_inforp info_ptr
Definition: png.h:1939
#define PNG_FLAG_MNG_FILTER_64
Definition: png.h:858
#define PNG_TRANSFORM_PACKSWAP
Definition: png.h:836
#define PNG_FORMAT_FLAG_COLOR
Definition: png.h:2778
#define PNG_SWAP_BYTES
Definition: pngpriv.h:646
void PNGAPI png_start_read_image(png_structrp png_ptr)
Definition: pngread.c:298
#define PNG_CMAP_NONE
Definition: pngread.c:1264
#define PNG_DIV51(v8)
Definition: pngread.c:1656
unsigned int png_uint_32
Definition: pngconf.h:511
#define PNG_TRANSFORM_STRIP_16
Definition: png.h:833
void PNGAPI png_image_free(png_imagep image)
Definition: png.c:4582
png_uint_16(PNGAPI png_get_uint_16)(png_const_bytep buf)
Definition: pngrutil.c:102
#define PNG_ALPHA_PNG
Definition: png.h:1130
#define PNG_TRANSFORM_EXPAND_16
Definition: png.h:851
static int make_ga_colormap(png_image_read_control *display)
Definition: pngread.c:2000
#define PNG_SKIP_CHUNKS(p)
Definition: pngread.c:1647
#define PNG_PASS_ROW_OFFSET(pass)
Definition: png.h:2451
const typedef png_uint_16 * png_const_uint_16p
Definition: pngconf.h:586
#define PNG_HAVE_IHDR
Definition: png.h:644
#define PNG_PACKSWAP
Definition: pngpriv.h:658
#define PNG_FORMAT_FLAG_COLORMAP
Definition: png.h:2780
void PNGAPI png_set_expand(png_structrp png_ptr)
Definition: pngrtran.c:872
#define PNG_HAVE_IDAT
Definition: pngpriv.h:626
static int png_image_read_header(png_voidp argument)
Definition: pngread.c:1401
void png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
Definition: pngrtran.c:4736
png_structrp int png_fixed_point red
Definition: png.h:1083
void PNGAPI png_set_gray_to_rgb(png_structrp png_ptr)
Definition: pngrtran.c:955
static int png_gamma_not_sRGB(png_fixed_point g)
Definition: pngread.c:1382
#define PNG_PASS_START_COL(pass)
Definition: png.h:2444
void PNGAPI png_set_add_alpha(png_structrp png_ptr, png_uint_32 filler, int filler_loc)
Definition: pngtrans.c:205
void png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2102
png_uint_32 version
Definition: png.h:2674
#define P_FILE
Definition: pngread.c:1258
void png_read_transform_info(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngrtran.c:1940
#define PNG_IMAGE_PIXEL_CHANNELS(fmt)
Definition: png.h:2881
png_byte channels
Definition: png.h:760
#define PNG_FREE_PLTE
Definition: png.h:1758
#define PNG_TRANSFORM_INVERT_ALPHA
Definition: png.h:843
void png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2596
png_uint_16 green
Definition: png.h:492
#define PNG_COLOR_TYPE_GRAY
Definition: png.h:668
png_byte color_type
Definition: png.h:758
void PNGAPI png_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
Definition: pngerror.c:362
#define PNG_HANDLE_CHUNK_NEVER
Definition: png.h:2346
#define PNG_INTERLACE_ADAM7_PASSES
Definition: png.h:2437
#define png_debug(l, m)
Definition: pngdebug.h:145
#define PNG_TRANSFORM_PACKING
Definition: png.h:835
void PNGAPI png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, int num)
Definition: png.c:471
#define PNG_INTERLACE
Definition: pngpriv.h:643
void PNGAPI png_set_expand_16(png_structrp png_ptr)
Definition: pngrtran.c:942
void PNGAPI png_set_invert_alpha(png_structrp png_ptr)
Definition: pngtrans.c:237
#define png_IDAT
Definition: pngpriv.h:848
#define PNG_FILLER
Definition: pngpriv.h:657
void
Definition: png.h:1083
int png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times, png_int_32 divisor)
Definition: png.c:3349
png_int_32 png_fixed_point
Definition: pngconf.h:574
void png_read_IDAT_data(png_structrp png_ptr, png_bytep output, png_alloc_size_t avail_out)
Definition: pngrutil.c:4149
void png_handle_sBIT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1158
static int make_rgb_colormap(png_image_read_control *display)
Definition: pngread.c:2055
png_byte PNGAPI png_get_channels(png_const_structrp png_ptr, png_const_inforp info_ptr)
Definition: pngget.c:467
int png_image_error(png_imagep image, png_const_charp error_message)
Definition: png.c:4598
#define PNG_FILTER_VALUE_NONE
Definition: png.h:1476
#define png_IHDR
Definition: pngpriv.h:850
size_t PNGAPI png_get_rowbytes(png_const_structrp png_ptr, png_const_inforp info_ptr)
Definition: pngget.c:30
#define png_cHRM
Definition: pngpriv.h:853
png_struct *PNG_RESTRICT png_structrp
Definition: png.h:469
static png_uint_32 png_colormap_compose(png_image_read_control *display, png_uint_32 foreground, int foreground_encoding, png_uint_32 alpha, png_uint_32 background, int encoding)
Definition: pngread.c:1719
#define PNG_FILTER_VALUE_LAST
Definition: png.h:1481
png_const_bytep memory
Definition: pngpriv.h:2041
unsigned int owned_file
Definition: pngpriv.h:2045
Definition: pngpriv.h:2035
void PNGAPI png_set_benign_errors(png_structrp png_ptr, int allowed)
Definition: pngset.c:1671
png_uint_32 format
Definition: png.h:2677
#define PNG_HANDLE_CHUNK_AS_DEFAULT
Definition: png.h:2345
if(size<=((png_alloc_size_t) -1) - ob)
Definition: pngwrite.c:2176
png_uint_16 png_gamma_16bit_correct(unsigned int value, png_fixed_point gamma_val)
Definition: png.c:3912
while(sofevent)
Definition: USB_HOST_SHIELD.h:456
#define PNG_PASS_START_ROW(pass)
Definition: png.h:2443
list a
Definition: createSpeedLookupTable.py:29
void PNGAPI png_read_image(png_structrp png_ptr, png_bytepp image)
Definition: pngread.c:700
#define PNG_HAVE_IEND
Definition: pngpriv.h:628
#define PNG_CMAP_TRANS
Definition: pngread.c:1266
void PNGAPI png_set_packswap(png_structrp png_ptr)
Definition: pngtrans.c:70
void png_read_sig(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngrutil.c:121
static int png_image_read_and_map(png_voidp argument)
Definition: pngread.c:2938
png_byte pixel_depth
Definition: png.h:761
#define PNG_INTERLACE_ADAM7
Definition: png.h:688
#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)
Definition: png.h:2845
#define PNG_TRANSFORM_BGR
Definition: png.h:840
static void set_file_encoding(png_image_read_control *display)
Definition: pngread.c:1660
#define PNG_PASS_COL_OFFSET(pass)
Definition: png.h:2452
static png_uint_32 png_image_format(png_structrp png_ptr)
Definition: pngread.c:1349
void png_handle_IEND(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1100
#define PNG_ADD_ALPHA
Definition: pngpriv.h:667
#define PNG_FILLER_BEFORE
Definition: png.h:1248
#define PNG_IDAT_READ_SIZE
Definition: pnglibconf.h:195
#define P_LINEAR
Definition: pngread.c:1257
#define PNG_ALPHA_OPTIMIZED
Definition: png.h:1134
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
int png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
Definition: pngrutil.c:211
Definition: pngstruct.h:143
Definition: pngread.c:1277
display_t * display
Definition: display.c:6
void png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1362
#define PNG_RGB_TO_GRAY
Definition: pngpriv.h:665
void png_handle_gAMA(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1120
void PNGCBAPI png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
Definition: pngerror.c:921
png_uint_32 height
Definition: png.h:2676
static int png_image_read_composite(png_voidp argument)
Definition: pngread.c:3259
void PNGAPI png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)
Definition: pngrio.c:87
static unsigned int decode_gamma(png_image_read_control *display, png_uint_32 value, int encoding)
Definition: pngread.c:1680
void PNGAPI png_set_packing(png_structrp png_ptr)
Definition: pngtrans.c:50
else png_error(png_ptr, "png_image_write_to_memory: PNG too big")
void PNGAPI png_set_swap(png_structrp png_ptr)
Definition: pngtrans.c:35
void png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep)
Definition: pngrutil.c:2922
void PNGAPI png_set_keep_unknown_chunks(png_structrp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks_in)
Definition: pngset.c:1372
png_uint_16 * png_uint_16p
Definition: pngconf.h:585
png_voidp io_ptr
Definition: pngstruct.h:158
#define png_hIST
Definition: pngpriv.h:860
#define PNG_BACKGROUND_GAMMA_SCREEN
Definition: png.h:1308
#define png_oFFs
Definition: pngpriv.h:863
#define PNG_LIBPNG_VER_STRING
Definition: png.h:280
#define PNG_ERROR_ACTION_NONE
Definition: png.h:1076
#define PNG_FLAG_BENIGN_ERRORS_WARN
Definition: pngpriv.h:699
void png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2247
void PNGAPI png_read_info(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngread.c:92
size_t png_alloc_size_t
Definition: pngconf.h:557
void png_destroy_png_struct(png_structrp png_ptr)
Definition: pngmem.c:25
#define PNG_SHIFT
Definition: pngpriv.h:645
png_byte index
Definition: png.h:490
void png_handle_tIME(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2469
#define PNG_GA_COLORMAP_ENTRIES
Definition: pngread.c:2052
#define png_pHYs
Definition: pngpriv.h:865
#define PNG_CMAP_RGB_ALPHA
Definition: pngread.c:1268
#define PNG_ROWBYTES(pixel_bits, width)
Definition: pngpriv.h:738
void PNGAPI png_set_tRNS_to_alpha(png_structrp png_ptr)
Definition: pngrtran.c:926
void png_read_start_row(png_structrp png_ptr)
Definition: pngrutil.c:4391
void png_handle_cHRM(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1240
#define PNG_FLAG_FILLER_AFTER
Definition: pngpriv.h:686
#define PNG_TRANSFORM_GRAY_TO_RGB
Definition: png.h:849
#define PNG_CMAP_NONE_BACKGROUND
Definition: pngread.c:1271
#define png_sBIT
Definition: pngpriv.h:866
#define PNG_COLOR_MASK_COLOR
Definition: png.h:664
#define PNG_TRANSFORM_SWAP_ALPHA
Definition: png.h:841
void png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2713
void PNGAPI png_read_end(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngread.c:766
#define P_NOTSET
Definition: pngread.c:1255
#define png_gAMA
Definition: pngpriv.h:856
int
Definition: createSpeedLookupTable.py:15
int png_gamma_significant(png_fixed_point gamma_val)
Definition: png.c:3509
static void png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
Definition: pngread.c:321
#define PNG_FLAG_ZSTREAM_ENDED
Definition: pngpriv.h:682
size_t size
Definition: pngpriv.h:2042
void png_destroy_gamma_table(png_structrp png_ptr)
Definition: png.c:4136
#define PNG_PACK
Definition: pngpriv.h:644
#define png_pCAL
Definition: pngpriv.h:864
const png_uint_16 png_sRGB_table[256]
Definition: png.c:4373
#define PNG_COLOR_MASK_PALETTE
Definition: png.h:663
#define PNG_INFO_sBIT
Definition: png.h:733
void png_handle_oFFs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2200
void PNGAPI png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
Definition: pngerror.c:514
#define png_tIME
Definition: pngpriv.h:872
#define PNG_TRANSFORM_SWAP_ENDIAN
Definition: png.h:842
void png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1921
png_uint_32 length
Definition: png.c:2247
png_uint_32 png_read_chunk_header(png_structrp png_ptr)
Definition: pngrutil.c:156
void PNGAPI png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
Definition: pngread.c:383
int png_chunk_unknown_handling(png_const_structrp png_ptr, png_uint_32 chunk_name)
Definition: png.c:961
void png_zfree(voidpf png_ptr, voidpf ptr)
Definition: png.c:118
static int png_image_read_direct(png_voidp argument)
Definition: pngread.c:3666
int ZEXPORT inflateEnd(z_streamp strm)
Definition: inflate.c:1277
png_structrp int mode
Definition: png.h:1139
#define PNG_FP_1
Definition: png.h:656
size_t rowbytes
Definition: png.h:757
png_infop info_ptr
Definition: pngpriv.h:2038
void png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
Definition: pngerror.c:405
void png_handle_sRGB(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:1312
#define PNG_TRANSFORM_SHIFT
Definition: png.h:839
list b
Definition: createSpeedLookupTable.py:30
png_byte bit_depth
Definition: png.h:759
#define PNG_FORMAT_FLAG_ALPHA
Definition: png.h:2777
#define PNG_COLOR_TYPE_GRAY_ALPHA
Definition: png.h:672
png_uint_16 red
Definition: png.h:491
#define PNG_GAMMA_sRGB_INVERSE
Definition: pngpriv.h:906
png_structp png_ptr
Definition: pngpriv.h:2037
#define PNG_CMAP_GA
Definition: pngread.c:1265
void PNGAPI png_warning(png_const_structrp png_ptr, png_const_charp warning_message)
Definition: pngerror.c:216
png_int_32(PNGAPI png_get_int_32)(png_const_bytep buf)
Definition: pngrutil.c:84
#define png_bKGD
Definition: pngpriv.h:852
#define PNG_DIV257(v16)
Definition: pngpriv.h:735
#define PNG_COLOR_MASK_ALPHA
Definition: png.h:665
void png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
Definition: pngrutil.c:2039
#define PNG_INFO_IDAT
Definition: png.h:747
void PNGAPI png_destroy_info_struct(png_const_structrp png_ptr, png_infopp info_ptr_ptr)
Definition: png.c:386
#define PNG_RGB_TO_GRAY_DEFAULT
Definition: png.h:1079
#define PNG_COLOR_TYPE_PALETTE
Definition: png.h:669
#define PNG_SWAP_ALPHA
Definition: pngpriv.h:659
static void png_create_colormap_entry(png_image_read_control *display, png_uint_32 ip, png_uint_32 red, png_uint_32 green, png_uint_32 blue, png_uint_32 alpha, int encoding)
Definition: pngread.c:1756
#define png_sRGB
Definition: pngpriv.h:869
static png_bytep size_t size
Definition: pngwrite.c:2170
#define PNG_CMAP_GA_BACKGROUND
Definition: pngread.c:1272
png_controlp opaque
Definition: png.h:2673
void PNGAPI png_set_bgr(png_structrp png_ptr)
Definition: pngtrans.c:21