832 static png_FILE_p fpin;
833 static png_FILE_p fpout;
837 #ifdef PNG_WRITE_SUPPORTED 841 int interlace_preserved = 1;
849 png_uint_32 width, height;
850 int num_pass = 1, pass;
851 int bit_depth, color_type;
856 if ((fpin = fopen(
inname,
"rb")) == NULL)
858 fprintf(
STDERR,
"Could not find input file %s\n",
inname);
862 if ((fpout = fopen(
outname,
"wb")) == NULL)
870 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG 873 NULL, NULL, NULL, png_debug_malloc, png_debug_free);
881 #ifdef PNG_WRITE_SUPPORTED 882 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG 885 NULL, NULL, NULL, png_debug_malloc, png_debug_free);
893 pngtest_debug(
"Allocating read_info, write_info and end_info structures");
896 #ifdef PNG_WRITE_SUPPORTED 901 #ifdef PNG_READ_USER_CHUNKS_SUPPORTED 907 #ifdef PNG_SETJMP_SUPPORTED 915 #ifdef PNG_WRITE_SUPPORTED 924 #ifdef PNG_WRITE_SUPPORTED 932 #ifdef PNG_WRITE_SUPPORTED 947 #ifdef PNG_WRITE_SUPPORTED 963 #ifdef PNG_WRITE_SUPPORTED 969 #ifdef PNG_STDIO_SUPPORTED 971 # ifdef PNG_WRITE_SUPPORTED 976 # ifdef PNG_WRITE_SUPPORTED 988 #ifdef PNG_WRITE_SUPPORTED 996 #ifdef PNG_WRITE_SUPPORTED 1002 #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED 1006 for (i = 0; i<256; i++)
1012 #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED 1017 #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED 1026 #ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED 1030 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 1039 #ifdef PNG_READ_USER_CHUNKS_SUPPORTED 1050 int interlace_type, compression_type, filter_type;
1052 if (
png_get_IHDR(read_ptr, read_info_ptr, &width, &height, &bit_depth,
1053 &color_type, &interlace_type, &compression_type, &filter_type) != 0)
1055 png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth,
1056 color_type, interlace_type, compression_type, filter_type);
1057 #ifndef PNG_READ_INTERLACING_SUPPORTED 1062 switch (interlace_type)
1073 png_error(read_ptr,
"invalid interlace type");
1079 #ifdef PNG_FIXED_POINT_SUPPORTED 1080 #ifdef PNG_cHRM_SUPPORTED 1082 png_fixed_point white_x, white_y, red_x, red_y, green_x, green_y, blue_x,
1086 &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y) != 0)
1089 red_y, green_x, green_y, blue_x, blue_y);
1093 #ifdef PNG_gAMA_SUPPORTED 1102 #ifdef PNG_FLOATING_POINT_SUPPORTED 1103 #ifdef PNG_cHRM_SUPPORTED 1105 double white_x, white_y, red_x, red_y, green_x, green_y, blue_x,
1108 if (
png_get_cHRM(read_ptr, read_info_ptr, &white_x, &white_y, &red_x,
1109 &red_y, &green_x, &green_y, &blue_x, &blue_y) != 0)
1111 png_set_cHRM(write_ptr, write_info_ptr, white_x, white_y, red_x,
1112 red_y, green_x, green_y, blue_x, blue_y);
1116 #ifdef PNG_gAMA_SUPPORTED 1120 if (
png_get_gAMA(read_ptr, read_info_ptr, &gamma) != 0)
1126 #ifdef PNG_iCCP_SUPPORTED 1130 png_uint_32 proflen;
1131 int compression_type;
1133 if (
png_get_iCCP(read_ptr, read_info_ptr, &name, &compression_type,
1134 &profile, &proflen) != 0)
1136 png_set_iCCP(write_ptr, write_info_ptr, name, compression_type,
1141 #ifdef PNG_sRGB_SUPPORTED 1145 if (
png_get_sRGB(read_ptr, read_info_ptr, &intent) != 0)
1153 if (
png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette) != 0)
1154 png_set_PLTE(write_ptr, write_info_ptr, palette, num_palette);
1156 #ifdef PNG_bKGD_SUPPORTED 1160 if (
png_get_bKGD(read_ptr, read_info_ptr, &background) != 0)
1166 #ifdef PNG_hIST_SUPPORTED 1174 #ifdef PNG_oFFs_SUPPORTED 1176 png_int_32 offset_x, offset_y;
1179 if (
png_get_oFFs(read_ptr, read_info_ptr, &offset_x, &offset_y,
1182 png_set_oFFs(write_ptr, write_info_ptr, offset_x, offset_y, unit_type);
1186 #ifdef PNG_pCAL_SUPPORTED 1193 if (
png_get_pCAL(read_ptr, read_info_ptr, &purpose, &X0, &X1, &type,
1194 &nparams, &units, ¶ms) != 0)
1196 png_set_pCAL(write_ptr, write_info_ptr, purpose, X0, X1, type,
1197 nparams, units, params);
1201 #ifdef PNG_pHYs_SUPPORTED 1203 png_uint_32 res_x, res_y;
1206 if (
png_get_pHYs(read_ptr, read_info_ptr, &res_x, &res_y,
1208 png_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type);
1211 #ifdef PNG_sBIT_SUPPORTED 1215 if (
png_get_sBIT(read_ptr, read_info_ptr, &sig_bit) != 0)
1219 #ifdef PNG_sCAL_SUPPORTED 1220 #if defined(PNG_FLOATING_POINT_SUPPORTED) && \ 1221 defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) 1224 double scal_width, scal_height;
1226 if (
png_get_sCAL(read_ptr, read_info_ptr, &unit, &scal_width,
1229 png_set_sCAL(write_ptr, write_info_ptr, unit, scal_width, scal_height);
1233 #ifdef PNG_FIXED_POINT_SUPPORTED 1248 #ifdef PNG_TEXT_SUPPORTED 1253 if (
png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0)
1264 for (i=0; i<num_text; i++)
1266 printf(
" Text compression[%d]=%d\n",
1267 i, text_ptr[i].compression);
1271 png_set_text(write_ptr, write_info_ptr, text_ptr, num_text);
1275 #ifdef PNG_tIME_SUPPORTED 1279 if (
png_get_tIME(read_ptr, read_info_ptr, &mod_time) != 0)
1282 #ifdef PNG_TIME_RFC1123_SUPPORTED 1297 #ifdef PNG_tRNS_SUPPORTED 1303 if (
png_get_tRNS(read_ptr, read_info_ptr, &trans_alpha, &num_trans,
1306 int sample_max = (1 << bit_depth);
1309 (
int)trans_color->
gray > sample_max) ||
1311 ((int)trans_color->
red > sample_max ||
1312 (
int)trans_color->
green > sample_max ||
1313 (int)trans_color->
blue > sample_max))))
1314 png_set_tRNS(write_ptr, write_info_ptr, trans_alpha, num_trans,
1319 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 1325 if (num_unknowns != 0)
1329 #if PNG_LIBPNG_VER < 10600 1336 for (i = 0; i < num_unknowns; i++)
1345 #ifdef PNG_WRITE_SUPPORTED 1360 #ifdef SINGLE_ROWBUF_ALLOC 1369 #ifdef PNG_READ_INTERLACING_SUPPORTED 1372 png_error(write_ptr,
"png_set_interlace_handling: inconsistent num_pass");
1375 #ifdef PNGTEST_TIMING 1376 t_stop = (float)clock();
1377 t_misc += (t_stop - t_start);
1380 for (pass = 0; pass < num_pass; pass++)
1383 for (y = 0; y < height; y++)
1385 #ifndef SINGLE_ROWBUF_ALLOC 1386 pngtest_debug2(
"Allocating row buffer (pass %d, y = %u)...", pass, y);
1397 #ifdef PNG_WRITE_SUPPORTED 1398 #ifdef PNGTEST_TIMING 1399 t_stop = (float)clock();
1400 t_decode += (t_stop - t_start);
1404 #ifdef PNGTEST_TIMING 1405 t_stop = (float)clock();
1406 t_encode += (t_stop - t_start);
1411 #ifndef SINGLE_ROWBUF_ALLOC 1419 #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED 1420 # ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED 1423 # ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 1431 #ifdef PNG_TEXT_SUPPORTED 1436 if (
png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0)
1447 for (i=0; i<num_text; i++)
1449 printf(
" Text compression[%d]=%d\n",
1450 i, text_ptr[i].compression);
1454 png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text);
1458 #ifdef PNG_tIME_SUPPORTED 1462 if (
png_get_tIME(read_ptr, end_info_ptr, &mod_time) != 0)
1465 #ifdef PNG_TIME_RFC1123_SUPPORTED 1480 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 1486 if (num_unknowns != 0)
1490 #if PNG_LIBPNG_VER < 10600 1497 for (i = 0; i < num_unknowns; i++)
1506 #ifdef PNG_WRITE_SUPPORTED 1507 #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED 1526 #ifdef PNG_EASY_ACCESS_SUPPORTED 1529 png_uint_32 iwidth, iheight;
1532 fprintf(
STDERR,
"\n Image width = %lu, height = %lu\n",
1533 (
unsigned long)iwidth, (
unsigned long)iheight);
1538 #ifdef SINGLE_ROWBUF_ALLOC 1543 pngtest_debug(
"destroying read_ptr, read_info_ptr, end_info_ptr");
1545 #ifdef PNG_WRITE_SUPPORTED 1565 fprintf(
STDERR,
"\n %s: %d libpng errors found (%d warnings)",
1572 # ifdef PNG_WRITE_SUPPORTED 1576 fprintf(
STDERR,
"\n %s: unsupported chunks (%d)%s",
1583 fprintf(
STDERR,
"\n %s: %d libpng warnings found",
1591 if ((fpin = fopen(
inname,
"rb")) == NULL)
1597 if ((fpout = fopen(
outname,
"rb")) == NULL)
1604 #ifdef PNG_WRITE_SUPPORTED 1605 if (interlace_preserved != 0)
1609 static int wrote_question = 0;
1611 char inbuf[256], outbuf[256];
1613 num_in = fread(inbuf, 1,
sizeof inbuf, fpin);
1614 num_out = fread(outbuf, 1,
sizeof outbuf, fpout);
1616 if (num_in != num_out)
1618 fprintf(
STDERR,
"\nFiles %s and %s are of a different size\n",
1624 " Was %s written with the same maximum IDAT chunk size (%d bytes),",
1627 "\n filtering heuristic (libpng default), compression");
1629 " level (zlib default),\n and zlib version (%s)?\n\n",
1647 if (memcmp(inbuf, outbuf, num_in))
1649 fprintf(
STDERR,
"\nFiles %s and %s are different\n",
inname,
1655 " Was %s written with the same maximum IDAT chunk size (%d bytes),",
1658 "\n filtering heuristic (libpng default), compression");
1660 " level (zlib default),\n and zlib version (%s)?\n\n",
PNG_IMPEXP void() png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr)
Definition: pngwrite.c:84
PNG_IMPEXP png_uint_32() png_get_image_width(png_const_structrp png_ptr, png_const_inforp info_ptr)
Definition: pngget.c:52
#define before_PLTE
Definition: pngtest.c:631
PNG_IMPEXP png_voidp() png_malloc(png_const_structrp png_ptr, png_alloc_size_t size)
Definition: pngmem.c:169
PNG_IMPEXP png_uint_32() png_get_sCAL_s(png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_charpp swidth, png_charpp sheight)
Definition: pngget.c:924
PNG_IMPEXP png_uint_32() png_get_tIME(png_const_structrp png_ptr, png_inforp info_ptr, png_timep *mod_time)
Definition: pngget.c:1039
PNG_IMPEXP void() 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:264
static int strict
Definition: pngtest.c:124
void * png_voidp
Definition: pngconf.h:598
PNG_IMPEXP void() 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:365
PNG_IMPEXP png_structp() 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)
Definition: pngread.c:43
PNG_IMPEXP void() png_set_gAMA_fixed(png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_file_gamma)
Definition: pngset.c:139
PNG_IMPEXP void() png_read_info(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngread.c:92
PNG_IMPEXP png_uint_32() png_get_pHYs(png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
Definition: pngget.c:942
static int error_count
Definition: pngtest.c:127
Definition: pngtest.c:430
#define pngtest_debug1(m, p1)
Definition: pngtest.c:96
PNG_IMPEXP void() png_read_end(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngread.c:757
static void pngtest_error(png_structp png_ptr, png_const_charp message)
Definition: pngtest.c:456
PNG_IMPEXP png_uint_32() png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method)
Definition: pngget.c:795
PNG_IMPEXP void() png_set_sRGB(png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)
Definition: pngset.c:580
int i
Definition: rw_test.cpp:37
PNG_IMPEXP png_uint_32() png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr, png_charpp name, int *compression_type, png_bytepp profile, png_uint_32 *proflen)
Definition: pngget.c:736
PNG_IMPEXP void() png_set_cHRM_fixed(png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, png_fixed_point int_blue_y)
Definition: pngset.c:40
PNG_IMPEXP void() png_set_read_status_fn(png_structrp png_ptr, png_read_status_ptr read_row_fn)
Definition: pngread.c:1011
#define PNG_INTERLACE_NONE
Definition: png.h:828
static png_uint_32 zero_samples
Definition: pngtest.c:206
#define PNG_COLOR_TYPE_RGB
Definition: png.h:811
static int unsupported_chunks
Definition: pngtest.c:126
PNG_IMPEXP png_uint_32() png_get_sBIT(png_const_structrp png_ptr, png_inforp info_ptr, png_color_8p *sig_bit)
Definition: pngget.c:995
PNG_IMPEXP void() 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_method, int compression_method, int filter_method)
Definition: pngset.c:206
static const char * inname
Definition: pngtest.c:1694
PNG_IMPEXP png_uint_32() png_get_bKGD(png_const_structrp png_ptr, png_inforp info_ptr, png_color_16p *background)
Definition: pngget.c:488
#define PNG_INTERLACE_ADAM7
Definition: png.h:829
png_uint_16 blue
Definition: png.h:634
png_byte * png_bytep
Definition: pngconf.h:600
PNG_IMPEXP void() png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette)
Definition: pngset.c:505
png_uint_16 gray
Definition: png.h:635
PNG_IMPEXP int() png_get_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr, png_unknown_chunkpp entries)
Definition: pngget.c:1103
PNG_IMPEXP png_uint_32() png_get_gAMA(png_const_structrp png_ptr, png_const_inforp info_ptr, double *file_gamma)
Definition: pngget.c:697
#define PNG_LIBPNG_VER_STRING
Definition: png.h:426
PNG_IMPEXP void() png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)
Definition: pngwio.c:122
PNG_IMPEXP void() png_set_write_status_fn(png_structrp png_ptr, png_write_status_ptr write_row_fn)
Definition: pngwrite.c:1534
PNG_IMPEXP void() 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:917
char * png_charp
Definition: pngconf.h:610
PNG_IMPEXP void() png_set_keep_unknown_chunks(png_structrp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)
Definition: pngset.c:1282
png_byte ** png_bytepp
Definition: pngconf.h:627
PNG_IMPEXP void() png_set_unknown_chunk_location(png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location)
Definition: pngset.c:1209
Definition: pngstruct.h:144
int location[2]
Definition: pngtest.c:624
PNG_IMPEXP void() png_set_tIME(png_const_structrp png_ptr, png_inforp info_ptr, png_const_timep mod_time)
Definition: pngset.c:892
PNG_IMPEXP png_uint_32() png_get_cHRM_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_white_x, png_fixed_point *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)
Definition: pngget.c:641
#define Z_FILTERED
Definition: zlib.h:192
PNG_IMPEXP void() png_set_gAMA(png_const_structrp png_ptr, png_inforp info_ptr, double file_gamma)
Definition: pngset.c:153
PNG_IMPEXP void() png_read_rows(png_structrp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)
Definition: pngread.c:636
PNG_IMPEXP void() 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:489
PNG_IMPEXP png_structp() png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn)
Definition: pngwrite.c:482
#define png_jmpbuf(png_ptr)
Definition: png.h:1090
PNG_IMPEXP void() png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)
Definition: pngread.c:985
png_uint_16 intent
Definition: png.c:2177
PNG_IMPEXP png_structp() png_create_write_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)
Definition: pngwrite.c:496
static int status_dots_requested
Definition: pngtest.c:148
void png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, int num)
Definition: png.c:442
PNG_IMPEXP png_uint_32() png_get_tRNS(png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
Definition: pngget.c:1057
png_const_infop info_ptr
Definition: pngtest.c:620
PNG_IMPEXP png_uint_32() png_get_image_height(png_const_structrp png_ptr, png_const_inforp info_ptr)
Definition: pngget.c:61
PNG_IMPEXP void() png_set_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)
Definition: pngset.c:1113
#define pngtest_debug(m)
Definition: pngtest.c:95
PNG_IMPEXP void() png_set_write_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)
Definition: pngwrite.c:1544
PNG_IMPEXP png_uint_32() png_get_sCAL(png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, double *width, double *height)
Definition: pngget.c:908
static int warning_count
Definition: pngtest.c:128
PNG_IMPEXP void() png_set_read_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)
Definition: pngrtran.c:1057
png_uint_16 green
Definition: png.h:633
PNG_IMPEXP void() png_write_end(png_structrp png_ptr, png_inforp info_ptr)
Definition: pngwrite.c:347
#define PNG_HANDLE_CHUNK_ALWAYS
Definition: png.h:2500
PNG_IMPEXP png_uint_32() png_get_gAMA_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_file_gamma)
Definition: pngget.c:678
PNG_IMPEXP void() png_set_cHRM(png_const_structrp png_ptr, png_inforp info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y)
Definition: pngset.c:102
const char * file_name
Definition: pngtest.c:432
png_infop png_create_info_struct(png_const_structrp png_ptr)
Definition: png.c:327
static void count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data)
Definition: pngtest.c:194
static void pngtest_check_text_support(png_const_structp png_ptr, png_textp text_ptr, int num_text)
Definition: pngtest.c:795
Definition: pngtest.c:618
#define PNG_COLOR_TYPE_GRAY
Definition: png.h:809
PNG_IMPEXP void() png_set_error_fn(png_structrp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)
Definition: pngerror.c:835
PNG_IMPEXP png_uint_32() png_get_sRGB(png_const_structrp png_ptr, png_const_inforp info_ptr, int *file_srgb_intent)
Definition: pngget.c:718
PNG_IMPEXP void() png_set_sBIT(png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_8p sig_bit)
Definition: pngset.c:565
string name
Definition: cubesat2obj.cpp:6
PNG_IMPEXP int() png_get_text(png_const_structrp png_ptr, png_inforp info_ptr, png_textp *text_ptr, int *num_text)
Definition: pngget.c:1013
PNG_IMPEXP png_size_t() png_get_rowbytes(png_const_structrp png_ptr, png_const_inforp info_ptr)
Definition: pngget.c:30
PNG_IMPEXP void() 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:247
PNG_IMPEXP void() png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)
Definition: pngset.c:163
char ** png_charpp
Definition: pngconf.h:633
#define PNG_FREE_UNKN
Definition: png.h:1919
PNG_IMPEXP png_structp() png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn)
Definition: pngread.c:27
PNG_IMPEXP void() png_set_text(png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text)
Definition: pngset.c:688
PNG_IMPEXP int() png_set_interlace_handling(png_structrp png_ptr)
Definition: pngtrans.c:99
void png_init_io(png_structrp png_ptr, png_FILE_p fp)
Definition: png.c:658
#define before_IDAT
Definition: pngtest.c:632
PNG_IMPEXP void() png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
Definition: pngwrite.c:191
PNG_IMPEXP void() png_set_benign_errors(png_structrp png_ptr, int allowed)
Definition: pngset.c:1570
static void write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
Definition: pngtest.c:177
#define ZLIB_VERSION
Definition: zlib.h:40
static void write_chunks(png_structp write_ptr, int location)
Definition: pngtest.c:764
#define STDERR
Definition: pngtest.c:42
PNG_IMPEXP void() png_set_text_compression_strategy(png_structrp png_ptr, int strategy)
Definition: pngwrite.c:1483
static png_uint_32 filters_used[256]
Definition: pngtest.c:192
PNG_IMPEXP void() png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)
Definition: pngrio.c:87
int png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime)
Definition: png.c:691
PNG_IMPEXP void() png_write_rows(png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)
Definition: pngwrite.c:562
PNG_IMPEXP void() png_set_bKGD(png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_16p background)
Definition: pngset.c:25
PNG_IMPEXP void() png_set_sCAL(png_const_structrp png_ptr, png_inforp info_ptr, int unit, double width, double height)
Definition: pngset.c:430
png_uint_16 * png_uint_16p
Definition: pngconf.h:606
#define after_IDAT
Definition: pngtest.c:633
PNG_IMPEXP void() png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp name, int compression_type, png_const_bytep profile, png_uint_32 proflen)
Definition: pngset.c:615
PNG_IMPEXP png_uint_32() png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist)
Definition: pngget.c:778
static void init_callback_info(png_const_infop info_ptr)
Definition: pngtest.c:636
PNG_IMPEXP png_uint_32() png_get_oFFs(png_const_structrp png_ptr, png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
Definition: pngget.c:834
#define FCLOSE(file)
Definition: pngtest.c:79
PNG_IMPEXP void() png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
Definition: pngwrite.c:979
png_int_32 png_fixed_point
Definition: pngconf.h:595
PNG_IMPEXP png_uint_32() png_get_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)
Definition: pngget.c:855
#define PNG_WRITE_FLUSH_SUPPORTED
Definition: pnglibconf.h:135
static void count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
Definition: pngtest.c:209
static void read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
Definition: pngtest.c:152
PNG_IMPEXP void() png_free(png_const_structrp png_ptr, png_voidp ptr)
Definition: pngmem.c:229
PNG_IMPEXP void() png_set_read_user_chunk_fn(png_structrp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)
Definition: pngset.c:1437
PNG_IMPEXP void() png_error(png_const_structrp png_ptr, png_const_charp error_message)
Definition: pngerror.c:40
#define PNG_ZBUF_SIZE
Definition: pnglibconf.h:202
size_t png_size_t
Definition: pngconf.h:543
PNG_IMPEXP png_uint_32() png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)
Definition: pngget.c:512
static int relaxed
Definition: pngtest.c:125
static int read_user_chunk_callback(png_struct *png_ptr, png_unknown_chunkp chunk)
Definition: pngtest.c:672
static const char * outname
Definition: pngtest.c:1695
png_uint_16 red
Definition: png.h:632
static int verbose
Definition: pngtest.c:123
static void pngtest_warning(png_structp png_ptr, png_const_charp message)
Definition: pngtest.c:436
static int tIME_chunk_present
Definition: pngtest.c:119
#define pngtest_debug2(m, p1, p2)
Definition: pngtest.c:97
PNG_IMPEXP png_uint_32() png_get_PLTE(png_const_structrp png_ptr, png_inforp info_ptr, png_colorp *palette, int *num_palette)
Definition: pngget.c:976
static char tIME_string[29]
Definition: pngtest.c:120
void png_destroy_info_struct(png_const_structrp png_ptr, png_infopp info_ptr_ptr)
Definition: png.c:359