#include <DLTextImage.h>
Inheritance diagram for DLTextImage:
Public Member Functions | |
DLTextImage (const char *filename, DLBaseImage *imageType=NULL) |
DLTextImage is a DLImage that represents a text or document image. It makes the assumption that a text image would have more white pixels (background) than black pixels. When creating a text image, it scans through the image and determine which color has more pixels, white or black. If image contains more black pixels, DLTextImage will invert the pixels, ensuring a white background and black text.
This object only supports binary (black and white) images. User must downscale the image to binary before calling this function. (See DLBitsPerPixelConverter.) Will throw an exception if not a binary image.
Definition at line 27 of file DLTextImage.h.
DLTextImage::DLTextImage | ( | const char * | filename, | |
DLBaseImage * | imageType = NULL | |||
) |
Constructor: loads an image with the (optional) image type specified by passing a pointer to one of the global image format singleton objects. If no image type is provided, DOCLIB will identify the image by the file extension and/or by the image file content.
Example:
DLTextImage ti("doc.xyz", DLTIFFImage::createImageReader());
doc.xyz
to be loaded as a TIFF file. filename | name of file to be opened | |
imageType | image format object pointer. This could be any instance of the supported image types. |