93 #include "allheaders.h" 100 static l_int32 var_PS_WRITE_BOUNDING_BOX = 1;
103 static const l_int32 DEFAULT_INPUT_RES = 300;
104 static const l_int32 MIN_RES = 5;
105 static const l_int32 MAX_RES = 3000;
108 static const l_int32 LETTER_WIDTH = 612;
109 static const l_int32 LETTER_HEIGHT = 792;
110 static const l_int32 A4_WIDTH = 595;
111 static const l_int32 A4_HEIGHT = 842;
112 static const l_float32 DEFAULT_FILL_FRACTION = 0.95;
114 #ifndef NO_CONSOLE_IO 117 #define DEBUG_FLATE 0 160 PROCNAME(
"pixWritePSEmbed");
163 return ERROR_INT(
"filein not defined", procName, 1);
165 return ERROR_INT(
"fileout not defined", procName, 1);
167 if ((pix =
pixRead(filein)) == NULL)
168 return ERROR_INT(
"image not read from file", procName, 1);
169 w = pixGetWidth(pix);
170 h = pixGetHeight(pix);
171 if (w * 11.0 > h * 8.5)
172 scale = 8.5 * 300. / (l_float32)w;
174 scale = 11.0 * 300. / (l_float32)h;
177 return ERROR_INT(
"file not opened for write", procName, 1);
215 PROCNAME(
"pixWriteStreamPS");
218 return (l_int32)ERROR_INT(
"stream not open", procName, 1);
220 return (l_int32)ERROR_INT(
"pix not defined", procName, 1);
223 return (l_int32)ERROR_INT(
"pixc not made", procName, 1);
226 length = strlen(outstr);
227 fwrite(outstr, 1, length, fp);
309 char *hexdata, *outstr;
311 l_int32 i, j, k, w, h, d;
312 l_float32 wpt, hpt, xpt, ypt;
313 l_int32 wpl, psbpl, hexbytes, boxflag, bps;
314 l_uint32 *line, *data;
317 PROCNAME(
"pixWriteStringPS");
320 return (
char *)ERROR_PTR(
"pixs not defined", procName, NULL);
323 return (
char *)ERROR_PTR(
"pix not made", procName, NULL);
343 wpl = pixGetWpl(pix);
344 if (d == 1 || d == 8)
345 psbpl = (w * d + 7) / 8;
349 hexbytes = 2 * psbpl * h;
350 if ((hexdata = (
char *)LEPT_CALLOC(hexbytes + 1,
sizeof(
char))) == NULL)
351 return (
char *)ERROR_PTR(
"hexdata not made", procName, NULL);
352 if (d == 1 || d == 8) {
353 for (i = 0, k = 0; i < h; i++) {
354 line = data + i * wpl;
355 for (j = 0; j < psbpl; j++) {
363 for (i = 0, k = 0; i < h; i++) {
364 line = data + i * wpl;
365 for (j = 0; j < w; j++) {
384 xpt, ypt, wpt, hpt, boxflag);
386 return (
char *)ERROR_PTR(
"outstr not made", procName, NULL);
429 PROCNAME(
"generateUncompressedPS");
432 return (
char *)ERROR_PTR(
"hexdata not defined", procName, NULL);
435 return (
char *)ERROR_PTR(
"sa not made", procName, NULL);
438 snprintf(bigbuf,
sizeof(bigbuf),
439 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
440 xpt, ypt, xpt + wpt, ypt + hpt);
448 "{1 exch sub} settransfer %invert binary",
L_COPY);
450 snprintf(bigbuf,
sizeof(bigbuf),
451 "/bpl %d string def %%bpl as a string", psbpl);
453 snprintf(bigbuf,
sizeof(bigbuf),
454 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
456 snprintf(bigbuf,
sizeof(bigbuf),
457 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
459 snprintf(bigbuf,
sizeof(bigbuf),
460 "%d %d %d %%image dimensions in pixels", w, h, bps);
462 snprintf(bigbuf,
sizeof(bigbuf),
463 "[%d %d %d %d %d %d] %%mapping matrix: [w 0 0 -h 0 h]",
468 if (d == 1 || d == 8)
470 "{currentfile bpl readhexstring pop} image",
L_COPY);
473 "{currentfile bpl readhexstring pop} false 3 colorimage",
476 if (d == 1 || d == 8)
478 "{currentfile bpl readhexstring pop} bind image",
L_COPY);
481 "{currentfile bpl readhexstring pop} bind false 3 colorimage",
494 if (!outstr) L_ERROR(
"outstr not made\n", procName);
532 l_int32 bx, by, bw, bh;
533 l_float32 winch, hinch, xinch, yinch, fres;
535 PROCNAME(
"getScaledParametersPS");
538 res = DEFAULT_INPUT_RES;
539 fres = (l_float32)res;
545 fres = (l_float32)res / scale;
550 if (res < MIN_RES || res > MAX_RES) {
551 L_WARNING(
"res %d out of bounds; using default res; no scaling\n",
553 res = DEFAULT_INPUT_RES;
554 fres = (l_float32)res;
558 winch = (l_float32)wpix / fres;
559 hinch = (l_float32)hpix / fres;
560 xinch = (8.5 - winch) / 2.;
561 yinch = (11.0 - hinch) / 2.;
565 winch = (l_float32)wpix / fres;
567 winch = (l_float32)bw / 1000.;
569 hinch = (l_float32)hpix / fres;
571 hinch = (l_float32)bh / 1000.;
572 xinch = (l_float32)bx / 1000.;
573 yinch = (l_float32)by / 1000.;
577 L_WARNING(
"left edge < 0.0 inch\n", procName);
578 if (xinch + winch > 8.5)
579 L_WARNING(
"right edge > 8.5 inch\n", procName);
581 L_WARNING(
"bottom edge < 0.0 inch\n", procName);
582 if (yinch + hinch > 11.0)
583 L_WARNING(
"top edge > 11.0 inch\n", procName);
611 *pnib1 =
'a' + (nib - 10);
616 *pnib2 =
'a' + (nib - 10);
647 l_int32 w, h, nbytes, ret;
648 l_float32 xpt, ypt, wpt, hpt;
651 PROCNAME(
"convertJpegToPSEmbed");
654 return ERROR_INT(
"filein not defined", procName, 1);
656 return ERROR_INT(
"fileout not defined", procName, 1);
660 return ERROR_INT(
"jpeg data not made", procName, 1);
668 if (w * 11.0 > h * 8.5) {
670 hpt = wpt * (l_float32)h / (l_float32)w;
673 wpt = hpt * (l_float32)w / (l_float32)h;
681 return ERROR_INT(
"outstr not made", procName, 1);
682 nbytes = strlen(outstr);
686 if (ret) L_ERROR(
"ps string not written to file\n", procName);
760 const char *operation,
771 PROCNAME(
"convertJpegToPS");
774 return ERROR_INT(
"filein not defined", procName, 1);
776 return ERROR_INT(
"fileout not defined", procName, 1);
777 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
778 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
782 return ERROR_INT(
"ps string not made", procName, 1);
785 return ERROR_INT(
"ps string not written to file", procName, 1);
828 l_float32 xpt, ypt, wpt, hpt;
831 PROCNAME(
"convertJpegToPSString");
834 return ERROR_INT(
"&outstr not defined", procName, 1);
836 return ERROR_INT(
"&nbytes not defined", procName, 1);
840 return ERROR_INT(
"filein not defined", procName, 1);
844 return ERROR_INT(
"jpeg data not made", procName, 1);
855 res = DEFAULT_INPUT_RES;
861 xpt = scale * x * 72. / res;
862 ypt = scale * y * 72. / res;
863 wpt = scale * cid->
w * 72. / res;
864 hpt = scale * cid->
h * 72. / res;
870 fprintf(stderr,
"w = %d, h = %d, bps = %d, spp = %d\n",
871 cid->
w, cid->
h, cid->
bps, cid->
spp);
872 fprintf(stderr,
"comp bytes = %ld, nbytes85 = %ld, ratio = %5.3f\n",
875 fprintf(stderr,
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
880 outstr =
generateJpegPS(NULL, cid, xpt, ypt, wpt, hpt, pageno, endpage);
882 return ERROR_INT(
"outstr not made", procName, 1);
884 *pnbytes = strlen(outstr);
920 l_int32 w, h, bps, spp;
925 PROCNAME(
"generateJpegPS");
928 return (
char *)ERROR_PTR(
"jpeg data not defined", procName, NULL);
935 return (
char *)ERROR_PTR(
"sa not made", procName, NULL);
940 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
942 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: Jpeg compressed PS");
946 if (var_PS_WRITE_BOUNDING_BOX == 1) {
947 snprintf(bigbuf,
sizeof(bigbuf),
948 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
949 xpt, ypt, xpt + wpt, ypt + hpt);
955 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
960 "/RawData currentfile /ASCII85Decode filter def",
L_COPY);
963 snprintf(bigbuf,
sizeof(bigbuf),
964 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
967 snprintf(bigbuf,
sizeof(bigbuf),
968 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
979 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
981 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
983 snprintf(bigbuf,
sizeof(bigbuf),
984 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
987 snprintf(bigbuf,
sizeof(bigbuf),
" /BitsPerComponent %d", bps);
1000 if (endpage == TRUE)
1040 const char *fileout)
1043 l_int32 w, h, nbytes, ret;
1044 l_float32 xpt, ypt, wpt, hpt;
1047 PROCNAME(
"convertG4ToPSEmbed");
1050 return ERROR_INT(
"filein not defined", procName, 1);
1052 return ERROR_INT(
"fileout not defined", procName, 1);
1055 return ERROR_INT(
"g4 data not made", procName, 1);
1063 if (w * 11.0 > h * 8.5) {
1065 hpt = wpt * (l_float32)h / (l_float32)w;
1068 wpt = hpt * (l_float32)w / (l_float32)h;
1073 outstr =
generateG4PS(NULL, cid, xpt, ypt, wpt, hpt, 1, 1, 1);
1076 return ERROR_INT(
"outstr not made", procName, 1);
1077 nbytes = strlen(outstr);
1081 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1146 const char *fileout,
1147 const char *operation,
1159 PROCNAME(
"convertG4ToPS");
1162 return ERROR_INT(
"filein not defined", procName, 1);
1164 return ERROR_INT(
"fileout not defined", procName, 1);
1165 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
1166 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
1169 pageno, maskflag, endpage))
1170 return ERROR_INT(
"ps string not made", procName, 1);
1173 return ERROR_INT(
"ps string not written to file", procName, 1);
1220 l_float32 xpt, ypt, wpt, hpt;
1223 PROCNAME(
"convertG4ToPSString");
1226 return ERROR_INT(
"&outstr not defined", procName, 1);
1228 return ERROR_INT(
"&nbytes not defined", procName, 1);
1232 return ERROR_INT(
"filein not defined", procName, 1);
1235 return ERROR_INT(
"g4 data not made", procName, 1);
1252 xpt = scale * x * 72. / res;
1253 ypt = scale * y * 72. / res;
1254 wpt = scale * cid->
w * 72. / res;
1255 hpt = scale * cid->
h * 72. / res;
1261 fprintf(stderr,
"w = %d, h = %d, minisblack = %d\n",
1263 fprintf(stderr,
"comp bytes = %ld, nbytes85 = %ld\n",
1265 fprintf(stderr,
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
1266 xpt, ypt, wpt, hpt);
1271 maskflag, pageno, endpage);
1273 return ERROR_INT(
"outstr not made", procName, 1);
1275 *pnbytes = strlen(outstr);
1319 PROCNAME(
"generateG4PS");
1322 return (
char *)ERROR_PTR(
"g4 data not defined", procName, NULL);
1327 return (
char *)ERROR_PTR(
"sa not made", procName, NULL);
1332 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
1334 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: G4 compressed PS");
1338 if (var_PS_WRITE_BOUNDING_BOX == 1) {
1339 snprintf(bigbuf,
sizeof(bigbuf),
1340 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
1341 xpt, ypt, xpt + wpt, ypt + hpt);
1347 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
1353 snprintf(bigbuf,
sizeof(bigbuf),
1354 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1357 snprintf(bigbuf,
sizeof(bigbuf),
1358 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1365 " /RawData currentfile /ASCII85Decode filter def",
L_COPY);
1368 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1370 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1372 snprintf(bigbuf,
sizeof(bigbuf),
1373 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1384 snprintf(bigbuf,
sizeof(bigbuf),
" /Columns %d", w);
1386 snprintf(bigbuf,
sizeof(bigbuf),
" /Rows %d", h);
1389 if (maskflag == TRUE)
1394 if (endpage == TRUE)
1439 const char *fileout,
1440 l_float32 fillfract)
1443 l_int32 i, npages, w, h, istiff;
1448 PROCNAME(
"convertTiffMultipageToPS");
1451 return ERROR_INT(
"filein not defined", procName, 1);
1453 return ERROR_INT(
"fileout not defined", procName, 1);
1456 return ERROR_INT(
"file not found", procName, 1);
1460 return ERROR_INT(
"file not tiff format", procName, 1);
1465 if (fillfract == 0.0)
1466 fillfract = DEFAULT_FILL_FRACTION;
1468 for (i = 0; i < npages; i++) {
1470 return ERROR_INT(
"pix not made", procName, 1);
1473 if (w == 1728 && h < w)
1479 pixWrite(tempfile, pixs, IFF_TIFF_G4);
1480 scale = L_MIN(fillfract * 2550 / w, fillfract * 3300 / h);
1483 i + 1, FALSE, TRUE);
1486 i + 1, FALSE, TRUE);
1488 LEPT_FREE(tempfile);
1519 const char *fileout)
1522 l_int32 w, h, nbytes, ret;
1523 l_float32 xpt, ypt, wpt, hpt;
1526 PROCNAME(
"convertFlateToPSEmbed");
1529 return ERROR_INT(
"filein not defined", procName, 1);
1531 return ERROR_INT(
"fileout not defined", procName, 1);
1534 return ERROR_INT(
"flate data not made", procName, 1);
1542 if (w * 11.0 > h * 8.5) {
1544 hpt = wpt * (l_float32)h / (l_float32)w;
1547 wpt = hpt * (l_float32)w / (l_float32)h;
1555 return ERROR_INT(
"outstr not made", procName, 1);
1556 nbytes = strlen(outstr);
1560 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1632 const char *fileout,
1633 const char *operation,
1642 l_int32 nbytes, ret;
1644 PROCNAME(
"convertFlateToPS");
1647 return ERROR_INT(
"filein not defined", procName, 1);
1649 return ERROR_INT(
"fileout not defined", procName, 1);
1650 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
1651 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
1655 return ERROR_INT(
"ps string not made", procName, 1);
1659 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1708 l_float32 xpt, ypt, wpt, hpt;
1711 PROCNAME(
"convertFlateToPSString");
1714 return ERROR_INT(
"&outstr not defined", procName, 1);
1716 return ERROR_INT(
"&nbytes not defined", procName, 1);
1720 return ERROR_INT(
"filein not defined", procName, 1);
1723 return ERROR_INT(
"flate data not made", procName, 1);
1734 res = DEFAULT_INPUT_RES;
1736 xpt = scale * x * 72. / res;
1737 ypt = scale * y * 72. / res;
1738 wpt = scale * cid->
w * 72. / res;
1739 hpt = scale * cid->
h * 72. / res;
1745 fprintf(stderr,
"w = %d, h = %d, bps = %d, spp = %d\n",
1746 cid->
w, cid->
h, cid->
bps, cid->
spp);
1747 fprintf(stderr,
"uncomp bytes = %ld, comp bytes = %ld, nbytes85 = %ld\n",
1750 fprintf(stderr,
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
1751 xpt, ypt, wpt, hpt);
1755 outstr =
generateFlatePS(NULL, cid, xpt, ypt, wpt, hpt, pageno, endpage);
1757 return ERROR_INT(
"outstr not made", procName, 1);
1759 *pnbytes = strlen(outstr);
1790 l_int32 w, h, bps, spp;
1795 PROCNAME(
"generateFlatePS");
1798 return (
char *)ERROR_PTR(
"flate data not defined", procName, NULL);
1805 return (
char *)ERROR_PTR(
"sa not made", procName, NULL);
1810 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
1812 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: Flate compressed PS");
1816 if (var_PS_WRITE_BOUNDING_BOX == 1) {
1817 snprintf(bigbuf,
sizeof(bigbuf),
1818 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
1819 xpt, ypt, xpt + wpt, ypt + hpt);
1825 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
1829 snprintf(bigbuf,
sizeof(bigbuf),
1830 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1833 snprintf(bigbuf,
sizeof(bigbuf),
1834 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1839 snprintf(bigbuf,
sizeof(bigbuf),
1840 "[ /Indexed /DeviceRGB %d %%set colormap type/size",
1846 }
else if (spp == 1) {
1853 "/RawData currentfile /ASCII85Decode filter def",
L_COPY);
1855 "/Data RawData << >> /FlateDecode filter def",
L_COPY);
1858 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1860 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1862 snprintf(bigbuf,
sizeof(bigbuf),
" /BitsPerComponent %d", bps);
1864 snprintf(bigbuf,
sizeof(bigbuf),
1865 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1870 }
else if (spp == 1) {
1883 if (endpage == TRUE)
1929 PROCNAME(
"pixWriteMemPS");
1932 return ERROR_INT(
"&data not defined", procName, 1 );
1934 return ERROR_INT(
"&size not defined", procName, 1 );
1936 return ERROR_INT(
"&pix not defined", procName, 1 );
1939 *psize = strlen((
char *)(*pdata));
1959 l_float32 fillfract)
1961 l_int32 resw, resh, res;
1963 if (fillfract == 0.0)
1964 fillfract = DEFAULT_FILL_FRACTION;
1965 resw = (l_int32)((w * 72.) / (LETTER_WIDTH * fillfract));
1966 resh = (l_int32)((h * 72.) / (LETTER_HEIGHT * fillfract));
1967 res = L_MAX(resw, resh);
1984 l_float32 fillfract)
1986 l_int32 resw, resh, res;
1988 if (fillfract == 0.0)
1989 fillfract = DEFAULT_FILL_FRACTION;
1990 resw = (l_int32)((w * 72.) / (A4_WIDTH * fillfract));
1991 resh = (l_int32)((h * 72.) / (A4_HEIGHT * fillfract));
1992 res = L_MAX(resw, resh);
2001 l_psWriteBoundingBox(l_int32 flag)
2003 var_PS_WRITE_BOUNDING_BOX = flag;
l_ok convertJpegToPSString(const char *filein, char **poutstr, l_int32 *pnbytes, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 endpage)
convertJpegToPSString()
l_ok pixWriteMemPS(l_uint8 **pdata, size_t *psize, PIX *pix, BOX *box, l_int32 res, l_float32 scale)
pixWriteMemPS()
char * sarrayToString(SARRAY *sa, l_int32 addnlflag)
sarrayToString()
char * generateUncompressedPS(char *hexdata, l_int32 w, l_int32 h, l_int32 d, l_int32 psbpl, l_int32 bps, l_float32 xpt, l_float32 ypt, l_float32 wpt, l_float32 hpt, l_int32 boxflag)
generateUncompressedPS()
L_COMP_DATA * l_generateG4Data(const char *fname, l_int32 ascii85flag)
l_generateG4Data()
l_ok convertJpegToPSEmbed(const char *filein, const char *fileout)
convertJpegToPSEmbed()
SARRAY * sarrayCreate(l_int32 n)
sarrayCreate()
l_ok convertFlateToPSEmbed(const char *filein, const char *fileout)
convertFlateToPSEmbed()
l_uint32 * pixGetData(PIX *pix)
pixGetData()
l_ok pixWritePSEmbed(const char *filein, const char *fileout)
pixWritePSEmbed()
char * pixWriteStringPS(PIX *pixs, BOX *box, l_int32 res, l_float32 scale)
pixWriteStringPS()
l_ok l_binaryWrite(const char *filename, const char *operation, const void *data, size_t nbytes)
l_binaryWrite()
void l_CIDataDestroy(L_COMP_DATA **pcid)
l_CIDataDestroy()
l_ok sarrayAddString(SARRAY *sa, const char *string, l_int32 copyflag)
sarrayAddString()
l_int32 getResA4Page(l_int32 w, l_int32 h, l_float32 fillfract)
getResA4Page()
void getScaledParametersPS(BOX *box, l_int32 wpix, l_int32 hpix, l_int32 res, l_float32 scale, l_float32 *pxpt, l_float32 *pypt, l_float32 *pwpt, l_float32 *phpt)
getScaledParametersPS()
char * generateG4PS(const char *filein, L_COMP_DATA *cid, l_float32 xpt, l_float32 ypt, l_float32 wpt, l_float32 hpt, l_int32 maskflag, l_int32 pageno, l_int32 endpage)
generateG4PS()
l_ok convertG4ToPSEmbed(const char *filein, const char *fileout)
convertG4ToPSEmbed()
l_ok convertJpegToPS(const char *filein, const char *fileout, const char *operation, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 endpage)
convertJpegToPS()
#define GET_DATA_BYTE(pdata, n)
l_int32 getResLetterPage(l_int32 w, l_int32 h, l_float32 fillfract)
getResLetterPage()
PIX * pixClone(PIX *pixs)
pixClone()
l_ok convertG4ToPS(const char *filein, const char *fileout, const char *operation, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 maskflag, l_int32 endpage)
convertG4ToPS()
l_ok convertFlateToPSString(const char *filein, char **poutstr, l_int32 *pnbytes, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 endpage)
convertFlateToPSString()
char * generateFlatePS(const char *filein, L_COMP_DATA *cid, l_float32 xpt, l_float32 ypt, l_float32 wpt, l_float32 hpt, l_int32 pageno, l_int32 endpage)
generateFlatePS()
void pixDestroy(PIX **ppix)
pixDestroy()
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
FILE * fopenWriteStream(const char *filename, const char *modestring)
fopenWriteStream()
l_int32 fileFormatIsTiff(FILE *fp)
fileFormatIsTiff()
FILE * fopenReadStream(const char *filename)
fopenReadStream()
PIX * pixRead(const char *filename)
pixRead()
PIX * pixConvertForPSWrap(PIX *pixs)
pixConvertForPSWrap()
char * l_makeTempFilename()
l_makeTempFilename()
char * generateJpegPS(const char *filein, L_COMP_DATA *cid, l_float32 xpt, l_float32 ypt, l_float32 wpt, l_float32 hpt, l_int32 pageno, l_int32 endpage)
generateJpegPS()
l_ok pixWriteStreamPS(FILE *fp, PIX *pix, BOX *box, l_int32 res, l_float32 scale)
pixWriteStreamPS()
l_ok convertTiffMultipageToPS(const char *filein, const char *fileout, l_float32 fillfract)
convertTiffMultipageToPS()
l_ok convertG4ToPSString(const char *filein, char **poutstr, l_int32 *pnbytes, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 maskflag, l_int32 endpage)
convertG4ToPSString()
PIX * pixReadTiff(const char *filename, l_int32 n)
pixReadTiff()
void convertByteToHexAscii(l_uint8 byteval, char *pnib1, char *pnib2)
convertByteToHexAscii()
l_ok convertFlateToPS(const char *filein, const char *fileout, const char *operation, l_int32 x, l_int32 y, l_int32 res, l_float32 scale, l_int32 pageno, l_int32 endpage)
convertFlateToPS()
L_COMP_DATA * l_generateJpegData(const char *fname, l_int32 ascii85flag)
l_generateJpegData()
l_ok boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
PIX * pixScale(PIX *pixs, l_float32 scalex, l_float32 scaley)
pixScale()
l_ok tiffGetCount(FILE *fp, l_int32 *pn)
tiffGetCount()
L_COMP_DATA * l_generateFlateData(const char *fname, l_int32 ascii85flag)
l_generateFlateData()
static const l_int32 L_BUF_SIZE
l_int32 lept_rmfile(const char *filepath)
lept_rmfile()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()