Go to the documentation of this file.
33 #if defined(_WIN32_WCE)
35 __error__ (
f|w)printf functions are not supported on old WindowsCE.;
39 # define READFILE(file, data, length, check) \
40 if (ReadFile(file, data, length, &check, NULL)) check = 0
41 # define WRITEFILE(file, data, length, check)) \
42 if (WriteFile(file, data, length, &check, NULL)) check = 0
43 # define FCLOSE(file) CloseHandle(file)
47 # define READFILE(file, data, length, check) \
48 check=(png_size_t)fread(data, (png_size_t)1, length, file)
49 # define WRITEFILE(file, data, length, check) \
50 check=(png_size_t)fwrite(data, (png_size_t)1, length, file)
51 # define FCLOSE(file) fclose(file)
54 #if defined(PNG_NO_STDIO)
55 # if defined(_WIN32_WCE)
68 # define SINGLE_ROWBUF_ALLOC
75 #ifdef PNG_NO_FLOATING_POINT_SUPPORTED
80 static float t_start, t_stop, t_decode, t_encode, t_misc;
84 #if defined(PNG_TIME_RFC1123_SUPPORTED)
85 #define PNG_tIME_STRING_LENGTH 29
100 #define STDERR stdout
109 # define png_jmpbuf(png_ptr) png_ptr->jmpbuf
131 fprintf(stdout,
"\n Pass %d: ", pass);
138 fprintf(stdout,
"\n ");
141 fprintf(stdout,
"r");
155 if (png_ptr == NULL || row_number >
PNG_UINT_31_MAX || pass > 7)
return;
156 fprintf(stdout,
"w");
160 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
176 if (png_ptr != NULL && row_info != NULL)
181 #if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
199 if (png_ptr == NULL)
return;
213 if (row_info->color_type == 0 || row_info->color_type == 3)
217 for (
n = 0, nstop=row_info->width;
n<nstop;
n++)
219 if (row_info->bit_depth == 1)
228 if (row_info->bit_depth == 2)
237 if (row_info->bit_depth == 4)
246 if (row_info->bit_depth == 8)
248 if (row_info->bit_depth == 16)
259 int color_channels = row_info->channels;
260 if (row_info->color_type > 3)color_channels--;
262 for (
n = 0, nstop=row_info->width;
n<nstop;
n++)
264 for (channel = 0; channel < color_channels; channel++)
266 if (row_info->bit_depth == 8)
268 if (row_info->bit_depth == 16)
274 if (row_info->color_type > 3)
277 if (row_info->bit_depth == 16)dp++;
286 #if defined(PNG_NO_STDIO)
295 #ifndef USE_FAR_KEYWORD
317 #define NEAR_BUF_SIZE 1024
318 #define MIN(a,b) (a <= b ? a : b)
342 read =
MIN(NEAR_BUF_SIZE, remaining);
352 while (remaining != 0);
361 #if defined(PNG_WRITE_FLUSH_SUPPORTED)
365 #if !defined(_WIN32_WCE)
378 #ifndef USE_FAR_KEYWORD
396 #define NEAR_BUF_SIZE 1024
397 #define MIN(a,b) (a <= b ? a : b)
421 written =
MIN(NEAR_BUF_SIZE, remaining);
429 remaining -= written;
431 while (remaining != 0);
449 if (png_ptr != NULL && png_ptr->error_ptr != NULL)
450 name = png_ptr->error_ptr;
451 fprintf(
STDERR,
"%s: libpng warning: %s\n",
name, message);
462 pngtest_warning(png_ptr, message);
470 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
480 typedef struct memory_information
484 struct memory_information
FAR *next;
485 } memory_information;
486 typedef memory_information
FAR *memory_infop;
488 static memory_infop pinformation = NULL;
489 static int current_allocation = 0;
490 static int maximum_allocation = 0;
491 static int total_allocation = 0;
492 static int num_allocations = 0;
516 current_allocation +=
size;
517 total_allocation +=
size;
519 if (current_allocation > maximum_allocation)
520 maximum_allocation = current_allocation;
525 (png_free_ptr)png_debug_free);
526 if (
size != 0 && pinfo->pointer == NULL)
528 current_allocation -=
size;
529 total_allocation -=
size;
531 "out of memory in pngtest->png_debug_malloc.");
533 pinfo->next = pinformation;
534 pinformation = pinfo;
536 png_memset(pinfo->pointer, 0xdd, pinfo->size);
538 printf(
"png_malloc %lu bytes at %x\n", (
unsigned long)
size,
549 fprintf(
STDERR,
"NULL pointer to png_debug_free.\n");
553 fprintf(
STDERR,
"WARNING: freeing NULL pointer\n");
560 memory_infop
FAR *ppinfo = &pinformation;
563 memory_infop pinfo = *ppinfo;
564 if (pinfo->pointer ==
ptr)
566 *ppinfo = pinfo->next;
567 current_allocation -= pinfo->size;
568 if (current_allocation < 0)
569 fprintf(
STDERR,
"Duplicate free of memory\n");
577 if (pinfo->next == NULL)
579 fprintf(
STDERR,
"Pointer %x not found\n", (
unsigned int)
ptr);
582 ppinfo = &pinfo->next;
588 printf(
"Freeing %x\n",
ptr);
597 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
629 if (
chunk->name[0] == 115 &&
chunk->name[1] == 84 &&
633 if (
chunk->size != 1)
635 if (
chunk->data[0] != 0 &&
chunk->data[0] != 1)
641 if (
chunk->name[0] != 118 ||
chunk->name[1] != 112 ||
642 chunk->name[2] != 65 ||
chunk->name[3] != 103)
647 if (
chunk->size != 9)
670 #ifdef PNG_WRITE_SUPPORTED
684 #ifdef PNG_SETJMP_SUPPORTED
685 #ifdef USE_FAR_KEYWORD
690 #if defined(_WIN32_WCE)
691 TCHAR path[MAX_PATH];
693 char inbuf[256], outbuf[256];
697 #if defined(_WIN32_WCE)
698 MultiByteToWideChar(CP_ACP, 0,
inname, -1, path, MAX_PATH);
699 if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
701 if ((fpin = fopen(
inname,
"rb")) == NULL)
704 fprintf(
STDERR,
"Could not find input file %s\n",
inname);
708 #if defined(_WIN32_WCE)
709 MultiByteToWideChar(CP_ACP, 0,
outname, -1, path, MAX_PATH);
710 if ((fpout = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL)) == INVALID_HANDLE_VALUE)
712 if ((fpout = fopen(
outname,
"wb")) == NULL)
720 png_debug(0,
"Allocating read and write structures\n");
721 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
725 (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free);
731 #if defined(PNG_NO_STDIO)
736 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
745 #ifdef PNG_WRITE_SUPPORTED
746 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
750 (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free);
756 #if defined(PNG_NO_STDIO)
761 png_debug(0,
"Allocating read_info, write_info and end_info structures\n");
764 #ifdef PNG_WRITE_SUPPORTED
769 #ifdef PNG_SETJMP_SUPPORTED
770 png_debug(0,
"Setting jmpbuf for read struct\n");
771 #ifdef USE_FAR_KEYWORD
781 #ifdef PNG_WRITE_SUPPORTED
789 #ifdef USE_FAR_KEYWORD
793 #ifdef PNG_WRITE_SUPPORTED
794 png_debug(0,
"Setting jmpbuf for write struct\n");
795 #ifdef USE_FAR_KEYWORD
804 #ifdef PNG_WRITE_SUPPORTED
811 #ifdef USE_FAR_KEYWORD
817 png_debug(0,
"Initializing input and output streams\n");
818 #if !defined(PNG_NO_STDIO)
820 # ifdef PNG_WRITE_SUPPORTED
825 # ifdef PNG_WRITE_SUPPORTED
836 #ifdef PNG_WRITE_SUPPORTED
843 #ifdef PNG_WRITE_SUPPORTED
849 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
852 for (
i = 0;
i<256;
i++)
857 #if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
862 #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
863 # ifndef PNG_HANDLE_CHUNK_ALWAYS
864 # define PNG_HANDLE_CHUNK_ALWAYS 3
869 #if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED)
870 # ifndef PNG_HANDLE_CHUNK_IF_SAFE
871 # define PNG_HANDLE_CHUNK_IF_SAFE 2
880 png_debug(0,
"Transferring info struct\n");
895 #if defined(PNG_FIXED_POINT_SUPPORTED)
896 #if defined(PNG_cHRM_SUPPORTED)
908 #if defined(PNG_gAMA_SUPPORTED)
919 #if defined(PNG_FLOATING_POINT_SUPPORTED)
920 #if defined(PNG_cHRM_SUPPORTED)
932 #if defined(PNG_gAMA_SUPPORTED)
944 #if defined(PNG_iCCP_SUPPORTED)
959 #if defined(PNG_sRGB_SUPPORTED)
978 #if defined(PNG_bKGD_SUPPORTED)
988 #if defined(PNG_hIST_SUPPORTED)
998 #if defined(PNG_oFFs_SUPPORTED)
1010 #if defined(PNG_pCAL_SUPPORTED)
1025 #if defined(PNG_pHYs_SUPPORTED)
1036 #if defined(PNG_sBIT_SUPPORTED)
1046 #if defined(PNG_sCAL_SUPPORTED)
1047 #ifdef PNG_FLOATING_POINT_SUPPORTED
1050 double scal_width, scal_height;
1059 #ifdef PNG_FIXED_POINT_SUPPORTED
1064 if (png_get_sCAL_s(read_ptr, read_info_ptr, &
unit, &scal_width,
1067 png_set_sCAL_s(write_ptr, write_info_ptr,
unit, scal_width, scal_height);
1073 #if defined(PNG_TEXT_SUPPORTED)
1085 #if defined(PNG_tIME_SUPPORTED)
1092 #if defined(PNG_TIME_RFC1123_SUPPORTED)
1105 #if defined(PNG_tRNS_SUPPORTED)
1114 int sample_max = (1 << read_info_ptr->bit_depth);
1127 #if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED)
1147 #ifdef PNG_WRITE_SUPPORTED
1148 png_debug(0,
"\nWriting info struct\n");
1155 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
1158 png_byte png_sTER[5] = {115, 84, 69, 82,
'\0'};
1164 fprintf(
STDERR,
"stereo mode = %lu\n",
1171 png_byte png_vpAg[5] = {118, 112, 65, 103,
'\0'};
1177 fprintf(
STDERR,
"vpAg = %lu x %lu, units=%lu\n",
1190 #ifdef SINGLE_ROWBUF_ALLOC
1191 png_debug(0,
"\nAllocating row buffer...");
1194 png_debug1(0,
"0x%08lx\n\n", (
unsigned long)row_buf);
1198 #if defined(PNG_READ_INTERLACING_SUPPORTED) || \
1199 defined(PNG_WRITE_INTERLACING_SUPPORTED)
1201 # ifdef PNG_WRITE_SUPPORTED
1208 #ifdef PNGTEST_TIMING
1209 t_stop = (float)clock();
1210 t_misc += (t_stop - t_start);
1213 for (pass = 0; pass < num_pass; pass++)
1215 png_debug1(0,
"Writing row data for pass %d\n", pass);
1216 for (y = 0; y <
height; y++)
1218 #ifndef SINGLE_ROWBUF_ALLOC
1219 png_debug2(0,
"\nAllocating row buffer (pass %d, y = %ld)...", pass, y);
1222 png_debug2(0,
"0x%08lx (%ld bytes)\n", (
unsigned long)row_buf,
1227 #ifdef PNG_WRITE_SUPPORTED
1228 #ifdef PNGTEST_TIMING
1229 t_stop = (float)clock();
1230 t_decode += (t_stop - t_start);
1234 #ifdef PNGTEST_TIMING
1235 t_stop = (float)clock();
1236 t_encode += (t_stop - t_start);
1241 #ifndef SINGLE_ROWBUF_ALLOC
1242 png_debug2(0,
"Freeing row buffer (pass %d, y = %ld)\n\n", pass, y);
1249 #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
1252 #if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED)
1256 png_debug(0,
"Reading and writing end_info data\n");
1259 #if defined(PNG_TEXT_SUPPORTED)
1271 #if defined(PNG_tIME_SUPPORTED)
1278 #if defined(PNG_TIME_RFC1123_SUPPORTED)
1291 #if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED)
1311 #ifdef PNG_WRITE_SUPPORTED
1315 #ifdef PNG_EASY_ACCESS_SUPPORTED
1321 fprintf(
STDERR,
"Image width = %lu, height = %lu\n",
1322 (
unsigned long)iwidth, (
unsigned long)iheight);
1326 png_debug(0,
"Destroying data structs\n");
1327 #ifdef SINGLE_ROWBUF_ALLOC
1328 png_debug(1,
"destroying row_buf for read_ptr\n");
1332 png_debug(1,
"destroying read_ptr, read_info_ptr, end_info_ptr\n");
1334 #ifdef PNG_WRITE_SUPPORTED
1335 png_debug(1,
"destroying write_end_info_ptr\n");
1337 png_debug(1,
"destroying write_ptr, write_info_ptr\n");
1340 png_debug(0,
"Destruction complete.\n");
1345 png_debug(0,
"Opening files for comparison\n");
1346 #if defined(_WIN32_WCE)
1347 MultiByteToWideChar(CP_ACP, 0,
inname, -1, path, MAX_PATH);
1348 if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
1350 if ((fpin = fopen(
inname,
"rb")) == NULL)
1357 #if defined(_WIN32_WCE)
1358 MultiByteToWideChar(CP_ACP, 0,
outname, -1, path, MAX_PATH);
1359 if ((fpout = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
1361 if ((fpout = fopen(
outname,
"rb")) == NULL)
1374 READFILE(fpout, outbuf, 1, num_out);
1376 if (num_in != num_out)
1378 fprintf(
STDERR,
"\nFiles %s and %s are of a different size\n",
1383 " Was %s written with the same maximum IDAT chunk size (%d bytes),",
1386 "\n filtering heuristic (libpng default), compression");
1388 " level (zlib default),\n and zlib version (%s)?\n\n",
1406 " Was %s written with the same maximum IDAT chunk size (%d bytes),",
1409 "\n filtering heuristic (libpng default), compression");
1411 " level (zlib default),\n and zlib version (%s)?\n\n",
1446 fprintf(
STDERR,
" library (%lu):%s",
1452 fprintf(
STDERR,
" sizeof(png_struct)=%ld, sizeof(png_info)=%ld\n",
1459 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
1460 fprintf(
STDERR,
" NOTE: Zlib compiled for max 64k, libpng not\n");
1463 #if !defined(MAXSEG_64K) && defined(PNG_MAX_MALLOC_64K)
1464 fprintf(
STDERR,
" NOTE: libpng compiled for max 64k, zlib not\n");
1470 "Warning: versions are different between png.h and png.c\n");
1478 if (strcmp(argv[1],
"-m") == 0)
1483 else if (strcmp(argv[1],
"-mv") == 0 ||
1484 strcmp(argv[1],
"-vm") == 0 )
1490 else if (strcmp(argv[1],
"-v") == 0)
1503 if (!multiple && argc == 3 +
verbose)
1506 if ((!multiple && argc > 3 +
verbose) || (multiple && argc < 2))
1509 "usage: %s [infile.png] [outfile.png]\n\t%s -m {infile.png}\n",
1512 " reads/writes one PNG file (without -m) or multiple files (-m)\n");
1514 " with -m %s is used as a temporary file\n",
outname);
1521 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
1522 int allocation_now = current_allocation;
1524 for (
i=2;
i<argc; ++
i)
1526 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
1530 fprintf(
STDERR,
"Testing %s:", argv[
i]);
1534 #if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
1535 fprintf(
STDERR,
"\n PASS (%lu zero samples)\n",
1538 fprintf(
STDERR,
" PASS\n");
1540 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
1541 for (k = 0; k<256; k++)
1543 fprintf(
STDERR,
" Filter %d was used %lu times\n",
1546 #if defined(PNG_TIME_RFC1123_SUPPORTED)
1554 fprintf(
STDERR,
" FAIL\n");
1557 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
1558 if (allocation_now != current_allocation)
1559 fprintf(
STDERR,
"MEMORY ERROR: %d bytes lost\n",
1560 current_allocation - allocation_now);
1561 if (current_allocation != 0)
1563 memory_infop pinfo = pinformation;
1565 fprintf(
STDERR,
"MEMORY ERROR: %d bytes still allocated\n",
1566 current_allocation);
1567 while (pinfo != NULL)
1569 fprintf(
STDERR,
" %lu bytes at %x\n",
1570 (
unsigned long)pinfo->size,
1571 (
unsigned int) pinfo->pointer);
1572 pinfo = pinfo->next;
1577 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
1578 fprintf(
STDERR,
" Current memory allocation: %10d bytes\n",
1579 current_allocation);
1580 fprintf(
STDERR,
" Maximum memory allocation: %10d bytes\n",
1581 maximum_allocation);
1582 fprintf(
STDERR,
" Total memory allocation: %10d bytes\n",
1584 fprintf(
STDERR,
" Number of allocations: %10d\n",
1591 for (
i = 0;
i<3; ++
i)
1594 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
1595 int allocation_now = current_allocation;
1599 if (
i == 0 ||
verbose == 1 || ierror != 0)
1606 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
1609 #if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
1610 fprintf(
STDERR,
"\n PASS (%lu zero samples)\n",
1613 fprintf(
STDERR,
" PASS\n");
1615 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
1616 for (k = 0; k<256; k++)
1618 fprintf(
STDERR,
" Filter %d was used %lu times\n",
1622 #if defined(PNG_TIME_RFC1123_SUPPORTED)
1632 fprintf(
STDERR,
" FAIL\n");
1635 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
1636 if (allocation_now != current_allocation)
1637 fprintf(
STDERR,
"MEMORY ERROR: %d bytes lost\n",
1638 current_allocation - allocation_now);
1639 if (current_allocation != 0)
1641 memory_infop pinfo = pinformation;
1643 fprintf(
STDERR,
"MEMORY ERROR: %d bytes still allocated\n",
1644 current_allocation);
1645 while (pinfo != NULL)
1647 fprintf(
STDERR,
" %lu bytes at %x\n",
1648 (
unsigned long)pinfo->size, (
unsigned int)pinfo->pointer);
1649 pinfo = pinfo->next;
1654 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
1655 fprintf(
STDERR,
" Current memory allocation: %10d bytes\n",
1656 current_allocation);
1657 fprintf(
STDERR,
" Maximum memory allocation: %10d bytes\n",
1658 maximum_allocation);
1659 fprintf(
STDERR,
" Total memory allocation: %10d bytes\n",
1661 fprintf(
STDERR,
" Number of allocations: %10d\n",
1666 #ifdef PNGTEST_TIMING
1667 t_stop = (float)clock();
1668 t_misc += (t_stop - t_start);
1670 fprintf(
STDERR,
" CPU time used = %.3f seconds",
1671 (t_misc+t_decode+t_encode)/(
float)CLOCKS_PER_SEC);
1672 fprintf(
STDERR,
" (decoding %.3f,\n",
1673 t_decode/(
float)CLOCKS_PER_SEC);
1674 fprintf(
STDERR,
" encoding %.3f ,",
1675 t_encode/(
float)CLOCKS_PER_SEC);
1676 fprintf(
STDERR,
" other %.3f seconds)\n\n",
1677 t_misc/(
float)CLOCKS_PER_SEC);
1681 fprintf(
STDERR,
"libpng passes test\n");
1683 fprintf(
STDERR,
"libpng FAILS test\n");
1684 return (
int)(ierror != 0);
png_uint_32 PNGAPI png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
void read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
void PNGAPI png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, int num_text)
png_uint_32 PNGAPI png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr, int *num_text)
void PNGAPI png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, png_fixed_point blue_y)
png_infop png_uint_32 png_uint_32 * res_y
png_uint_32 PNGAPI png_get_rowbytes(png_structp png_ptr, png_infop info_ptr)
png_infop png_textp * text_ptr
void PNGAPI png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
png_charp PNGAPI png_get_copyright(png_structp png_ptr)
void PNGAPI png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)
png_infop png_uint_32 * width
void PNGAPI png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
void PNGAPI png_write_rows(png_structp png_ptr, png_bytepp row, png_uint_32 num_rows)
int PNGAPI png_set_interlace_handling(png_structp png_ptr)
png_infop png_charpp int png_charpp png_uint_32 * proflen
png_infop double double double double double double double double * blue_y
png_charp PNGAPI png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
void PNGAPI png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn)
png_uint_32 PNGAPI png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist)
#define png_debug2(l, m, p1, p2)
static int tIME_chunk_present
#define png_error_ptr_NULL
void PNGAPI png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr, int chunk, int location)
#define PNG_HANDLE_CHUNK_IF_SAFE
void PNGAPI png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
png_uint_32 PNGAPI png_get_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
png_infop int int location
#define png_read_status_ptr_NULL
void PNGAPI png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)
png_infop png_textp int * num_text
static PNG_CONST char * inname
png_uint_32 PNGAPI png_get_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p *background)
void PNGAPI png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent)
#define PNG_WRITE_FLUSH_SUPPORTED
png_uint_32 PNGAPI png_get_image_width(png_structp png_ptr, png_infop info_ptr)
png_infop png_int_32 png_int_32 int * unit_type
png_uint_32 PNGAPI png_get_uint_31(png_structp png_ptr, png_bytep buf)
png_color_16 FAR * png_color_16p
png_structp PNGAPI 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)
png_color_8 FAR * png_color_8p
#define PNG_INTERLACE_NONE
png_infop png_unknown_chunkp unknowns
void PNGAPI png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)
png_infop png_charp png_int_32 png_int_32 int int png_charp png_charpp * params
png_uint_32 PNGAPI png_get_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values)
void PNGAPI png_set_iCCP(png_structp png_ptr, png_infop info_ptr, png_charp name, int compression_type, png_charp profile, png_uint_32 proflen)
png_unknown_chunk FAR * png_unknown_chunkp
#define CVT_PTR_NOCHECK(ptr)
static int status_dots_requested
void PNGAPI png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
png_color FAR * png_colorp
void PNGAPI png_set_IHDR(png_structp png_ptr, png_infop 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)
void PNGAPI png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background)
png_voidp PNGAPI png_malloc(png_structp png_ptr, png_uint_32 size)
static png_uint_32 user_chunk_data[4]
static png_uint_32 zero_samples
png_infop png_uint_32 png_uint_32 int * bit_depth
PNG_CONST char FAR * png_const_charp
png_infop png_charp png_int_32 png_int_32 int * type
void PNGAPI png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
png_infop PNGAPI png_create_info_struct(png_structp png_ptr)
void count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
png_infop png_charp png_int_32 png_int_32 * X1
void PNGAPI png_read_rows(png_structp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)
int main(int argc, char *argv[])
PNG_CONST char png_libpng_ver[18]
png_byte FAR *FAR * png_bytepp
#define PNG_COLOR_TYPE_RGB
void PNGAPI png_read_end(png_structp png_ptr, png_infop info_ptr)
png_structp PNGAPI png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn)
void PNGAPI png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr read_user_transform_fn)
#define MIN(a, b)
Returns the min value between a and b.
png_infop png_charpp int png_charpp profile
void PNGAPI png_set_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)
#define PNG_WRITE_INTERLACING_SUPPORTED
png_infop double double * white_y
png_infop png_charpp int * compression_type
png_uint_32 PNGAPI png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point *int_file_gamma)
png_uint_32 PNGAPI png_get_oFFs(png_structp png_ptr, png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
png_uint_32 PNGAPI png_get_sCAL(png_structp png_ptr, png_infop info_ptr, int *unit, double *width, double *height)
void PNGAPI png_set_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp palette, int num_palette)
png_uint_32 PNGAPI png_get_iCCP(png_structp png_ptr, png_infop info_ptr, png_charpp name, int *compression_type, png_charpp profile, png_uint_32 *proflen)
void PNGAPI png_set_pCAL(png_structp png_ptr, png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_charp units, png_charpp params)
png_infop double double double double double * green_x
png_infop png_charp png_int_32 png_int_32 int int png_charp * units
#define PNG_COLOR_TYPE_GRAY
#define PNG_HANDLE_CHUNK_ALWAYS
void PNGAPI png_set_oFFs(png_structp png_ptr, png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type)
void PNGAPI png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)
void PNGAPI png_read_info(png_structp png_ptr, png_infop info_ptr)
void PNGAPI png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)
png_uint_32 PNGAPI png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x, png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y, png_fixed_point *blue_x, png_fixed_point *blue_y)
void PNGAPI png_set_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)
void PNGAPI png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width, double height)
void count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data)
void PNGAPI png_set_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p sig_bit)
png_uint_32 PNGAPI png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_unknown_chunkpp unknowns)
static png_uint_32 filters_used[256]
png_infop png_uint_32 * res_x
#define png_jmpbuf(png_ptr)
png_infop png_charp * purpose
png_struct FAR * png_structp
png_structp version_1_2_32
void PNGAPI png_free_default(png_structp png_ptr, png_voidp ptr)
png_infop png_charpp name
png_infop png_bytep * trans
png_uint_16 FAR * png_uint_16p
void PNGAPI png_set_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep trans, int num_trans, png_color_16p trans_values)
void PNGAPI png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr write_user_transform_fn)
png_infop png_charp png_int_32 png_int_32 int int * nparams
void PNGAPI png_init_io(png_structp png_ptr, png_FILE_p fp)
#define png_debug1(l, m, p1)
#define png_write_status_ptr_NULL
#define READFILE(file, data, length, check)
void PNGAPI png_set_cHRM(png_structp png_ptr, png_infop 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)
png_infop double double double double double double double * blue_x
int test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_uint_32 PNGAPI png_get_IHDR(png_structp png_ptr, png_infop 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)
png_uint_32 PNGAPI png_get_image_height(png_structp png_ptr, png_infop info_ptr)
png_charp PNGAPI png_get_header_version(png_structp png_ptr)
png_infop png_charp png_int_32 * X0
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_uint_32 PNGAPI png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette)
png_uint_32 PNGAPI png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
png_infop png_int_32 png_int_32 * offset_y
#define PNG_LIBPNG_VER_STRING
version_1_2_32 your_png_h_is_not_version_1_2_32
void PNGAPI png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point int_gamma)
png_infop png_color_16p * background
png_infop png_int_32 * offset_x
static PNG_CONST char * outname
png_infop png_color_8p * sig_bit
png_infop double double double double * red_y
void PNGAPI png_save_uint_32(png_bytep buf, png_uint_32 i)
unsigned long png_uint_32
void PNGAPI png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep chunk_list, int num_chunks)
png_infop png_uint_32 png_uint_32 * height
png_infop png_bytep int * num_trans
png_uint_32 PNGAPI png_access_version_number(void)
void PNGAPI png_write_chunk(png_structp png_ptr, png_bytep chunk_name, png_bytep data, png_size_t length)
png_uint_32 PNGAPI png_get_pCAL(png_structp png_ptr, png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)
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)
int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname))
png_int_32 png_fixed_point
png_uint_32 PNGAPI png_get_cHRM(png_structp png_ptr, png_infop 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)
void write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
static char tIME_string[PNG_tIME_STRING_LENGTH]
char FAR *FAR * png_charpp
png_bytep png_bytep png_size_t length
png_infop double * white_x
static int wrote_question
void PNGAPI png_write_end(png_structp png_ptr, png_infop info_ptr)
png_infop double double double double double double * green_y
png_infop png_unknown_chunkp int num_unknowns
png_infop png_bytep int png_color_16p * trans_values
png_infop png_uint_32 png_uint_32 int int * color_type
png_infop png_uint_16p * hist
void PNGAPI png_write_info(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
void PNGAPI png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)
png_voidp PNGAPI png_get_user_chunk_ptr(png_structp png_ptr)
void PNGAPI png_error(png_structp png_ptr, png_const_charp error_message)
void PNGAPI png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn)
png_row_info FAR * png_row_infop
void PNGAPI png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time)
png_infop png_timep * mod_time
png_infop double double double * red_x
void PNGAPI png_free(png_structp png_ptr, png_voidp ptr)
#define PNG_HEADER_VERSION_STRING
#define PNG_tIME_STRING_LENGTH
#define WRITEFILE(file, data, length, check)
png_uint_32 PNGAPI png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
png_colorp int num_palette
static int read_user_chunk_callback(png_struct *png_ptr, png_unknown_chunkp chunk)
openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:04