75 #include "config_auto.h" 79 #include "allheaders.h" 82 static const char *FILE_BMP =
"/tmp/lept/format/file.bmp";
83 static const char *FILE_PNG =
"/tmp/lept/format/file.png";
84 static const char *FILE_PNM =
"/tmp/lept/format/file.pnm";
85 static const char *FILE_G3 =
"/tmp/lept/format/file_g3.tif";
86 static const char *FILE_G4 =
"/tmp/lept/format/file_g4.tif";
87 static const char *FILE_RLE =
"/tmp/lept/format/file_rle.tif";
88 static const char *FILE_PB =
"/tmp/lept/format/file_packbits.tif";
89 static const char *FILE_LZW =
"/tmp/lept/format/file_lzw.tif";
90 static const char *FILE_ZIP =
"/tmp/lept/format/file_zip.tif";
91 static const char *FILE_TIFF =
"/tmp/lept/format/file.tif";
92 static const char *FILE_JPG =
"/tmp/lept/format/file.jpg";
93 static const char *FILE_GIF =
"/tmp/lept/format/file.gif";
94 static const char *FILE_WEBP =
"/tmp/lept/format/file.webp";
95 static const char *FILE_JP2K =
"/tmp/lept/format/file.jp2";
97 static const unsigned char JP2K_CODESTREAM[4] = { 0xff, 0x4f, 0xff, 0x51 };
98 static const unsigned char JP2K_IMAGE_DATA[12] = { 0x00, 0x00, 0x00, 0x0C,
99 0x6A, 0x50, 0x20, 0x20,
100 0x0D, 0x0A, 0x87, 0x0A };
129 PROCNAME(
"pixaReadFiles");
132 return (
PIXA *)ERROR_PTR(
"dirname not defined", procName, NULL);
135 return (
PIXA *)ERROR_PTR(
"sa not made", procName, NULL);
157 PROCNAME(
"pixaReadFilesSA");
160 return (
PIXA *)ERROR_PTR(
"sa not defined", procName, NULL);
164 for (i = 0; i < n; i++) {
166 if ((pix =
pixRead(str)) == NULL) {
167 L_WARNING(
"pix not read from file %s\n", procName, str);
197 return (
PIX *)ERROR_PTR(
"filename not defined", procName, NULL);
200 L_ERROR(
"image file not found: %s\n", procName, filename);
206 return (
PIX *)ERROR_PTR(
"pix not read", procName, NULL);
231 PROCNAME(
"pixReadWithHint");
234 return (
PIX *)ERROR_PTR(
"filename not defined", procName, NULL);
237 return (
PIX *)ERROR_PTR(
"image file not found", procName, NULL);
242 return (
PIX *)ERROR_PTR(
"image not returned", procName, NULL);
283 PROCNAME(
"pixReadIndexed");
286 return (
PIX *)ERROR_PTR(
"sa not defined", procName, NULL);
288 if (index < 0 || index >= n)
289 return (
PIX *)ERROR_PTR(
"index out of bounds", procName, NULL);
292 if (fname[0] ==
'\0')
295 if ((pix =
pixRead(fname)) == NULL) {
296 L_ERROR(
"pix not read from file %s\n", procName, fname);
324 PROCNAME(
"pixReadStream");
327 return (
PIX *)ERROR_PTR(
"stream not defined", procName, NULL);
335 return (
PIX *)ERROR_PTR(
"bmp: no pix returned", procName, NULL);
340 return (
PIX *)ERROR_PTR(
"jpeg: no pix returned", procName, NULL);
341 ret = fgetJpegComment(fp, &comment);
349 return (
PIX *)ERROR_PTR(
"png: no pix returned", procName, NULL);
353 case IFF_TIFF_PACKBITS:
360 return (
PIX *)ERROR_PTR(
"tiff: no pix returned", procName, NULL);
365 return (
PIX *)ERROR_PTR(
"pnm: no pix returned", procName, NULL);
369 if ((pix = pixReadStreamGif(fp)) == NULL)
370 return (
PIX *)ERROR_PTR(
"gif: no pix returned", procName, NULL);
374 if ((pix = pixReadStreamJp2k(fp, 1, NULL, 0, 0)) == NULL)
375 return (
PIX *)ERROR_PTR(
"jp2: no pix returned", procName, NULL);
379 if ((pix = pixReadStreamWebP(fp)) == NULL)
380 return (
PIX *)ERROR_PTR(
"webp: no pix returned", procName, NULL);
384 L_ERROR(
"PostScript reading is not supported\n", procName);
388 L_ERROR(
"Pdf reading is not supported\n", procName);
393 return (
PIX *)ERROR_PTR(
"spix: no pix returned", procName, NULL);
397 return (
PIX *)ERROR_PTR(
"Unknown format: no pix returned",
403 pixSetInputFormat(pix, format);
439 l_int32 format, ret, w, h, d, bps, spp, iscmap;
444 PROCNAME(
"pixReadHeader");
450 if (piscmap) *piscmap = 0;
451 if (pformat) *pformat = 0;
454 return ERROR_INT(
"filename not defined", procName, 1);
457 return ERROR_INT(
"image file not found", procName, 1);
464 if ((pix =
pixRead(filename)) == NULL)
465 return ERROR_INT(
"bmp: pix not read", procName, 1);
467 if (pixGetColormap(pix))
470 bps = (d == 32) ? 8 : d;
471 spp = (d == 32) ? 3 : 1;
478 return ERROR_INT(
"jpeg: no header info returned", procName, 1);
484 return ERROR_INT(
"png: no header info returned", procName, 1);
488 case IFF_TIFF_PACKBITS:
495 ret =
readHeaderTiff(filename, 0, &w, &h, &bps, &spp, NULL, &iscmap,
498 return ERROR_INT(
"tiff: no header info returned", procName, 1);
502 ret =
readHeaderPnm(filename, &w, &h, &d, &type, &bps, &spp);
504 return ERROR_INT(
"pnm: no header info returned", procName, 1);
508 if ((pix =
pixRead(filename)) == NULL)
509 return ERROR_INT(
"gif: pix not read", procName, 1);
522 if (readHeaderWebP(filename, &w, &h, &spp))
523 return ERROR_INT(
"webp: no header info returned", procName, 1);
528 if (pformat) *pformat = format;
529 return ERROR_INT(
"PostScript reading is not supported\n", procName, 1);
532 if (pformat) *pformat = format;
533 return ERROR_INT(
"Pdf reading is not supported\n", procName, 1);
538 return ERROR_INT(
"spix: no header info returned", procName, 1);
542 L_ERROR(
"unknown format in file %s\n", procName, filename);
549 if (pbps) *pbps = bps;
550 if (pspp) *pspp = spp;
551 if (piscmap) *piscmap = iscmap;
552 if (pformat) *pformat = format;
574 PROCNAME(
"findFileFormat");
577 return ERROR_INT(
"&format not defined", procName, 1);
578 *pformat = IFF_UNKNOWN;
580 return ERROR_INT(
"filename not defined", procName, 1);
583 return ERROR_INT(
"image file not found", procName, 1);
606 l_uint8 firstbytes[12];
609 PROCNAME(
"findFileFormatStream");
612 return ERROR_INT(
"&format not defined", procName, 1);
613 *pformat = IFF_UNKNOWN;
615 return ERROR_INT(
"stream not defined", procName, 1);
619 return ERROR_INT(
"truncated file", procName, 1);
621 if (fread((
char *)&firstbytes, 1, 12, fp) != 12)
622 return ERROR_INT(
"failed to read first 12 bytes of file", procName, 1);
626 if (format == IFF_TIFF) {
631 if (format == IFF_UNKNOWN)
659 PROCNAME(
"findFileFormatBuffer");
662 return ERROR_INT(
"&format not defined", procName, 1);
663 *pformat = IFF_UNKNOWN;
665 return ERROR_INT(
"byte buffer not defined", procName, 0);
668 ((
char *)(&twobytepw))[0] = buf[0];
669 ((
char *)(&twobytepw))[1] = buf[1];
671 if (convertOnBigEnd16(twobytepw) ==
BMP_ID) {
682 if ((buf[0] ==
'P' && buf[1] ==
'4') ||
683 (buf[0] ==
'P' && buf[1] ==
'1')) {
688 if ((buf[0] ==
'P' && buf[1] ==
'5') ||
689 (buf[0] ==
'P' && buf[1] ==
'2')) {
694 if ((buf[0] ==
'P' && buf[1] ==
'6') ||
695 (buf[0] ==
'P' && buf[1] ==
'3')) {
700 if (buf[0] ==
'P' && buf[1] ==
'7') {
716 if (buf[0] == 0xff && buf[1] == 0xd8) {
717 *pformat = IFF_JFIF_JPEG;
723 if (buf[0] == 137 && buf[1] == 80 && buf[2] == 78 && buf[3] == 71 &&
724 buf[4] == 13 && buf[5] == 10 && buf[6] == 26 && buf[7] == 10) {
730 if (buf[0] ==
'G' && buf[1] ==
'I' && buf[2] ==
'F' && buf[3] ==
'8' &&
731 (buf[4] ==
'7' || buf[4] ==
'9') && buf[5] ==
'a') {
737 if (strncmp((
const char *)buf, (
char *)JP2K_CODESTREAM, 4) == 0 ||
738 strncmp((
const char *)buf, (
char *)JP2K_IMAGE_DATA, 12) == 0) {
744 if (buf[0] ==
'R' && buf[1] ==
'I' && buf[2] ==
'F' && buf[3] ==
'F' &&
745 buf[8] ==
'W' && buf[9] ==
'E' && buf[10] ==
'B' && buf[11] ==
'P') {
751 if (buf[0] ==
'%' && buf[1] ==
'!' && buf[2] ==
'P' && buf[3] ==
'S' &&
752 buf[4] ==
'-' && buf[5] ==
'A' && buf[6] ==
'd' && buf[7] ==
'o' &&
753 buf[8] ==
'b' && buf[9] ==
'e') {
759 if (buf[0] ==
'%' && buf[1] ==
'P' && buf[2] ==
'D' && buf[3] ==
'F' &&
760 buf[4] ==
'-' && buf[5] ==
'1') {
766 if (buf[0] ==
's' && buf[1] ==
'p' && buf[2] ==
'i' && buf[3] ==
'x') {
787 PROCNAME(
"fileFormatIsTiff");
790 return ERROR_INT(
"stream not defined", procName, 0);
793 if (format == IFF_TIFF || format == IFF_TIFF_PACKBITS ||
794 format == IFF_TIFF_RLE || format == IFF_TIFF_G3 ||
795 format == IFF_TIFF_G4 || format == IFF_TIFF_LZW ||
796 format == IFF_TIFF_ZIP)
833 PROCNAME(
"pixReadMem");
836 return (
PIX *)ERROR_PTR(
"data not defined", procName, NULL);
838 return (
PIX *)ERROR_PTR(
"size < 12", procName, NULL);
846 return (
PIX *)ERROR_PTR(
"bmp: no pix returned", procName, NULL);
851 return (
PIX *)ERROR_PTR(
"jpeg: no pix returned", procName, NULL);
856 return (
PIX *)ERROR_PTR(
"png: no pix returned", procName, NULL);
860 case IFF_TIFF_PACKBITS:
868 return (
PIX *)ERROR_PTR(
"tiff: no pix returned", procName, NULL);
873 return (
PIX *)ERROR_PTR(
"pnm: no pix returned", procName, NULL);
877 if ((pix = pixReadMemGif(data, size)) == NULL)
878 return (
PIX *)ERROR_PTR(
"gif: no pix returned", procName, NULL);
882 if ((pix = pixReadMemJp2k(data, size, 1, NULL, 0, 0)) == NULL)
883 return (
PIX *)ERROR_PTR(
"jp2k: no pix returned", procName, NULL);
887 if ((pix = pixReadMemWebP(data, size)) == NULL)
888 return (
PIX *)ERROR_PTR(
"webp: no pix returned", procName, NULL);
892 L_ERROR(
"PostScript reading is not supported\n", procName);
896 L_ERROR(
"Pdf reading is not supported\n", procName);
901 return (
PIX *)ERROR_PTR(
"spix: no pix returned", procName, NULL);
905 return (
PIX *)ERROR_PTR(
"Unknown format: no pix returned",
913 if (format == IFF_TIFF && pixGetDepth(pix) == 1)
914 format = IFF_TIFF_G4;
915 pixSetInputFormat(pix, format);
957 l_int32 format, ret, w, h, d, bps, spp, iscmap;
961 PROCNAME(
"pixReadHeaderMem");
967 if (piscmap) *piscmap = 0;
968 if (pformat) *pformat = 0;
971 return ERROR_INT(
"data not defined", procName, 1);
973 return ERROR_INT(
"size < 8", procName, 1);
981 return ERROR_INT(
"bmp: pix not read", procName, 1);
984 bps = (d == 32) ? 8 : d;
985 spp = (d == 32) ? 3 : 1;
992 return ERROR_INT(
"jpeg: no header info returned", procName, 1);
998 return ERROR_INT(
"png: no header info returned", procName, 1);
1002 case IFF_TIFF_PACKBITS:
1010 NULL, &iscmap, &format);
1012 return ERROR_INT(
"tiff: no header info returned", procName, 1);
1018 return ERROR_INT(
"pnm: no header info returned", procName, 1);
1022 if ((pix = pixReadMemGif(data, size)) == NULL)
1023 return ERROR_INT(
"gif: pix not read", procName, 1);
1037 ret = readHeaderMemWebP(data, size, &w, &h, &spp);
1041 if (pformat) *pformat = format;
1042 return ERROR_INT(
"PostScript reading is not supported\n", procName, 1);
1045 if (pformat) *pformat = format;
1046 return ERROR_INT(
"Pdf reading is not supported\n", procName, 1);
1052 return ERROR_INT(
"pnm: no header info returned", procName, 1);
1056 return ERROR_INT(
"unknown format; no data returned", procName, 1);
1062 if (pbps) *pbps = bps;
1063 if (pspp) *pspp = spp;
1064 if (piscmap) *piscmap = iscmap;
1065 if (pformat) *pformat = format;
1073 extern const char *ImageFileFormatExtensions[];
1099 l_int32 w, h, d, wpl, count, npages, color;
1100 l_int32 format, bps, spp, iscmap, xres, yres, transparency;
1105 PROCNAME(
"writeImageFileInfo");
1108 return ERROR_INT(
"filename not defined", procName, 1);
1110 return ERROR_INT(
"stream not defined", procName, 1);
1113 if (
pixReadHeader(filename, &format, &w, &h, &bps, &spp, &iscmap)) {
1114 L_ERROR(
"failure to read header of %s\n", procName, filename);
1117 fprintf(fpout,
"===============================================\n" 1118 "Reading the header:\n");
1119 fprintf(fpout,
" input image format type: %s\n",
1120 ImageFileFormatExtensions[format]);
1121 fprintf(fpout,
" w = %d, h = %d, bps = %d, spp = %d, iscmap = %d\n",
1122 w, h, bps, spp, iscmap);
1125 if (format == IFF_JP2) {
1127 fgetJp2kResolution(fpin, &xres, &yres);
1129 fprintf(fpout,
" xres = %d, yres = %d\n", xres, yres);
1130 }
else if (format == IFF_PNG) {
1132 fgetPngResolution(fpin, &xres, &yres);
1134 fprintf(fpout,
" xres = %d, yres = %d\n", xres, yres);
1137 fgetPngColormapInfo(fpin, &cmap, &transparency);
1140 fprintf(fpout,
" colormap has transparency\n");
1142 fprintf(fpout,
" colormap does not have transparency\n");
1146 }
else if (format == IFF_JFIF_JPEG) {
1148 fgetJpegResolution(fpin, &xres, &yres);
1150 fprintf(fpout,
" xres = %d, yres = %d\n", xres, yres);
1158 fprintf(fpout,
"===============================================\n" 1159 "Reading the full image:\n");
1162 if (format == IFF_PNG && bps == 16)
1165 if ((pix =
pixRead(filename)) == NULL) {
1166 L_ERROR(
"failure to read full image of %s\n", procName, filename);
1170 format = pixGetInputFormat(pix);
1172 wpl = pixGetWpl(pix);
1173 spp = pixGetSpp(pix);
1174 fprintf(fpout,
" input image format type: %s\n",
1175 ImageFileFormatExtensions[format]);
1176 fprintf(fpout,
" w = %d, h = %d, d = %d, spp = %d, wpl = %d\n",
1178 fprintf(fpout,
" xres = %d, yres = %d\n",
1179 pixGetXRes(pix), pixGetYRes(pix));
1183 fprintf(fpout,
" text: %s\n", text);
1185 cmap = pixGetColormap(pix);
1189 fprintf(fpout,
" colormap exists and has color values:");
1191 fprintf(fpout,
" colormap exists and has only gray values:");
1195 fprintf(fpout,
" colormap does not exist\n");
1197 if (format == IFF_TIFF || format == IFF_TIFF_G4 ||
1198 format == IFF_TIFF_G3 || format == IFF_TIFF_PACKBITS) {
1199 fprintf(fpout,
" Tiff header information:\n");
1204 fprintf(fpout,
" One page in file\n");
1206 fprintf(fpout,
" %d pages in file\n", npages);
1213 fprintf(fpout,
" 1 bpp: foreground pixel fraction ON/Total = %g\n",
1214 (l_float32)count / (l_float32)(w * h));
1216 fprintf(fpout,
"===============================================\n");
1222 if (pixGetSpp(pix) == 4) {
1224 pixDisplay(pixt, 100, 100);
1228 if (format == IFF_PNG && bps == 16)
1264 l_int32 w, h, d, depth, equal, problems;
1267 PIX *pixs, *pixc, *pix1, *pix2;
1270 PROCNAME(
"ioFormatTest");
1273 return ERROR_INT(
"filename not defined", procName, 1);
1276 if ((pix1 =
pixRead(filename)) == NULL)
1277 return ERROR_INT(
"pix1 not made", procName, 1);
1279 if (w > 250 && h > 250) {
1280 box =
boxCreate(w / 2 - 125, h / 2 - 125, 250, 250);
1299 if (pixGetSpp(pixc) == 4)
1301 cmap = pixGetColormap(pixc);
1302 d = pixGetDepth(pixc);
1313 if (d == 1 || d == 8) {
1314 L_INFO(
"write/read bmp\n", procName);
1315 pixWrite(FILE_BMP, pixc, IFF_BMP);
1323 L_INFO(
" **** bad bmp image: d = %d ****\n", procName, d);
1330 if (d == 2 || d == 4 || d == 32) {
1331 L_INFO(
"write/read bmp\n", procName);
1332 pixWrite(FILE_BMP, pixc, IFF_BMP);
1336 L_INFO(
" **** bad bmp image: d = %d ****\n", procName, d);
1347 L_INFO(
"write/read png\n", procName);
1348 pixWrite(FILE_PNG, pixc, IFF_PNG);
1352 L_INFO(
" **** bad png image: d = %d ****\n", procName, d);
1371 L_INFO(
"write/read uncompressed tiff\n", procName);
1372 pixWrite(FILE_TIFF, pixc, IFF_TIFF);
1376 L_INFO(
" **** bad tiff uncompressed image: d = %d ****\n",
1383 L_INFO(
"write/read lzw compressed tiff\n", procName);
1384 pixWrite(FILE_LZW, pixc, IFF_TIFF_LZW);
1388 L_INFO(
" **** bad tiff lzw compressed image: d = %d ****\n",
1395 L_INFO(
"write/read zip compressed tiff\n", procName);
1396 pixWrite(FILE_ZIP, pixc, IFF_TIFF_ZIP);
1400 L_INFO(
" **** bad tiff zip compressed image: d = %d ****\n",
1408 L_INFO(
"write/read g4 compressed tiff\n", procName);
1409 pixWrite(FILE_G4, pixc, IFF_TIFF_G4);
1413 L_INFO(
" **** bad tiff g4 image ****\n", procName);
1418 L_INFO(
"write/read g3 compressed tiff\n", procName);
1419 pixWrite(FILE_G3, pixc, IFF_TIFF_G3);
1423 L_INFO(
" **** bad tiff g3 image ****\n", procName);
1428 L_INFO(
"write/read rle compressed tiff\n", procName);
1429 pixWrite(FILE_RLE, pixc, IFF_TIFF_RLE);
1433 L_INFO(
" **** bad tiff rle image: d = %d ****\n", procName, d);
1438 L_INFO(
"write/read packbits compressed tiff\n", procName);
1439 pixWrite(FILE_PB, pixc, IFF_TIFF_PACKBITS);
1443 L_INFO(
" **** bad tiff packbits image: d = %d ****\n",
1457 L_INFO(
"write/read pnm\n", procName);
1458 pixWrite(FILE_PNM, pixc, IFF_PNM);
1466 L_INFO(
" **** bad pnm image: d = %d ****\n", procName, d);
1475 if (d != 8 || !cmap)
1479 L_INFO(
"write/read gif\n", procName);
1480 pixWrite(FILE_GIF, pix1, IFF_GIF);
1484 L_INFO(
" **** bad gif image: d = %d ****\n", procName, d);
1498 depth = pixGetDepth(pix1);
1499 L_INFO(
"write/read jpeg\n", procName);
1500 pixWrite(FILE_JPG, pix1, IFF_JFIF_JPEG);
1506 pixCompareRGB(pix1, pix2, L_COMPARE_ABS_DIFF, 0, NULL, &diff,
1510 L_INFO(
" **** bad jpeg image: d = %d, diff = %5.2f ****\n",
1511 procName, depth, diff);
1521 if (cmap || d <= 16)
1525 depth = pixGetDepth(pix1);
1526 L_INFO(
"write/read webp\n", procName);
1527 pixWrite(FILE_WEBP, pix1, IFF_WEBP);
1529 pixCompareRGB(pix1, pix2, L_COMPARE_ABS_DIFF, 0, NULL, &diff, NULL, NULL);
1531 L_INFO(
" **** bad webp image: d = %d, diff = %5.2f ****\n",
1532 procName, depth, diff);
1546 depth = pixGetDepth(pix1);
1547 L_INFO(
"write/read jp2k\n", procName);
1548 pixWrite(FILE_JP2K, pix1, IFF_JP2);
1554 pixCompareRGB(pix1, pix2, L_COMPARE_ABS_DIFF, 0, NULL, &diff,
1557 fprintf(stderr,
"diff = %7.3f\n", diff);
1559 L_INFO(
" **** bad jp2k image: d = %d, diff = %5.2f ****\n",
1560 procName, depth, diff);
1567 if (problems == FALSE)
1568 L_INFO(
"All formats read and written OK!\n", procName);
l_int32 pixCompareRGB(PIX *pix1, PIX *pix2, l_int32 comptype, l_int32 plottype, l_int32 *psame, l_float32 *pdiff, l_float32 *prmsdiff, PIX **ppixdiff)
pixCompareRGB()
PIX * pixRemoveColormap(PIX *pixs, l_int32 type)
pixRemoveColormap()
PIX * pixReadStreamTiff(FILE *fp, l_int32 n)
pixReadStreamTiff()
l_int32 lept_mkdir(const char *subdir)
lept_mkdir()
PIX * pixReadMemSpix(const l_uint8 *data, size_t size)
pixReadMemSpix()
PIX * pixReadStreamPng(FILE *fp)
pixReadStreamPng()
PIX * pixConvertTo32(PIX *pixs)
pixConvertTo32()
l_int32 findFileFormatStream(FILE *fp, l_int32 *pformat)
findFileFormatStream()
l_int32 readHeaderPng(const char *filename, l_int32 *pw, l_int32 *ph, l_int32 *pbps, l_int32 *pspp, l_int32 *piscmap)
readHeaderPng()
l_int32 writeImageFileInfo(const char *filename, FILE *fpout, l_int32 headeronly)
writeImageFileInfo()
PIXA * pixaReadFiles(const char *dirname, const char *substr)
pixaReadFiles()
PIX * pixReadStreamBmp(FILE *fp)
pixReadStreamBmp()
PIXA * pixaCreate(l_int32 n)
pixaCreate()
PIX * pixReadIndexed(SARRAY *sa, l_int32 index)
pixReadIndexed()
PIX * pixConvertTo8(PIX *pixs, l_int32 cmapflag)
pixConvertTo8()
PIX * pixReadMemBmp(const l_uint8 *cdata, size_t size)
pixReadMemBmp()
l_int32 pixReadHeaderMem(const l_uint8 *data, size_t size, l_int32 *pformat, l_int32 *pw, l_int32 *ph, l_int32 *pbps, l_int32 *pspp, l_int32 *piscmap)
pixReadHeaderMem()
void pixcmapDestroy(PIXCMAP **pcmap)
pixcmapDestroy()
PIX * pixReadMemPnm(const l_uint8 *data, size_t size)
pixReadMemPnm()
void l_pngSetReadStrip16To8(l_int32 flag)
l_pngSetReadStrip16To8()
l_int32 readHeaderMemPnm(const l_uint8 *data, size_t size, l_int32 *pw, l_int32 *ph, l_int32 *pd, l_int32 *ptype, l_int32 *pbps, l_int32 *pspp)
readHeaderMemPnm()
PIX * pixReadMem(const l_uint8 *data, size_t size)
pixReadMem()
PIX * pixClipRectangle(PIX *pixs, BOX *box, BOX **pboxc)
pixClipRectangle()
l_int32 findFileFormat(const char *filename, l_int32 *pformat)
findFileFormat()
l_int32 readHeaderTiff(const char *filename, l_int32 n, l_int32 *pwidth, l_int32 *pheight, l_int32 *pbps, l_int32 *pspp, l_int32 *pres, l_int32 *pcmap, l_int32 *pformat)
readHeaderTiff()
l_int32 lept_fclose(FILE *fp)
lept_fclose()
PIX * pixReadStreamPnm(FILE *fp)
pixReadStreamPnm()
PIX * pixReadMemJpeg(const l_uint8 *data, size_t size, l_int32 cmflag, l_int32 reduction, l_int32 *pnwarn, l_int32 hint)
pixReadMemJpeg()
l_int32 fprintTiffInfo(FILE *fpout, const char *tiffile)
fprintTiffInfo()
l_int32 pixcmapWriteStream(FILE *fp, PIXCMAP *cmap)
pixcmapWriteStream()
static const l_int32 L_INSERT
l_int32 tiffGetCount(FILE *fp, l_int32 *pn)
tiffGetCount()
l_int32 pixaAddPix(PIXA *pixa, PIX *pix, l_int32 copyflag)
pixaAddPix()
l_int32 pixReadHeader(const char *filename, l_int32 *pformat, l_int32 *pw, l_int32 *ph, l_int32 *pbps, l_int32 *pspp, l_int32 *piscmap)
pixReadHeader()
PIX * pixReadStreamJpeg(FILE *fp, l_int32 cmapflag, l_int32 reduction, l_int32 *pnwarn, l_int32 hint)
pixReadStreamJpeg()
l_int32 readHeaderJpeg(const char *filename, l_int32 *pw, l_int32 *ph, l_int32 *pspp, l_int32 *pycck, l_int32 *pcmyk)
readHeaderJpeg()
size_t fnbytesInFile(FILE *fp)
fnbytesInFile()
PIX * pixReadStreamSpix(FILE *fp)
pixReadStreamSpix()
char * sarrayGetString(SARRAY *sa, l_int32 index, l_int32 copyflag)
sarrayGetString()
l_int32 ioFormatTest(const char *filename)
ioFormatTest()
PIX * pixClone(PIX *pixs)
pixClone()
l_int32 readHeaderPnm(const char *filename, l_int32 *pw, l_int32 *ph, l_int32 *pd, l_int32 *ptype, l_int32 *pbps, l_int32 *pspp)
readHeaderPnm()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixReadStream(FILE *fp, l_int32 hint)
pixReadStream()
SARRAY * getSortedPathnamesInDirectory(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
getSortedPathnamesInDirectory()
PIX * pixReadMemTiff(const l_uint8 *cdata, size_t size, l_int32 n)
pixReadMemTiff()
PIXA * pixaReadFilesSA(SARRAY *sa)
pixaReadFilesSA()
l_int32 readHeaderSpix(const char *filename, l_int32 *pwidth, l_int32 *pheight, l_int32 *pbps, l_int32 *pspp, l_int32 *piscmap)
readHeaderSpix()
l_int32 fileFormatIsTiff(FILE *fp)
fileFormatIsTiff()
l_int32 findTiffCompression(FILE *fp, l_int32 *pcomptype)
findTiffCompression()
FILE * fopenReadStream(const char *filename)
fopenReadStream()
l_int32 sarrayGetCount(SARRAY *sa)
sarrayGetCount()
PIX * pixRead(const char *filename)
pixRead()
FILE * lept_fopen(const char *filename, const char *mode)
lept_fopen()
char * pixGetText(PIX *pix)
pixGetText()
l_int32 pixEqual(PIX *pix1, PIX *pix2, l_int32 *psame)
pixEqual()
PIX * pixReadWithHint(const char *filename, l_int32 hint)
pixReadWithHint()
PIX * pixDisplayLayersRGBA(PIX *pixs, l_uint32 val, l_int32 maxw)
pixDisplayLayersRGBA()
l_int32 findFileFormatBuffer(const l_uint8 *buf, l_int32 *pformat)
findFileFormatBuffer()
l_int32 readHeaderMemTiff(const l_uint8 *cdata, size_t size, l_int32 n, l_int32 *pwidth, l_int32 *pheight, l_int32 *pbps, l_int32 *pspp, l_int32 *pres, l_int32 *pcmap, l_int32 *pformat)
readHeaderMemTiff()
l_int32 sreadHeaderSpix(const l_uint32 *data, l_int32 *pwidth, l_int32 *pheight, l_int32 *pbps, l_int32 *pspp, l_int32 *piscmap)
sreadHeaderSpix()
void boxDestroy(BOX **pbox)
boxDestroy()
PIX * pixReadMemPng(const l_uint8 *filedata, size_t filesize)
pixReadMemPng()
l_int32 pixGetDimensions(PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
l_int32 readHeaderMemPng(const l_uint8 *data, size_t size, l_int32 *pw, l_int32 *ph, l_int32 *pbps, l_int32 *pspp, l_int32 *piscmap)
readHeaderMemPng()
l_int32 pixCountPixels(PIX *pixs, l_int32 *pcount, l_int32 *tab8)
pixCountPixels()
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
l_int32 pixCompareGray(PIX *pix1, PIX *pix2, l_int32 comptype, l_int32 plottype, l_int32 *psame, l_float32 *pdiff, l_float32 *prmsdiff, PIX **ppixdiff)
pixCompareGray()
l_int32 pixSetText(PIX *pix, const char *textstring)
pixSetText()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()
l_int32 pixcmapHasColor(PIXCMAP *cmap, l_int32 *pcolor)
pixcmapHasColor()
l_int32 readHeaderMemJpeg(const l_uint8 *data, size_t size, l_int32 *pw, l_int32 *ph, l_int32 *pspp, l_int32 *pycck, l_int32 *pcmyk)
readHeaderMemJpeg()