Leptonica 1.68
C Image Processing Library
|
High level PostScript device driver for wrapping sets of images in PostScript. More...
Go to the source code of this file.
Functions | |
l_int32 | convertFilesToPS (const char *dirin, const char *substr, l_int32 res, const char *fileout) |
l_int32 | sarrayConvertFilesToPS (SARRAY *sa, l_int32 res, const char *fileout) |
l_int32 | convertFilesFittedToPS (const char *dirin, const char *substr, l_float32 xpts, l_float32 ypts, const char *fileout) |
l_int32 | sarrayConvertFilesFittedToPS (SARRAY *sa, l_float32 xpts, l_float32 ypts, const char *fileout) |
l_int32 | writeImageCompressedToPSFile (const char *filein, const char *fileout, l_int32 res, l_int32 *pfirstfile, l_int32 *pindex) |
l_int32 | convertSegmentedPagesToPS (const char *pagedir, const char *pagestr, const char *maskdir, const char *maskstr, l_int32 numpre, l_int32 numpost, l_int32 maxnum, l_float32 textscale, l_float32 imagescale, l_int32 threshold, const char *fileout) |
l_int32 | pixWriteSegmentedPageToPS (PIX *pixs, PIX *pixm, l_float32 textscale, l_float32 imagescale, l_int32 threshold, l_int32 pageno, const char *fileout) |
l_int32 | pixWriteMixedToPS (PIX *pixb, PIX *pixc, l_float32 scale, l_int32 pageno, const char *fileout) |
l_int32 | convertToPSEmbed (const char *filein, const char *fileout, l_int32 level) |
l_int32 | pixaWriteCompressedToPS (PIXA *pixa, const char *fileout, l_int32 res, l_int32 level) |
High level PostScript device driver for wrapping sets of images in PostScript.
|=============================================================| | Important note | |=============================================================| | Some of these functions require libtiff, libjpeg and libz. | | If you do not have these libraries, you must set | | #define USE_PSIO 0 | | in environ.h. This will link psio1stub.c | |=============================================================| This is a PostScript "device driver" for wrapping images in PostScript. The images can be rendered by a PostScript interpreter for viewing, using evince or gv. They can also be rasterized for printing, using gs or an embedded interpreter in a PostScript printer. And they can be converted to a pdf using gs (ps2pdf). Convert specified files to PS l_int32 convertFilesToPS() l_int32 sarrayConvertFilesToPS() l_int32 convertFilesFittedToPS() l_int32 sarrayConvertFilesFittedToPS() l_int32 writeImageCompressedToPSFile() Convert mixed text/image files to PS l_int32 convertSegmentedPagesToPS() l_int32 pixWriteSegmentedPageToPS() l_int32 pixWriteMixedToPS() Convert any image file to PS for embedding l_int32 convertToPSEmbed() Write all images in a pixa out to PS l_int32 pixaWriteCompressedToPS() These PostScript converters are used in three different ways. (1) For embedding a PS file in a program like TeX. convertToPSEmbed() handles this for levels 1, 2 and 3 output, and prog/converttops wraps this in an executable. converttops is a generalization of Thomas Merz's jpeg2ps wrapper, in that it works for all types (formats, depth, colormap) of input images and gives PS output in one of these formats level 1 (uncompressed) level 2 (compressed ccittg4 or dct) level 3 (compressed flate) (2) For composing a set of pages with any number of images painted on them, in either level 2 or level 3 formats. (3) For printing a page image or a set of page images, at a resolution that optimally fills the page, using convertFilesFittedToPS(). The top-level calls of utilities in category 2, which can compose multiple images on a page, and which generate a PostScript file for printing or display (e.g., conversion to pdf), are: convertFilesToPS() convertFilesFittedToPS() convertSegmentedPagesToPS() All images are output with page numbers. Bounding box hints are more subtle. They must be included for embeding images in TeX, for example, and the low-level writers include bounding box hints by default. However, these hints should not be included for multi-page PostScript that is composed of a sequence of images; consequently, they are not written when calling higher level functions such as convertFilesToPS(), convertFilesFittedToPS() and convertSegmentedPagesToPS(). The function l_psWriteBoundingBox() sets a flag to give low-level control over this.
Definition in file psio1.c.
l_int32 convertFilesToPS | ( | const char * | dirin, |
const char * | substr, | ||
l_int32 | res, | ||
const char * | fileout | ||
) |
Definition at line 137 of file psio1.c.
References ERROR_INT, FALSE, getSortedPathnamesInDirectory(), L_INFO, l_psWriteBoundingBox(), L_WARNING, PROCNAME, sarrayConvertFilesToPS(), sarrayDestroy(), and TRUE.
Referenced by main().
Definition at line 181 of file psio1.c.
References ERROR_INT, IFF_UNKNOWN, L_INFO, L_NOCOPY, L_WARNING, nfiles, NULL, pixReadHeader(), PROCNAME, sarrayGetCount(), sarrayGetString(), TRUE, and writeImageCompressedToPSFile().
Referenced by convertFilesToPS().
l_int32 convertFilesFittedToPS | ( | const char * | dirin, |
const char * | substr, | ||
l_float32 | xpts, | ||
l_float32 | ypts, | ||
const char * | fileout | ||
) |
Definition at line 246 of file psio1.c.
References ERROR_INT, FALSE, getSortedPathnamesInDirectory(), L_INFO, l_psWriteBoundingBox(), L_WARNING, PROCNAME, sarrayConvertFilesFittedToPS(), sarrayDestroy(), and TRUE.
Referenced by main().
l_int32 sarrayConvertFilesFittedToPS | ( | SARRAY * | sa, |
l_float32 | xpts, | ||
l_float32 | ypts, | ||
const char * | fileout | ||
) |
Definition at line 295 of file psio1.c.
References ERROR_INT, IFF_UNKNOWN, L_INFO, L_NOCOPY, L_WARNING, nfiles, NULL, pixReadHeader(), PROCNAME, sarrayGetCount(), sarrayGetString(), TRUE, and writeImageCompressedToPSFile().
Referenced by convertFilesFittedToPS().
l_int32 writeImageCompressedToPSFile | ( | const char * | filein, |
const char * | fileout, | ||
l_int32 | res, | ||
l_int32 * | pfirstfile, | ||
l_int32 * | pindex | ||
) |
Definition at line 364 of file psio1.c.
References convertFlateToPS(), convertG4ToPS(), convertJpegToPS(), ERROR_INT, FALSE, findFileFormat(), IFF_JFIF_JPEG, IFF_TIFF_G4, IFF_UNKNOWN, L_ERROR_STRING, PROCNAME, and TRUE.
Referenced by pixaWriteCompressedToPS(), sarrayConvertFilesFittedToPS(), and sarrayConvertFilesToPS().
l_int32 convertSegmentedPagesToPS | ( | const char * | pagedir, |
const char * | pagestr, | ||
const char * | maskdir, | ||
const char * | maskstr, | ||
l_int32 | numpre, | ||
l_int32 | numpost, | ||
l_int32 | maxnum, | ||
l_float32 | textscale, | ||
l_float32 | imagescale, | ||
l_int32 | threshold, | ||
const char * | fileout | ||
) |
Definition at line 469 of file psio1.c.
References ERROR_INT, getNumberedPathnamesInDirectory(), L_INFO, NULL, pixDestroy(), pixReadIndexed(), pixWriteSegmentedPageToPS(), PROCNAME, sarrayDestroy(), sarrayGetCount(), and sarrayPadToSameSize().
Referenced by main().
l_int32 pixWriteSegmentedPageToPS | ( | PIX * | pixs, |
PIX * | pixm, | ||
l_float32 | textscale, | ||
l_float32 | imagescale, | ||
l_int32 | threshold, | ||
l_int32 | pageno, | ||
const char * | fileout | ||
) |
Definition at line 564 of file psio1.c.
References ERROR_INT, FALSE, l_psWriteBoundingBox(), NULL, pixClone(), pixConvertRGBToLuminance(), pixConvertTo8Or32(), pixCopy(), pixDestroy(), pixGetDepth(), pixInvert(), pixScale(), pixScaleAreaMap(), pixScaleGrayLI(), pixSetMasked(), pixThresholdToBinary(), pixWriteMixedToPS(), pixZero(), PROCNAME, and TRUE.
Referenced by convertSegmentedPagesToPS().
l_int32 pixWriteMixedToPS | ( | PIX * | pixb, |
PIX * | pixc, | ||
l_float32 | scale, | ||
l_int32 | pageno, | ||
const char * | fileout | ||
) |
Definition at line 714 of file psio1.c.
References convertG4ToPS(), convertJpegToPS(), ERROR_INT, FALSE, getResLetterPage(), IFF_JFIF_JPEG, IFF_TIFF_G4, pixGetHeight(), pixGetWidth(), pixWrite(), PROCNAME, and TRUE.
Referenced by pixWriteSegmentedPageToPS().
Definition at line 794 of file psio1.c.
References convertFlateToPSEmbed(), convertG4ToPSEmbed(), convertJpegToPSEmbed(), ERROR_INT, findFileFormat(), IFF_JFIF_JPEG, IFF_TIFF_G4, IFF_UNKNOWN, L_ERROR, L_ERROR_STRING, NULL, pixConvert16To8(), pixConvertTo8(), pixDestroy(), pixGetColormap(), pixGetDepth(), pixRead(), pixRemoveColormap(), pixWrite(), pixWritePSEmbed(), PROCNAME, and REMOVE_CMAP_BASED_ON_SRC.
Referenced by main().
Definition at line 894 of file psio1.c.
References ERROR_INT, FALSE, FREE, genTempFilename(), IFF_JFIF_JPEG, IFF_PNG, IFF_TIFF_G4, L_CLONE, L_ERROR, L_ERROR_INT, L_WARNING, pixaGetCount(), pixaGetPix(), pixConvertForPSWrap(), pixConvertTo8(), pixDestroy(), pixGetColormap(), pixGetDepth(), pixWrite(), PROCNAME, TRUE, and writeImageCompressedToPSFile().
Referenced by main().