97 #include <config_auto.h> 101 #include "allheaders.h" 108 static l_int32 var_PS_WRITE_BOUNDING_BOX = 1;
111 static const l_int32 DefaultInputRes = 300;
112 static const l_int32 MinRes = 5;
113 static const l_int32 MaxRes = 3000;
116 static const l_int32 LetterWidth = 612;
117 static const l_int32 LetterHeight = 792;
118 static const l_int32 A4Width = 595;
119 static const l_int32 A4Height = 842;
120 static const l_float32 DefaultFillFraction = 0.95;
122 #ifndef NO_CONSOLE_IO 125 #define DEBUG_FLATE 0 140 l_int32 res, l_float32 scale,
141 l_float32 *pxpt, l_float32 *pypt,
142 l_float32 *pwpt, l_float32 *phpt);
145 l_int32 *pnbytes, l_int32 x, l_int32 y,
146 l_int32 res, l_float32 scale,
147 l_int32 pageno, l_int32 endpage);
149 l_float32 xpt, l_float32 ypt, l_float32 wpt,
150 l_float32 hpt, l_int32 pageno, l_int32 endpage);
152 l_int32 *pnbytes, l_int32 x, l_int32 y,
153 l_int32 res, l_float32 scale, l_int32 pageno,
154 l_int32 maskflag, l_int32 endpage);
156 l_float32 ypt, l_float32 wpt, l_float32 hpt,
157 l_int32 maskflag, l_int32 pageno, l_int32 endpage);
159 l_int32 *pnbytes, l_int32 x, l_int32 y,
160 l_int32 res, l_float32 scale,
161 l_int32 pageno, l_int32 endpage);
163 l_float32 xpt, l_float32 ypt, l_float32 wpt,
164 l_float32 hpt, l_int32 pageno, l_int32 endpage);
196 PROCNAME(
"pixWritePSEmbed");
199 return ERROR_INT(
"filein not defined", procName, 1);
201 return ERROR_INT(
"fileout not defined", procName, 1);
203 if ((pix =
pixRead(filein)) == NULL)
204 return ERROR_INT(
"image not read from file", procName, 1);
205 w = pixGetWidth(pix);
206 h = pixGetHeight(pix);
207 if (w * 11.0 > h * 8.5)
208 scale = 8.5 * 300. / (l_float32)w;
210 scale = 11.0 * 300. / (l_float32)h;
213 return ERROR_INT(
"file not opened for write", procName, 1);
251 PROCNAME(
"pixWriteStreamPS");
254 return (l_int32)ERROR_INT(
"stream not open", procName, 1);
256 return (l_int32)ERROR_INT(
"pix not defined", procName, 1);
259 return (l_int32)ERROR_INT(
"pixc not made", procName, 1);
263 return (l_int32)ERROR_INT(
"outstr not made", procName, 1);
265 length = strlen(outstr);
266 fwrite(outstr, 1, length, fp);
347 char *hexdata, *outstr;
349 l_int32 i, j, k, w, h, d;
350 l_float32 wpt, hpt, xpt, ypt;
351 l_int32 wpl, psbpl, hexbytes, boxflag, bps;
352 l_uint32 *line, *data;
355 PROCNAME(
"pixWriteStringPS");
358 return (
char *)ERROR_PTR(
"pixs not defined", procName, NULL);
361 return (
char *)ERROR_PTR(
"pix not made", procName, NULL);
381 wpl = pixGetWpl(pix);
382 if (d == 1 || d == 8)
383 psbpl = (w * d + 7) / 8;
387 hexbytes = 2 * psbpl * h;
388 if ((hexdata = (
char *)LEPT_CALLOC(hexbytes + 1,
sizeof(
char))) == NULL)
389 return (
char *)ERROR_PTR(
"hexdata not made", procName, NULL);
390 if (d == 1 || d == 8) {
391 for (i = 0, k = 0; i < h; i++) {
392 line = data + i * wpl;
393 for (j = 0; j < psbpl; j++) {
401 for (i = 0, k = 0; i < h; i++) {
402 line = data + i * wpl;
403 for (j = 0; j < w; j++) {
422 xpt, ypt, wpt, hpt, boxflag);
425 return (
char *)ERROR_PTR(
"outstr not made", procName, NULL);
464 char bigbuf[Bufsize];
467 PROCNAME(
"generateUncompressedPS");
470 return (
char *)ERROR_PTR(
"hexdata not defined", procName, NULL);
475 snprintf(bigbuf,
sizeof(bigbuf),
476 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
477 xpt, ypt, xpt + wpt, ypt + hpt);
485 "{1 exch sub} settransfer %invert binary",
L_COPY);
487 snprintf(bigbuf,
sizeof(bigbuf),
488 "/bpl %d string def %%bpl as a string", psbpl);
490 snprintf(bigbuf,
sizeof(bigbuf),
491 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
493 snprintf(bigbuf,
sizeof(bigbuf),
494 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
496 snprintf(bigbuf,
sizeof(bigbuf),
497 "%d %d %d %%image dimensions in pixels", w, h, bps);
499 snprintf(bigbuf,
sizeof(bigbuf),
500 "[%d %d %d %d %d %d] %%mapping matrix: [w 0 0 -h 0 h]",
505 if (d == 1 || d == 8)
507 "{currentfile bpl readhexstring pop} image",
L_COPY);
510 "{currentfile bpl readhexstring pop} false 3 colorimage",
513 if (d == 1 || d == 8)
515 "{currentfile bpl readhexstring pop} bind image",
L_COPY);
518 "{currentfile bpl readhexstring pop} bind false 3 colorimage",
531 if (!outstr) L_ERROR(
"outstr not made\n", procName);
568 l_int32 bx, by, bw, bh;
569 l_float32 winch, hinch, xinch, yinch, fres;
571 PROCNAME(
"getScaledParametersPS");
574 res = DefaultInputRes;
575 fres = (l_float32)res;
581 fres = (l_float32)res / scale;
586 if (res < MinRes || res > MaxRes) {
587 L_WARNING(
"res %d out of bounds; using default res; no scaling\n",
589 res = DefaultInputRes;
590 fres = (l_float32)res;
594 winch = (l_float32)wpix / fres;
595 hinch = (l_float32)hpix / fres;
596 xinch = (8.5 - winch) / 2.;
597 yinch = (11.0 - hinch) / 2.;
601 winch = (l_float32)wpix / fres;
603 winch = (l_float32)bw / 1000.;
605 hinch = (l_float32)hpix / fres;
607 hinch = (l_float32)bh / 1000.;
608 xinch = (l_float32)bx / 1000.;
609 yinch = (l_float32)by / 1000.;
613 L_WARNING(
"left edge < 0.0 inch\n", procName);
614 if (xinch + winch > 8.5)
615 L_WARNING(
"right edge > 8.5 inch\n", procName);
617 L_WARNING(
"bottom edge < 0.0 inch\n", procName);
618 if (yinch + hinch > 11.0)
619 L_WARNING(
"top edge > 11.0 inch\n", procName);
647 *pnib1 =
'a' + (nib - 10);
652 *pnib2 =
'a' + (nib - 10);
682 l_int32 w, h, nbytes, ret;
683 l_float32 xpt, ypt, wpt, hpt;
686 PROCNAME(
"convertJpegToPSEmbed");
689 return ERROR_INT(
"filein not defined", procName, 1);
691 return ERROR_INT(
"fileout not defined", procName, 1);
695 return ERROR_INT(
"jpeg data not made", procName, 1);
703 if (w * 11.0 > h * 8.5) {
705 hpt = wpt * (l_float32)h / (l_float32)w;
708 wpt = hpt * (l_float32)w / (l_float32)h;
716 return ERROR_INT(
"outstr not made", procName, 1);
717 nbytes = strlen(outstr);
721 if (ret) L_ERROR(
"ps string not written to file\n", procName);
796 const char *operation,
807 PROCNAME(
"convertJpegToPS");
810 return ERROR_INT(
"filein not defined", procName, 1);
812 return ERROR_INT(
"fileout not defined", procName, 1);
813 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
814 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
818 return ERROR_INT(
"ps string not made", procName, 1);
822 return ERROR_INT(
"ps string not written to file", procName, 1);
867 l_float32 xpt, ypt, wpt, hpt;
870 PROCNAME(
"convertJpegToPSString");
873 return ERROR_INT(
"&outstr not defined", procName, 1);
875 return ERROR_INT(
"&nbytes not defined", procName, 1);
879 return ERROR_INT(
"filein not defined", procName, 1);
883 return ERROR_INT(
"jpeg data not made", procName, 1);
894 res = DefaultInputRes;
900 xpt = scale * x * 72. / res;
901 ypt = scale * y * 72. / res;
902 wpt = scale * cid->
w * 72. / res;
903 hpt = scale * cid->
h * 72. / res;
909 lept_stderr(
"w = %d, h = %d, bps = %d, spp = %d\n",
910 cid->
w, cid->
h, cid->
bps, cid->
spp);
911 lept_stderr(
"comp bytes = %ld, nbytes85 = %ld, ratio = %5.3f\n",
914 lept_stderr(
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
919 outstr =
generateJpegPS(NULL, cid, xpt, ypt, wpt, hpt, pageno, endpage);
922 return ERROR_INT(
"outstr not made", procName, 1);
924 *pnbytes = strlen(outstr);
959 l_int32 w, h, bps, spp;
961 char bigbuf[Bufsize];
964 PROCNAME(
"generateJpegPS");
967 return (
char *)ERROR_PTR(
"jpeg data not defined", procName, NULL);
977 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
979 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: Jpeg compressed PS");
983 if (var_PS_WRITE_BOUNDING_BOX == 1) {
984 snprintf(bigbuf,
sizeof(bigbuf),
985 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
986 xpt, ypt, xpt + wpt, ypt + hpt);
992 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
997 "/RawData currentfile /ASCII85Decode filter def",
L_COPY);
1000 snprintf(bigbuf,
sizeof(bigbuf),
1001 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1004 snprintf(bigbuf,
sizeof(bigbuf),
1005 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1016 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1018 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1020 snprintf(bigbuf,
sizeof(bigbuf),
1021 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1024 snprintf(bigbuf,
sizeof(bigbuf),
" /BitsPerComponent %d", bps);
1037 if (endpage == TRUE)
1077 const char *fileout)
1080 l_int32 w, h, nbytes, ret;
1081 l_float32 xpt, ypt, wpt, hpt;
1084 PROCNAME(
"convertG4ToPSEmbed");
1087 return ERROR_INT(
"filein not defined", procName, 1);
1089 return ERROR_INT(
"fileout not defined", procName, 1);
1092 return ERROR_INT(
"g4 data not made", procName, 1);
1100 if (w * 11.0 > h * 8.5) {
1102 hpt = wpt * (l_float32)h / (l_float32)w;
1105 wpt = hpt * (l_float32)w / (l_float32)h;
1110 outstr =
generateG4PS(NULL, cid, xpt, ypt, wpt, hpt, 1, 1, 1);
1113 return ERROR_INT(
"outstr not made", procName, 1);
1114 nbytes = strlen(outstr);
1118 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1183 const char *fileout,
1184 const char *operation,
1194 l_int32 nbytes, ret;
1196 PROCNAME(
"convertG4ToPS");
1199 return ERROR_INT(
"filein not defined", procName, 1);
1201 return ERROR_INT(
"fileout not defined", procName, 1);
1202 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
1203 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
1206 pageno, maskflag, endpage))
1207 return ERROR_INT(
"ps string not made", procName, 1);
1212 return ERROR_INT(
"ps string not written to file", procName, 1);
1257 l_float32 xpt, ypt, wpt, hpt;
1260 PROCNAME(
"convertG4ToPSString");
1263 return ERROR_INT(
"&outstr not defined", procName, 1);
1265 return ERROR_INT(
"&nbytes not defined", procName, 1);
1269 return ERROR_INT(
"filein not defined", procName, 1);
1272 return ERROR_INT(
"g4 data not made", procName, 1);
1289 xpt = scale * x * 72. / res;
1290 ypt = scale * y * 72. / res;
1291 wpt = scale * cid->
w * 72. / res;
1292 hpt = scale * cid->
h * 72. / res;
1302 lept_stderr(
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
1303 xpt, ypt, wpt, hpt);
1308 maskflag, pageno, endpage);
1311 return ERROR_INT(
"outstr not made", procName, 1);
1313 *pnbytes = strlen(outstr);
1353 char bigbuf[Bufsize];
1356 PROCNAME(
"generateG4PS");
1359 return (
char *)ERROR_PTR(
"g4 data not defined", procName, NULL);
1367 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
1369 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: G4 compressed PS");
1373 if (var_PS_WRITE_BOUNDING_BOX == 1) {
1374 snprintf(bigbuf,
sizeof(bigbuf),
1375 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
1376 xpt, ypt, xpt + wpt, ypt + hpt);
1382 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
1388 snprintf(bigbuf,
sizeof(bigbuf),
1389 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1392 snprintf(bigbuf,
sizeof(bigbuf),
1393 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1400 " /RawData currentfile /ASCII85Decode filter def",
L_COPY);
1403 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1405 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1407 snprintf(bigbuf,
sizeof(bigbuf),
1408 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1419 snprintf(bigbuf,
sizeof(bigbuf),
" /Columns %d", w);
1421 snprintf(bigbuf,
sizeof(bigbuf),
" /Rows %d", h);
1424 if (maskflag == TRUE)
1429 if (endpage == TRUE)
1474 const char *fileout,
1475 l_float32 fillfract)
1478 l_int32 i, npages, w, h, istiff;
1483 PROCNAME(
"convertTiffMultipageToPS");
1486 return ERROR_INT(
"filein not defined", procName, 1);
1488 return ERROR_INT(
"fileout not defined", procName, 1);
1491 return ERROR_INT(
"file not found", procName, 1);
1495 return ERROR_INT(
"file not tiff format", procName, 1);
1500 if (fillfract == 0.0)
1501 fillfract = DefaultFillFraction;
1503 for (i = 0; i < npages; i++) {
1505 return ERROR_INT(
"pix not made", procName, 1);
1508 if (w == 1728 && h < w)
1514 pixWrite(tempfile, pixs, IFF_TIFF_G4);
1515 scale = L_MIN(fillfract * 2550 / w, fillfract * 3300 / h);
1518 i + 1, FALSE, TRUE);
1521 i + 1, FALSE, TRUE);
1523 LEPT_FREE(tempfile);
1554 const char *fileout)
1557 l_int32 w, h, nbytes, ret;
1558 l_float32 xpt, ypt, wpt, hpt;
1561 PROCNAME(
"convertFlateToPSEmbed");
1564 return ERROR_INT(
"filein not defined", procName, 1);
1566 return ERROR_INT(
"fileout not defined", procName, 1);
1569 return ERROR_INT(
"flate data not made", procName, 1);
1577 if (w * 11.0 > h * 8.5) {
1579 hpt = wpt * (l_float32)h / (l_float32)w;
1582 wpt = hpt * (l_float32)w / (l_float32)h;
1590 return ERROR_INT(
"outstr not made", procName, 1);
1591 nbytes = strlen(outstr);
1595 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1668 const char *fileout,
1669 const char *operation,
1678 l_int32 nbytes, ret;
1680 PROCNAME(
"convertFlateToPS");
1683 return ERROR_INT(
"filein not defined", procName, 1);
1685 return ERROR_INT(
"fileout not defined", procName, 1);
1686 if (strcmp(operation,
"w") && strcmp(operation,
"a"))
1687 return ERROR_INT(
"operation must be \"w\" or \"a\"", procName, 1);
1691 return ERROR_INT(
"ps string not made", procName, 1);
1695 if (ret) L_ERROR(
"ps string not written to file\n", procName);
1745 l_float32 xpt, ypt, wpt, hpt;
1748 PROCNAME(
"convertFlateToPSString");
1751 return ERROR_INT(
"&outstr not defined", procName, 1);
1753 return ERROR_INT(
"&nbytes not defined", procName, 1);
1757 return ERROR_INT(
"filein not defined", procName, 1);
1760 return ERROR_INT(
"flate data not made", procName, 1);
1771 res = DefaultInputRes;
1773 xpt = scale * x * 72. / res;
1774 ypt = scale * y * 72. / res;
1775 wpt = scale * cid->
w * 72. / res;
1776 hpt = scale * cid->
h * 72. / res;
1782 lept_stderr(
"w = %d, h = %d, bps = %d, spp = %d\n",
1783 cid->
w, cid->
h, cid->
bps, cid->
spp);
1784 lept_stderr(
"uncomp bytes = %ld, comp bytes = %ld, nbytes85 = %ld\n",
1787 lept_stderr(
"xpt = %7.2f, ypt = %7.2f, wpt = %7.2f, hpt = %7.2f\n",
1788 xpt, ypt, wpt, hpt);
1792 outstr =
generateFlatePS(NULL, cid, xpt, ypt, wpt, hpt, pageno, endpage);
1795 return ERROR_INT(
"outstr not made", procName, 1);
1797 *pnbytes = strlen(outstr);
1827 l_int32 w, h, bps, spp;
1829 char bigbuf[Bufsize];
1832 PROCNAME(
"generateFlatePS");
1835 return (
char *)ERROR_PTR(
"flate data not defined", procName, NULL);
1845 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: %s", filein);
1847 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Title: Flate compressed PS");
1851 if (var_PS_WRITE_BOUNDING_BOX == 1) {
1852 snprintf(bigbuf,
sizeof(bigbuf),
1853 "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
1854 xpt, ypt, xpt + wpt, ypt + hpt);
1860 snprintf(bigbuf,
sizeof(bigbuf),
"%%%%Page: %d %d", pageno, pageno);
1864 snprintf(bigbuf,
sizeof(bigbuf),
1865 "%7.2f %7.2f translate %%set image origin in pts", xpt, ypt);
1868 snprintf(bigbuf,
sizeof(bigbuf),
1869 "%7.2f %7.2f scale %%set image size in pts", wpt, hpt);
1874 snprintf(bigbuf,
sizeof(bigbuf),
1875 "[ /Indexed /DeviceRGB %d %%set colormap type/size",
1881 }
else if (spp == 1) {
1888 "/RawData currentfile /ASCII85Decode filter def",
L_COPY);
1890 "/Data RawData << >> /FlateDecode filter def",
L_COPY);
1893 snprintf(bigbuf,
sizeof(bigbuf),
" /Width %d", w);
1895 snprintf(bigbuf,
sizeof(bigbuf),
" /Height %d", h);
1897 snprintf(bigbuf,
sizeof(bigbuf),
" /BitsPerComponent %d", bps);
1899 snprintf(bigbuf,
sizeof(bigbuf),
1900 " /ImageMatrix [ %d 0 0 %d 0 %d ]", w, -h, h);
1905 }
else if (spp == 1) {
1918 if (endpage == TRUE)
1964 PROCNAME(
"pixWriteMemPS");
1967 return ERROR_INT(
"&data not defined", procName, 1 );
1969 return ERROR_INT(
"&size not defined", procName, 1 );
1971 return ERROR_INT(
"&pix not defined", procName, 1 );
1974 *psize = strlen((
char *)(*pdata));
1994 l_float32 fillfract)
1996 l_int32 resw, resh, res;
1998 if (fillfract == 0.0)
1999 fillfract = DefaultFillFraction;
2000 resw = (l_int32)((w * 72.) / (LetterWidth * fillfract));
2001 resh = (l_int32)((h * 72.) / (LetterHeight * fillfract));
2002 res = L_MAX(resw, resh);
2019 l_float32 fillfract)
2021 l_int32 resw, resh, res;
2023 if (fillfract == 0.0)
2024 fillfract = DefaultFillFraction;
2025 resw = (l_int32)((w * 72.) / (A4Width * fillfract));
2026 resh = (l_int32)((h * 72.) / (A4Height * fillfract));
2027 res = L_MAX(resw, resh);
2036 l_psWriteBoundingBox(l_int32 flag)
2038 var_PS_WRITE_BOUNDING_BOX = flag;
static 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()
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()
static 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()
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()
char * l_makeTempFilename(void)
l_makeTempFilename()
L_COMP_DATA * l_generateG4Data(const char *fname, l_int32 ascii85flag)
l_generateG4Data()
void lept_stderr(const char *fmt,...)
lept_stderr()
static 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()
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()
static 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()
char * pixWriteStringPS(PIX *pixs, BOX *box, l_int32 res, l_float32 scale)
pixWriteStringPS()
static 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()
static 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()
static 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 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()
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()
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()
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()
static void convertByteToHexAscii(l_uint8 byteval, char *pnib1, char *pnib2)
convertByteToHexAscii()
PIX * pixReadTiff(const char *filename, l_int32 n)
pixReadTiff()
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()
l_int32 lept_rmfile(const char *filepath)
lept_rmfile()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()