192 #include "allheaders.h" 199 static const l_int32 DEFAULT_INPUT_RES = 300;
240 l_float32 scalefactor,
249 PROCNAME(
"convertFilesToPdf");
252 return ERROR_INT(
"dirname not defined", procName, 1);
254 return ERROR_INT(
"fileout not defined", procName, 1);
257 return ERROR_INT(
"sa not made", procName, 1);
287 l_float32 scalefactor,
297 PROCNAME(
"saConvertFilesToPdf");
300 return ERROR_INT(
"sa not defined", procName, 1);
303 title, &data, &nbytes);
305 if (data) LEPT_FREE(data);
306 return ERROR_INT(
"pdf data not made", procName, 1);
312 L_ERROR(
"pdf data not written to file\n", procName);
340 l_float32 scalefactor,
348 const char *pdftitle;
350 l_int32 i, n, ret, pagetype, npages, scaledres;
356 PROCNAME(
"saConvertFilesToPdfData");
359 return ERROR_INT(
"&data not defined", procName, 1);
362 return ERROR_INT(
"&nbytes not defined", procName, 1);
365 return ERROR_INT(
"sa not defined", procName, 1);
366 if (scalefactor <= 0.0) scalefactor = 1.0;
368 L_WARNING(
"invalid compression type; using per-page default\n",
377 for (i = 0; i < n; i++) {
378 if (i && (i % 10 == 0)) fprintf(stderr,
".. %d ", i);
380 if ((pixs =
pixRead(fname)) == NULL) {
381 L_ERROR(
"image not readable from file %s\n", procName, fname);
385 pdftitle = (title) ? title : fname;
386 if (scalefactor != 1.0)
387 pix =
pixScale(pixs, scalefactor, scalefactor);
391 scaledres = (l_int32)(res * scalefactor);
396 L_ERROR(
"encoding type selection failed for file %s\n",
401 0, 0, scaledres, pdftitle, NULL, 0);
405 L_ERROR(
"pdf encoding failed for %s\n", procName, fname);
414 L_ERROR(
"no pdf files made\n", procName);
420 fprintf(stderr,
"\nconcatenating ... ");
422 fprintf(stderr,
"done\n");
425 for (i = 0; i < npages; i++) {
457 l_int32 w, h, d, factor, ncolors;
460 PROCNAME(
"selectDefaultPdfEncoding");
463 return ERROR_INT(
"pix not defined", procName, 1);
465 return ERROR_INT(
"&type not defined", procName, 1);
468 cmap = pixGetColormap(pix);
469 if (d == 8 && !cmap) {
470 factor = L_MAX(1, (l_int32)sqrt((l_float64)(w * h) / 20000.));
478 }
else if (cmap || d == 2 || d == 4) {
480 }
else if (d == 8 || d == 32) {
483 return ERROR_INT(
"type selection failure", procName, 1);
525 PROCNAME(
"convertUnscaledFilesToPdf");
528 return ERROR_INT(
"dirname not defined", procName, 1);
530 return ERROR_INT(
"fileout not defined", procName, 1);
533 return ERROR_INT(
"sa not made", procName, 1);
563 PROCNAME(
"saConvertUnscaledFilesToPdf");
566 return ERROR_INT(
"sa not defined", procName, 1);
570 if (data) LEPT_FREE(data);
571 return ERROR_INT(
"pdf data not made", procName, 1);
577 L_ERROR(
"pdf data not written to file\n", procName);
600 l_int32 i, n, ret, npages;
605 PROCNAME(
"saConvertUnscaledFilesToPdfData");
608 return ERROR_INT(
"&data not defined", procName, 1);
611 return ERROR_INT(
"&nbytes not defined", procName, 1);
614 return ERROR_INT(
"sa not defined", procName, 1);
619 for (i = 0; i < n; i++) {
620 if (i && (i % 10 == 0)) fprintf(stderr,
".. %d ", i);
629 if (imdata) LEPT_FREE(imdata);
634 L_ERROR(
"no pdf files made\n", procName);
640 fprintf(stderr,
"\nconcatenating ... ");
642 fprintf(stderr,
"done\n");
646 for (i = 0; i < npages; i++) {
670 const char *pdftitle = NULL;
675 PROCNAME(
"convertUnscaledToPdfData");
678 return ERROR_INT(
"&data not defined", procName, 1);
681 return ERROR_INT(
"&nbytes not defined", procName, 1);
684 return ERROR_INT(
"fname not defined", procName, 1);
687 if (format == IFF_UNKNOWN) {
688 L_WARNING(
"file %s format is unknown; skip\n", procName, fname);
691 if (format == IFF_PS || format == IFF_LPDF) {
692 L_WARNING(
"file %s format is %d; skip\n", procName, fname, format);
700 L_ERROR(
"file %s format is %d; unreadable\n", procName, fname, format);
751 l_float32 scalefactor,
761 PROCNAME(
"pixaConvertToPdf");
764 return ERROR_INT(
"pixa not defined", procName, 1);
767 title, &data, &nbytes);
770 return ERROR_INT(
"conversion to pdf failed", procName, 1);
776 L_ERROR(
"pdf data not written to file\n", procName);
803 l_float32 scalefactor,
811 l_int32 i, n, ret, scaledres, pagetype;
817 PROCNAME(
"pixaConvertToPdfData");
820 return ERROR_INT(
"&data not defined", procName, 1);
823 return ERROR_INT(
"&nbytes not defined", procName, 1);
826 return ERROR_INT(
"pixa not defined", procName, 1);
827 if (scalefactor <= 0.0) scalefactor = 1.0;
829 L_WARNING(
"invalid compression type; using per-page default\n",
837 for (i = 0; i < n; i++) {
839 L_ERROR(
"pix[%d] not retrieved\n", procName, i);
842 if (scalefactor != 1.0)
843 pix =
pixScale(pixs, scalefactor, scalefactor);
847 scaledres = (l_int32)(res * scalefactor);
851 L_ERROR(
"encoding type selection failed for pix[%d]\n",
857 0, 0, scaledres, title, NULL, 0);
861 L_ERROR(
"pdf encoding failed for pix[%d]\n", procName, i);
870 L_ERROR(
"no pdf files made\n", procName);
879 for (i = 0; i < n; i++) {
962 PROCNAME(
"convertToPdf");
965 return ERROR_INT(
"filein not defined", procName, 1);
968 return ERROR_INT(
"fileout not defined", procName, 1);
972 return ERROR_INT(
"invalid conversion type", procName, 1);
975 res, title, plpd, position))
976 return ERROR_INT(
"pdf data not made", procName, 1);
982 return ERROR_INT(
"pdf data not written to file", procName, 1);
1022 const char *fileout,
1033 PROCNAME(
"convertImageDataToPdf");
1036 return ERROR_INT(
"image data not defined", procName, 1);
1039 return ERROR_INT(
"invalid conversion type", procName, 1);
1042 return ERROR_INT(
"fileout not defined", procName, 1);
1045 if ((pix =
pixReadMem(imdata, size)) == NULL)
1046 return ERROR_INT(
"pix not read", procName, 1);
1048 title, plpd, position);
1097 PROCNAME(
"convertToPdfData");
1100 return ERROR_INT(
"&data not defined", procName, 1);
1103 return ERROR_INT(
"&nbytes not defined", procName, 1);
1106 return ERROR_INT(
"filein not defined", procName, 1);
1109 return ERROR_INT(
"invalid conversion type", procName, 1);
1111 if ((pix =
pixRead(filein)) == NULL)
1112 return ERROR_INT(
"pix not made", procName, 1);
1115 x, y, res, (title) ? title : filein, plpd, position);
1167 PROCNAME(
"convertImageDataToPdfData");
1170 return ERROR_INT(
"&data not defined", procName, 1);
1173 return ERROR_INT(
"&nbytes not defined", procName, 1);
1176 return ERROR_INT(
"image data not defined", procName, 1);
1182 if ((pix =
pixReadMem(imdata, size)) == NULL)
1183 return ERROR_INT(
"pix not read", procName, 1);
1185 x, y, res, title, plpd, position);
1223 const char *fileout,
1235 PROCNAME(
"pixConvertToPdf");
1238 return ERROR_INT(
"pix not defined", procName, 1);
1241 return ERROR_INT(
"invalid conversion type", procName, 1);
1244 return ERROR_INT(
"fileout not defined", procName, 1);
1248 x, y, res, title, plpd, position)) {
1250 return ERROR_INT(
"pdf data not made", procName, 1);
1257 return ERROR_INT(
"pdf data not written to file", procName, 1);
1289 size_t nbytes, nbytes_written;
1291 PROCNAME(
"pixWriteStreamPdf");
1294 return ERROR_INT(
"stream not opened", procName, 1);
1296 return ERROR_INT(
"pix not defined", procName, 1);
1300 return ERROR_INT(
"pdf data not made", procName, 1);
1303 nbytes_written = fwrite(data, 1, nbytes, fp);
1305 if (nbytes != nbytes_written)
1306 return ERROR_INT(
"failure writing pdf data to stream", procName, 1);
1338 l_int32 ret, d, type;
1341 PROCNAME(
"pixWriteMemPdf");
1343 if (pdata) *pdata = NULL;
1344 if (pnbytes) *pnbytes = 0;
1345 if (!pdata || !pnbytes)
1346 return ERROR_INT(
"&data or &nbytes not defined", procName, 1);
1348 return ERROR_INT(
"pix not defined", procName, 1);
1350 d = pixGetDepth(pix);
1351 cmap = pixGetColormap(pix);
1354 else if (cmap || d == 2 || d == 4 || d == 16)
1360 0, 0, res, title, NULL, 0);
1362 return ERROR_INT(
"pdf data not made", procName, 1);
1419 l_float32 scalefactor,
1421 const char *fileout)
1424 l_uint8 *imdata, *data;
1425 l_int32 i, npages, nboxa, nboxes, ret;
1426 size_t imbytes, databytes;
1432 PROCNAME(
"convertSegmentedFilesToPdf");
1435 return ERROR_INT(
"dirname not defined", procName, 1);
1437 return ERROR_INT(
"fileout not defined", procName, 1);
1441 return ERROR_INT(
"sa not made", procName, 1);
1448 if (nboxa < npages) {
1457 for (i = 0; i < npages; i++) {
1459 if (!strcmp(fname,
""))
continue;
1468 quality, scalefactor, title,
1472 L_ERROR(
"pdf encoding failed for %s\n", procName, fname);
1476 if (imdata) LEPT_FREE(imdata);
1483 L_ERROR(
"no pdf files made\n", procName);
1493 for (i = 0; i < npages; i++) {
1500 if (data) LEPT_FREE(data);
1501 return ERROR_INT(
"pdf data not made", procName, 1);
1507 L_ERROR(
"pdf data not written to file\n", procName);
1544 PROCNAME(
"convertNumberedMasksToBoxaa");
1547 return (
BOXAA *)ERROR_PTR(
"dirname not defined", procName, NULL);
1550 numpost, 10000)) == NULL)
1551 return (
BOXAA *)ERROR_PTR(
"sa not made", procName, NULL);
1559 for (i = 0; i < n; i++) {
1561 if (!strcmp(fname,
""))
continue;
1562 if ((pix =
pixRead(fname)) == NULL) {
1563 L_WARNING(
"invalid image on page %d\n", procName, i);
1647 l_float32 scalefactor,
1649 const char *fileout)
1654 PROCNAME(
"convertToPdfSegmented");
1657 return ERROR_INT(
"filein not defined", procName, 1);
1659 return ERROR_INT(
"fileout not defined", procName, 1);
1662 return ERROR_INT(
"invalid conversion type", procName, 1);
1663 if (boxa && scalefactor > 1.0) {
1664 L_WARNING(
"setting scalefactor to 1.0\n", procName);
1668 if ((pixs =
pixRead(filein)) == NULL)
1669 return ERROR_INT(
"pixs not made", procName, 1);
1672 scalefactor, (title) ? title : filein,
1707 l_float32 scalefactor,
1709 const char *fileout)
1715 PROCNAME(
"pixConvertToPdfSegmented");
1718 return ERROR_INT(
"pixs not defined", procName, 1);
1720 return ERROR_INT(
"fileout not defined", procName, 1);
1723 return ERROR_INT(
"invalid conversion type", procName, 1);
1724 if (boxa && scalefactor > 1.0) {
1725 L_WARNING(
"setting scalefactor to 1.0\n", procName);
1730 scalefactor, title, &data, &nbytes);
1732 return ERROR_INT(
"pdf generation failure", procName, 1);
1735 if (data) LEPT_FREE(data);
1770 l_float32 scalefactor,
1778 PROCNAME(
"convertToPdfDataSegmented");
1781 return ERROR_INT(
"&data not defined", procName, 1);
1784 return ERROR_INT(
"&nbytes not defined", procName, 1);
1787 return ERROR_INT(
"filein not defined", procName, 1);
1790 return ERROR_INT(
"invalid conversion type", procName, 1);
1791 if (boxa && scalefactor > 1.0) {
1792 L_WARNING(
"setting scalefactor to 1.0\n", procName);
1796 if ((pixs =
pixRead(filein)) == NULL)
1797 return ERROR_INT(
"pixs not made", procName, 1);
1800 quality, scalefactor,
1801 (title) ? title : filein,
1837 l_float32 scalefactor,
1842 l_int32 i, nbox, seq, bx, by, bw, bh, upscale;
1844 BOX *box, *boxc, *box2;
1845 PIX *pix, *pixt1, *pixt2, *pixt3, *pixt4, *pixt5, *pixt6;
1849 PROCNAME(
"pixConvertToPdfDataSegmented");
1852 return ERROR_INT(
"&data not defined", procName, 1);
1855 return ERROR_INT(
"&nbytes not defined", procName, 1);
1858 return ERROR_INT(
"pixs not defined", procName, 1);
1861 return ERROR_INT(
"invalid conversion type", procName, 1);
1862 if (boxa && (scalefactor <= 0.0 || scalefactor > 1.0)) {
1863 L_WARNING(
"setting scalefactor to 1.0\n", procName);
1869 res = DEFAULT_INPUT_RES;
1870 scale = (l_float32)((l_int32)(scalefactor * res + 0.5)) / (l_float32)res;
1871 cmap = pixGetColormap(pixs);
1875 if (pixGetDepth(pixs) > 1 && type ==
L_G4_ENCODE) {
1882 0, 0, 2 * res, title, NULL, 0);
1887 0, 0, res, title, NULL, 0);
1903 for (i = 0; i < nbox; i++) {
1913 if (pixGetDepth(pixt3) == 1)
1916 pixt4 =
pixScale(pixt3, scale, scale);
1918 0, 0, (l_int32)(scale * res), title,
1921 if (pixGetDepth(pixt1) == 1) {
1944 for (i = 0; i < nbox; i++) {
1948 if (pixGetDepth(pixt3) == 1)
1951 pixt4 =
pixScale(pixt3, scale, scale);
1956 bx, by, (l_int32)(scale * res), title,
1997 const char *fileout)
2002 PROCNAME(
"concatenatePdf");
2005 return ERROR_INT(
"dirname not defined", procName, 1);
2007 return ERROR_INT(
"fileout not defined", procName, 1);
2010 return ERROR_INT(
"sa not made", procName, 1);
2031 const char *fileout)
2037 PROCNAME(
"saConcatenatePdf");
2040 return ERROR_INT(
"sa not defined", procName, 1);
2042 return ERROR_INT(
"fileout not defined", procName, 1);
2046 return ERROR_INT(
"pdf data not made", procName, 1);
2067 const char *fileout)
2073 PROCNAME(
"ptraConcatenatePdf");
2076 return ERROR_INT(
"pa not defined", procName, 1);
2078 return ERROR_INT(
"fileout not defined", procName, 1);
2082 return ERROR_INT(
"pdf data not made", procName, 1);
2118 PROCNAME(
"concatenatePdfToData");
2121 return ERROR_INT(
"&data not defined", procName, 1);
2124 return ERROR_INT(
"&nbytes not defined", procName, 1);
2127 return ERROR_INT(
"dirname not defined", procName, 1);
2130 return ERROR_INT(
"sa not made", procName, 1);
2156 l_int32 i, npages, ret;
2160 PROCNAME(
"saConcatenatePdfToData");
2163 return ERROR_INT(
"&data not defined", procName, 1);
2166 return ERROR_INT(
"&nbytes not defined", procName, 1);
2169 return ERROR_INT(
"sa not defined", procName, 1);
2173 return ERROR_INT(
"no filenames found", procName, 1);
2175 for (i = 0; i < npages; i++) {
2185 for (i = 0; i < npages; i++) {
l_int32 selectDefaultPdfEncoding(PIX *pix, l_int32 *ptype)
selectDefaultPdfEncoding()
l_int32 convertUnscaledFilesToPdf(const char *dirname, const char *substr, const char *title, const char *fileout)
convertUnscaledFilesToPdf()
PIX * pixRemoveColormap(PIX *pixs, l_int32 type)
pixRemoveColormap()
PIX * pixScaleToGray(PIX *pixs, l_float32 scalefactor)
pixScaleToGray()
l_int32 ptraConcatenatePdfToData(L_PTRA *pa_data, SARRAY *sa, l_uint8 **pdata, size_t *pnbytes)
ptraConcatenatePdfToData()
l_int32 saConvertUnscaledFilesToPdfData(SARRAY *sa, const char *title, l_uint8 **pdata, size_t *pnbytes)
saConvertUnscaledFilesToPdfData()
l_int32 boxaaGetCount(BOXAA *baa)
boxaaGetCount()
l_int32 pixConvertToPdfData(PIX *pix, l_int32 type, l_int32 quality, l_uint8 **pdata, size_t *pnbytes, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
pixConvertToPdfData()
l_int32 ptraConcatenatePdf(L_PTRA *pa, const char *fileout)
ptraConcatenatePdf()
l_int32 cidConvertToPdfData(L_COMP_DATA *cid, const char *title, l_uint8 **pdata, size_t *pnbytes)
cidConvertToPdfData()
PIX * pixConvertTo8(PIX *pixs, l_int32 cmapflag)
pixConvertTo8()
l_int32 splitPathAtDirectory(const char *pathname, char **pdir, char **ptail)
splitPathAtDirectory()
PIX * pixScaleGray2xLIThresh(PIX *pixs, l_int32 thresh)
pixScaleGray2xLIThresh()
l_int32 convertImageDataToPdfData(l_uint8 *imdata, size_t size, l_int32 type, l_int32 quality, l_uint8 **pdata, size_t *pnbytes, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
convertImageDataToPdfData()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
l_int32 convertToPdfData(const char *filein, l_int32 type, l_int32 quality, l_uint8 **pdata, size_t *pnbytes, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
convertToPdfData()
l_int32 convertSegmentedFilesToPdf(const char *dirname, const char *substr, l_int32 res, l_int32 type, l_int32 thresh, BOXAA *baa, l_int32 quality, l_float32 scalefactor, const char *title, const char *fileout)
convertSegmentedFilesToPdf()
BOX * boxTransform(BOX *box, l_int32 shiftx, l_int32 shifty, l_float32 scalex, l_float32 scaley)
boxTransform()
l_int32 pixConvertToPdf(PIX *pix, l_int32 type, l_int32 quality, const char *fileout, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
pixConvertToPdf()
l_int32 convertFilesToPdf(const char *dirname, const char *substr, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, const char *fileout)
convertFilesToPdf()
l_int32 convertToPdfDataSegmented(const char *filein, l_int32 res, l_int32 type, l_int32 thresh, BOXA *boxa, l_int32 quality, l_float32 scalefactor, const char *title, l_uint8 **pdata, size_t *pnbytes)
convertToPdfDataSegmented()
PIX * pixReadMem(const l_uint8 *data, size_t size)
pixReadMem()
PIX * pixCreateTemplate(PIX *pixs)
pixCreateTemplate()
PIX * pixClipRectangle(PIX *pixs, BOX *box, BOX **pboxc)
pixClipRectangle()
l_int32 findFileFormat(const char *filename, l_int32 *pformat)
findFileFormat()
l_int32 ptraAdd(L_PTRA *pa, void *item)
ptraAdd()
l_int32 saConvertFilesToPdfData(SARRAY *sa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, l_uint8 **pdata, size_t *pnbytes)
saConvertFilesToPdfData()
SARRAY * getNumberedPathnamesInDirectory(const char *dirname, const char *substr, l_int32 numpre, l_int32 numpost, l_int32 maxnum)
getNumberedPathnamesInDirectory()
l_int32 pixNumColors(PIX *pixs, l_int32 factor, l_int32 *pncolors)
pixNumColors()
l_int32 convertToPdf(const char *filein, l_int32 type, l_int32 quality, const char *fileout, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
convertToPdf()
l_int32 pixRasterop(PIX *pixd, l_int32 dx, l_int32 dy, l_int32 dw, l_int32 dh, l_int32 op, PIX *pixs, l_int32 sx, l_int32 sy)
pixRasterop()
BOXA * pixConnComp(PIX *pixs, PIXA **ppixa, l_int32 connectivity)
pixConnComp()
L_PTRA * ptraCreate(l_int32 n)
ptraCreate()
l_int32 boxaaExtendWithInit(BOXAA *baa, l_int32 maxindex, BOXA *boxa)
boxaaExtendWithInit()
l_int32 pixWriteStreamPdf(FILE *fp, PIX *pix, l_int32 res, const char *title)
pixWriteStreamPdf()
l_int32 boxaaInitFull(BOXAA *baa, BOXA *boxa)
boxaaInitFull()
l_int32 convertImageDataToPdf(l_uint8 *imdata, size_t size, l_int32 type, l_int32 quality, const char *fileout, l_int32 x, l_int32 y, l_int32 res, const char *title, L_PDF_DATA **plpd, l_int32 position)
convertImageDataToPdf()
l_int32 boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
char * sarrayGetString(SARRAY *sa, l_int32 index, l_int32 copyflag)
sarrayGetString()
l_int32 concatenatePdf(const char *dirname, const char *substr, const char *fileout)
concatenatePdf()
L_BYTEA * l_byteaInitFromFile(const char *fname)
l_byteaInitFromFile()
PIX * pixClone(PIX *pixs)
pixClone()
l_int32 ptraGetActualCount(L_PTRA *pa, l_int32 *pcount)
ptraGetActualCount()
l_int32 pixaConvertToPdf(PIXA *pixa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, const char *fileout)
pixaConvertToPdf()
void pixDestroy(PIX **ppix)
pixDestroy()
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
l_int32 saConvertFilesToPdf(SARRAY *sa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, const char *fileout)
saConvertFilesToPdf()
SARRAY * getSortedPathnamesInDirectory(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
getSortedPathnamesInDirectory()
BOXAA * boxaaCreate(l_int32 n)
boxaaCreate()
l_int32 boxaaReplaceBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaReplaceBoxa()
l_int32 pixSetBlackOrWhite(PIX *pixs, l_int32 op)
pixSetBlackOrWhite()
void ptraDestroy(L_PTRA **ppa, l_int32 freeflag, l_int32 warnflag)
ptraDestroy()
l_int32 pixConvertToPdfSegmented(PIX *pixs, l_int32 res, l_int32 type, l_int32 thresh, BOXA *boxa, l_int32 quality, l_float32 scalefactor, const char *title, const char *fileout)
pixConvertToPdfSegmented()
l_int32 sarrayGetCount(SARRAY *sa)
sarrayGetCount()
PIX * pixRead(const char *filename)
pixRead()
l_int32 saConcatenatePdf(SARRAY *sa, const char *fileout)
saConcatenatePdf()
l_int32 l_binaryWrite(const char *filename, const char *operation, void *data, size_t nbytes)
l_binaryWrite()
l_int32 concatenatePdfToData(const char *dirname, const char *substr, l_uint8 **pdata, size_t *pnbytes)
concatenatePdfToData()
BOXAA * convertNumberedMasksToBoxaa(const char *dirname, const char *substr, l_int32 numpre, l_int32 numpost)
convertNumberedMasksToBoxaa()
PIX * pixaGetPix(PIXA *pixa, l_int32 index, l_int32 accesstype)
pixaGetPix()
void * ptraRemove(L_PTRA *pa, l_int32 index, l_int32 flag)
ptraRemove()
l_int32 l_generateCIDataForPdf(const char *fname, PIX *pix, l_int32 quality, L_COMP_DATA **pcid)
l_generateCIDataForPdf()
l_int32 pixWriteMemPdf(l_uint8 **pdata, size_t *pnbytes, PIX *pix, l_int32 res, const char *title)
pixWriteMemPdf()
l_int32 convertToPdfSegmented(const char *filein, l_int32 res, l_int32 type, l_int32 thresh, BOXA *boxa, l_int32 quality, l_float32 scalefactor, const char *title, const char *fileout)
convertToPdfSegmented()
BOXA * boxaCreate(l_int32 n)
boxaCreate()
void boxDestroy(BOX **pbox)
boxDestroy()
l_int32 convertUnscaledToPdfData(const char *fname, const char *title, l_uint8 **pdata, size_t *pnbytes)
convertUnscaledToPdfData()
l_int32 boxaGetCount(BOXA *boxa)
boxaGetCount()
void l_byteaDestroy(L_BYTEA **pba)
l_byteaDestroy()
l_int32 pixGetDimensions(PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
PIX * pixScale(PIX *pixs, l_float32 scalex, l_float32 scaley)
pixScale()
l_int32 pixConvertToPdfDataSegmented(PIX *pixs, l_int32 res, l_int32 type, l_int32 thresh, BOXA *boxa, l_int32 quality, l_float32 scalefactor, const char *title, l_uint8 **pdata, size_t *pnbytes)
pixConvertToPdfDataSegmented()
l_int32 pixaConvertToPdfData(PIXA *pixa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, l_uint8 **pdata, size_t *pnbytes)
pixaConvertToPdfData()
l_int32 saConcatenatePdfToData(SARRAY *sa, l_uint8 **pdata, size_t *pnbytes)
saConcatenatePdfToData()
L_BYTEA * l_byteaInitFromMem(l_uint8 *data, size_t size)
l_byteaInitFromMem()
l_int32 pixaGetCount(PIXA *pixa)
pixaGetCount()
l_int32 saConvertUnscaledFilesToPdf(SARRAY *sa, const char *title, const char *fileout)
saConvertUnscaledFilesToPdf()
PIX * pixSetBlackOrWhiteBoxa(PIX *pixs, BOXA *boxa, l_int32 op)
pixSetBlackOrWhiteBoxa()
BOXA * boxaaGetBoxa(BOXAA *baa, l_int32 index, l_int32 accessflag)
boxaaGetBoxa()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()