91 #include "allheaders.h" 98 static l_int32 var_PS_WRITE_BOUNDING_BOX = 1;
101 static const l_int32 DEFAULT_INPUT_RES = 300;
102 static const l_int32 MIN_RES = 5;
103 static const l_int32 MAX_RES = 3000;
106 static const l_int32 LETTER_WIDTH = 612;
107 static const l_int32 LETTER_HEIGHT = 792;
108 static const l_int32 A4_WIDTH = 595;
109 static const l_int32 A4_HEIGHT = 842;
110 static const l_float32 DEFAULT_FILL_FRACTION = 0.95;
112 #ifndef NO_CONSOLE_IO 115 #define DEBUG_FLATE 0 158 PROCNAME(
"pixWritePSEmbed");
161 return ERROR_INT(
"filein not defined", procName, 1);
163 return ERROR_INT(
"fileout not defined", procName, 1);
165 if ((pix =
pixRead(filein)) == NULL)
166 return ERROR_INT(
"image not read from file", procName, 1);
167 w = pixGetWidth(pix);
168 h = pixGetHeight(pix);
169 if (w * 11.0 > h * 8.5)
170 scale = 8.5 * 300. / (l_float32)w;
172 scale = 11.0 * 300. / (l_float32)h;
175 return ERROR_INT(
"file not opened for write", procName, 1);
213 PROCNAME(
"pixWriteStreamPS");
216 return (l_int32)ERROR_INT(
"stream not open", procName, 1);
218 return (l_int32)ERROR_INT(
"pix not defined", procName, 1);
221 return (l_int32)ERROR_INT(
"pixc not made", procName, 1);
224 length = strlen(outstr);
225 fwrite(outstr, 1, length, fp);
307 char *hexdata, *outstr;
309 l_int32 i, j, k, w, h, d;
310 l_float32 wpt, hpt, xpt, ypt;
311 l_int32 wpl, psbpl, hexbytes, boxflag, bps;
312 l_uint32 *line, *data;
315 PROCNAME(
"pixWriteStringPS");
318 return (
char *)ERROR_PTR(
"pixs not defined", procName, NULL);
321 return (
char *)ERROR_PTR(
"pix not made", procName, NULL);
341 wpl = pixGetWpl(pix);
342 if (d == 1 || d == 8)
343 psbpl = (w * d + 7) / 8;
347 hexbytes = 2 * psbpl * h;
348 if ((hexdata = (
char *)LEPT_CALLOC(hexbytes + 1,
sizeof(
char))) == NULL)
349 return (
char *)ERROR_PTR(
"hexdata not made", procName, NULL);
350 if (d == 1 || d == 8) {
351 for (i = 0, k = 0; i < h; i++) {
352 line = data + i * wpl;
353 for (j = 0; j < psbpl; j++) {
361 for (i = 0, k = 0; i < h; i++) {
362 line = data + i * wpl;
363 for (j = 0; j < w; j++) {
382 xpt, ypt, wpt, hpt, boxflag);
384 return (
char *)ERROR_PTR(
"outstr not made", procName, NULL);
427 PROCNAME(
"generateUncompressedPS");
430 return (
char *)ERROR_PTR(
"hexdata not defined", procName, NULL);
433 return (
char *)ERROR_PTR(
"sa not made", procName, NULL);
436 snprintf(bigbuf,
sizeof(bigbuf),
437 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
438 xpt, ypt, xpt + wpt, ypt + hpt);
446 (
char *)
"{1 exch sub} settransfer %invert binary",
L_COPY);
448 snprintf(bigbuf,
sizeof(bigbuf),
449 "/bpl %d string def %%bpl as a string", psbpl);
451 snprintf(bigbuf,
sizeof(bigbuf),
452 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
454 snprintf(bigbuf,
sizeof(bigbuf),
455 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
457 snprintf(bigbuf,
sizeof(bigbuf),
458 "%d %d %d %%image dimensions in pixels", w, h, bps);
460 snprintf(bigbuf,
sizeof(bigbuf),
461 "[%d %d %d %d %d %d] %%mapping matrix: [w 0 0 -h 0 h]",
466 if (d == 1 || d == 8)
468 (
char *)
"{currentfile bpl readhexstring pop} image",
L_COPY);
471 (
char *)
"{currentfile bpl readhexstring pop} false 3 colorimage",
474 if (d == 1 || d == 8)
476 (
char *)
"{currentfile bpl readhexstring pop} bind image",
L_COPY);
479 (
char *)
"{currentfile bpl readhexstring pop} bind false 3 colorimage",
492 if (!outstr) L_ERROR(
"outstr not made\n", procName);
530 l_int32 bx, by, bw, bh;
531 l_float32 winch, hinch, xinch, yinch, fres;
533 PROCNAME(
"getScaledParametersPS");
536 res = DEFAULT_INPUT_RES;
537 fres = (l_float32)res;
543 fres = (l_float32)res / scale;
548 if (res < MIN_RES || res > MAX_RES) {
549 L_WARNING(
"res %d out of bounds; using default res; no scaling\n",
551 res = DEFAULT_INPUT_RES;
552 fres = (l_float32)res;
556 winch = (l_float32)wpix / fres;
557 hinch = (l_float32)hpix / fres;
558 xinch = (8.5 - winch) / 2.;
559 yinch = (11.0 - hinch) / 2.;
563 winch = (l_float32)wpix / fres;
565 winch = (l_float32)bw / 1000.;
567 hinch = (l_float32)hpix / fres;
569 hinch = (l_float32)bh / 1000.;
570 xinch = (l_float32)bx / 1000.;
571 yinch = (l_float32)by / 1000.;
575 L_WARNING(
"left edge < 0.0 inch\n", procName);
576 if (xinch + winch > 8.5)
577 L_WARNING(
"right edge > 8.5 inch\n", procName);
579 L_WARNING(
"bottom edge < 0.0 inch\n", procName);
580 if (yinch + hinch > 11.0)
581 L_WARNING(
"top edge > 11.0 inch\n", procName);
609 *pnib1 =
'a' + (nib - 10);
614 *pnib2 =
'a' + (nib - 10);
645 l_int32 w, h, nbytes, ret;
646 l_float32 xpt, ypt, wpt, hpt;
649 PROCNAME(
"convertJpegToPSEmbed");
652 return ERROR_INT(
"filein not defined", procName, 1);
654 return ERROR_INT(
"fileout not defined", procName, 1);
658 return ERROR_INT(
"jpeg data not made", procName, 1);
666 if (w * 11.0 > h * 8.5) {
668 hpt = wpt * (l_float32)h / (l_float32)w;
671 wpt = hpt * (l_float32)w / (l_float32)h;
679 return ERROR_INT(
"outstr not made", procName, 1);
680 nbytes = strlen(outstr);
684 if (ret) L_ERROR(
"ps string not written to file\n", procName);
758 const char *operation,
769 PROCNAME(
"convertJpegToPS");
772 return ERROR_INT(
"filein not defined", procName, 1);
774 return ERROR_INT(
"fileout not defined", procName, 1);
775 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
776 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
780 return ERROR_INT(
"ps string not made", procName, 1);
783 return ERROR_INT(
"ps string not written to file", procName, 1);
826 l_float32 xpt, ypt, wpt, hpt;
829 PROCNAME(
"convertJpegToPSString");
832 return ERROR_INT(
"&outstr not defined", procName, 1);
834 return ERROR_INT(
"&nbytes not defined", procName, 1);
838 return ERROR_INT(
"filein not defined", procName, 1);
842 return ERROR_INT(
"jpeg data not made", procName, 1);
853 res = DEFAULT_INPUT_RES;
859 xpt = scale * x * 72. / res;
860 ypt = scale * y * 72. / res;
861 wpt = scale * cid->
w * 72. / res;
862 hpt = scale * cid->
h * 72. / res;
868 fprintf(stderr,
"w = %d, h = %d, bps = %d, spp = %d\n",
869 cid->
w, cid->
h, cid->
bps, cid->
spp);
870 fprintf(stderr,
"comp bytes = %ld, nbytes85 = %ld, ratio = %5.3f\n",
873 fprintf(stderr,
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
878 outstr =
generateJpegPS(NULL, cid, xpt, ypt, wpt, hpt, pageno, endpage);
880 return ERROR_INT(
"outstr not made", procName, 1);
882 *pnbytes = strlen(outstr);
918 l_int32 w, h, bps, spp;
923 PROCNAME(
"generateJpegPS");
926 return (
char *)ERROR_PTR(
"jpeg data not defined", procName, NULL);
933 return (
char *)ERROR_PTR(
"sa not made", procName, NULL);
938 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
940 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: Jpeg compressed PS");
944 if (var_PS_WRITE_BOUNDING_BOX == 1) {
945 snprintf(bigbuf,
sizeof(bigbuf),
946 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
947 xpt, ypt, xpt + wpt, ypt + hpt);
953 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
958 (
char *)
"/RawData currentfile /ASCII85Decode filter def",
L_COPY);
960 (
char *)
"/Data RawData << >> /DCTDecode filter def",
L_COPY);
962 snprintf(bigbuf,
sizeof(bigbuf),
963 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
966 snprintf(bigbuf,
sizeof(bigbuf),
967 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
978 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
980 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
982 snprintf(bigbuf,
sizeof(bigbuf),
983 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
986 snprintf(bigbuf,
sizeof(bigbuf),
" /BitsPerComponent %d", bps);
1039 const char *fileout)
1042 l_int32 w, h, nbytes, ret;
1043 l_float32 xpt, ypt, wpt, hpt;
1046 PROCNAME(
"convertG4ToPSEmbed");
1049 return ERROR_INT(
"filein not defined", procName, 1);
1051 return ERROR_INT(
"fileout not defined", procName, 1);
1054 return ERROR_INT(
"g4 data not made", procName, 1);
1062 if (w * 11.0 > h * 8.5) {
1064 hpt = wpt * (l_float32)h / (l_float32)w;
1067 wpt = hpt * (l_float32)w / (l_float32)h;
1072 outstr =
generateG4PS(NULL, cid, xpt, ypt, wpt, hpt, 1, 1, 1);
1075 return ERROR_INT(
"outstr not made", procName, 1);
1076 nbytes = strlen(outstr);
1080 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1145 const char *fileout,
1146 const char *operation,
1158 PROCNAME(
"convertG4ToPS");
1161 return ERROR_INT(
"filein not defined", procName, 1);
1163 return ERROR_INT(
"fileout not defined", procName, 1);
1164 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
1165 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
1168 pageno, maskflag, endpage))
1169 return ERROR_INT(
"ps string not made", procName, 1);
1172 return ERROR_INT(
"ps string not written to file", procName, 1);
1219 l_float32 xpt, ypt, wpt, hpt;
1222 PROCNAME(
"convertG4ToPSString");
1225 return ERROR_INT(
"&outstr not defined", procName, 1);
1227 return ERROR_INT(
"&nbytes not defined", procName, 1);
1231 return ERROR_INT(
"filein not defined", procName, 1);
1234 return ERROR_INT(
"g4 data not made", procName, 1);
1251 xpt = scale * x * 72. / res;
1252 ypt = scale * y * 72. / res;
1253 wpt = scale * cid->
w * 72. / res;
1254 hpt = scale * cid->
h * 72. / res;
1260 fprintf(stderr,
"w = %d, h = %d, minisblack = %d\n",
1262 fprintf(stderr,
"comp bytes = %ld, nbytes85 = %ld\n",
1264 fprintf(stderr,
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
1265 xpt, ypt, wpt, hpt);
1270 maskflag, pageno, endpage);
1272 return ERROR_INT(
"outstr not made", procName, 1);
1274 *pnbytes = strlen(outstr);
1318 PROCNAME(
"generateG4PS");
1321 return (
char *)ERROR_PTR(
"g4 data not defined", procName, NULL);
1326 return (
char *)ERROR_PTR(
"sa not made", procName, NULL);
1331 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
1333 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: G4 compressed PS");
1337 if (var_PS_WRITE_BOUNDING_BOX == 1) {
1338 snprintf(bigbuf,
sizeof(bigbuf),
1339 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
1340 xpt, ypt, xpt + wpt, ypt + hpt);
1346 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
1352 snprintf(bigbuf,
sizeof(bigbuf),
1353 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1356 snprintf(bigbuf,
sizeof(bigbuf),
1357 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1364 (
char *)
" /RawData currentfile /ASCII85Decode filter def",
L_COPY);
1367 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1369 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1371 snprintf(bigbuf,
sizeof(bigbuf),
1372 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1383 snprintf(bigbuf,
sizeof(bigbuf),
" /Columns %d", w);
1385 snprintf(bigbuf,
sizeof(bigbuf),
" /Rows %d", h);
1388 if (maskflag == TRUE)
1393 if (endpage == TRUE)
1438 const char *fileout,
1439 l_float32 fillfract)
1442 l_int32 i, npages, w, h, istiff;
1447 PROCNAME(
"convertTiffMultipageToPS");
1450 return ERROR_INT(
"filein not defined", procName, 1);
1452 return ERROR_INT(
"fileout not defined", procName, 1);
1455 return ERROR_INT(
"file not found", procName, 1);
1459 return ERROR_INT(
"file not tiff format", procName, 1);
1464 if (fillfract == 0.0)
1465 fillfract = DEFAULT_FILL_FRACTION;
1467 for (i = 0; i < npages; i++) {
1469 return ERROR_INT(
"pix not made", procName, 1);
1472 if (w == 1728 && h < w)
1477 tempfile = l_makeTempFilename();
1478 pixWrite(tempfile, pixs, IFF_TIFF_G4);
1479 scale = L_MIN(fillfract * 2550 / w, fillfract * 3300 / h);
1482 i + 1, FALSE, TRUE);
1485 i + 1, FALSE, TRUE);
1487 LEPT_FREE(tempfile);
1518 const char *fileout)
1521 l_int32 w, h, nbytes, ret;
1522 l_float32 xpt, ypt, wpt, hpt;
1525 PROCNAME(
"convertFlateToPSEmbed");
1528 return ERROR_INT(
"filein not defined", procName, 1);
1530 return ERROR_INT(
"fileout not defined", procName, 1);
1533 return ERROR_INT(
"flate data not made", procName, 1);
1541 if (w * 11.0 > h * 8.5) {
1543 hpt = wpt * (l_float32)h / (l_float32)w;
1546 wpt = hpt * (l_float32)w / (l_float32)h;
1554 return ERROR_INT(
"outstr not made", procName, 1);
1555 nbytes = strlen(outstr);
1559 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1631 const char *fileout,
1632 const char *operation,
1641 l_int32 nbytes, ret;
1643 PROCNAME(
"convertFlateToPS");
1646 return ERROR_INT(
"filein not defined", procName, 1);
1648 return ERROR_INT(
"fileout not defined", procName, 1);
1649 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
1650 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
1654 return ERROR_INT(
"ps string not made", procName, 1);
1658 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1707 l_float32 xpt, ypt, wpt, hpt;
1710 PROCNAME(
"convertFlateToPSString");
1713 return ERROR_INT(
"&outstr not defined", procName, 1);
1715 return ERROR_INT(
"&nbytes not defined", procName, 1);
1719 return ERROR_INT(
"filein not defined", procName, 1);
1722 return ERROR_INT(
"flate data not made", procName, 1);
1733 res = DEFAULT_INPUT_RES;
1735 xpt = scale * x * 72. / res;
1736 ypt = scale * y * 72. / res;
1737 wpt = scale * cid->
w * 72. / res;
1738 hpt = scale * cid->
h * 72. / res;
1744 fprintf(stderr,
"w = %d, h = %d, bps = %d, spp = %d\n",
1745 cid->
w, cid->
h, cid->
bps, cid->
spp);
1746 fprintf(stderr,
"uncomp bytes = %ld, comp bytes = %ld, nbytes85 = %ld\n",
1749 fprintf(stderr,
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
1750 xpt, ypt, wpt, hpt);
1754 outstr =
generateFlatePS(NULL, cid, xpt, ypt, wpt, hpt, pageno, endpage);
1756 return ERROR_INT(
"outstr not made", procName, 1);
1758 *pnbytes = strlen(outstr);
1789 l_int32 w, h, bps, spp;
1794 PROCNAME(
"generateFlatePS");
1797 return (
char *)ERROR_PTR(
"flate data not defined", procName, NULL);
1804 return (
char *)ERROR_PTR(
"sa not made", procName, NULL);
1809 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
1811 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: Flate compressed PS");
1815 if (var_PS_WRITE_BOUNDING_BOX == 1) {
1816 snprintf(bigbuf,
sizeof(bigbuf),
1817 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
1818 xpt, ypt, xpt + wpt, ypt + hpt);
1824 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
1828 snprintf(bigbuf,
sizeof(bigbuf),
1829 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1832 snprintf(bigbuf,
sizeof(bigbuf),
1833 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1838 snprintf(bigbuf,
sizeof(bigbuf),
1839 "[ /Indexed /DeviceRGB %d %%set colormap type/size",
1845 }
else if (spp == 1) {
1852 (
char *)
"/RawData currentfile /ASCII85Decode filter def",
L_COPY);
1854 (
char *)
"/Data RawData << >> /FlateDecode filter def",
L_COPY);
1857 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1859 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1861 snprintf(bigbuf,
sizeof(bigbuf),
" /BitsPerComponent %d", bps);
1863 snprintf(bigbuf,
sizeof(bigbuf),
1864 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1869 }
else if (spp == 1) {
1882 if (endpage == TRUE)
1928 PROCNAME(
"pixWriteMemPS");
1931 return ERROR_INT(
"&data not defined", procName, 1 );
1933 return ERROR_INT(
"&size not defined", procName, 1 );
1935 return ERROR_INT(
"&pix not defined", procName, 1 );
1938 *psize = strlen((
char *)(*pdata));
1958 l_float32 fillfract)
1960 l_int32 resw, resh, res;
1962 if (fillfract == 0.0)
1963 fillfract = DEFAULT_FILL_FRACTION;
1964 resw = (l_int32)((w * 72.) / (LETTER_WIDTH * fillfract));
1965 resh = (l_int32)((h * 72.) / (LETTER_HEIGHT * fillfract));
1966 res = L_MAX(resw, resh);
1983 l_float32 fillfract)
1985 l_int32 resw, resh, res;
1987 if (fillfract == 0.0)
1988 fillfract = DEFAULT_FILL_FRACTION;
1989 resw = (l_int32)((w * 72.) / (A4_WIDTH * fillfract));
1990 resh = (l_int32)((h * 72.) / (A4_HEIGHT * fillfract));
1991 res = L_MAX(resw, resh);
2000 l_psWriteBoundingBox(l_int32 flag)
2002 var_PS_WRITE_BOUNDING_BOX = flag;
l_int32 pixWriteStreamPS(FILE *fp, PIX *pix, BOX *box, l_int32 res, l_float32 scale)
pixWriteStreamPS()
char * sarrayToString(SARRAY *sa, l_int32 addnlflag)
sarrayToString()
l_int32 pixWritePSEmbed(const char *filein, const char *fileout)
pixWritePSEmbed()
l_int32 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()
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_int32 pixWriteMemPS(l_uint8 **pdata, size_t *psize, PIX *pix, BOX *box, l_int32 res, l_float32 scale)
pixWriteMemPS()
L_COMP_DATA * l_generateG4Data(const char *fname, l_int32 ascii85flag)
l_generateG4Data()
l_int32 convertJpegToPSEmbed(const char *filein, const char *fileout)
convertJpegToPSEmbed()
SARRAY * sarrayCreate(l_int32 n)
sarrayCreate()
l_uint32 * pixGetData(PIX *pix)
pixGetData()
char * pixWriteStringPS(PIX *pixs, BOX *box, l_int32 res, l_float32 scale)
pixWriteStringPS()
l_int32 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_int32 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()
void l_CIDataDestroy(L_COMP_DATA **pcid)
l_CIDataDestroy()
static const l_int32 L_INSERT
l_int32 tiffGetCount(FILE *fp, l_int32 *pn)
tiffGetCount()
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_int32 convertFlateToPSEmbed(const char *filein, const char *fileout)
convertFlateToPSEmbed()
l_int32 boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
#define GET_DATA_BYTE(pdata, n)
l_int32 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()
l_int32 getResLetterPage(l_int32 w, l_int32 h, l_float32 fillfract)
getResLetterPage()
PIX * pixClone(PIX *pixs)
pixClone()
l_int32 sarrayAddString(SARRAY *sa, char *string, l_int32 copyflag)
sarrayAddString()
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_int32 convertG4ToPSEmbed(const char *filein, const char *fileout)
convertG4ToPSEmbed()
l_int32 convertTiffMultipageToPS(const char *filein, const char *fileout, l_float32 fillfract)
convertTiffMultipageToPS()
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()
l_int32 l_binaryWrite(const char *filename, const char *operation, void *data, size_t nbytes)
l_binaryWrite()
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()
PIX * pixReadTiff(const char *filename, l_int32 n)
pixReadTiff()
void convertByteToHexAscii(l_uint8 byteval, char *pnib1, char *pnib2)
convertByteToHexAscii()
l_int32 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_COMP_DATA * l_generateJpegData(const char *fname, l_int32 ascii85flag)
l_generateJpegData()
l_int32 pixGetDimensions(PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
l_int32 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()
PIX * pixScale(PIX *pixs, l_float32 scalex, l_float32 scaley)
pixScale()
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()