DLTextImage Class Reference

DLImage representation of a text image. More...

#include <DLTextImage.h>

Inheritance diagram for DLTextImage:

DLImage List of all members.

Public Member Functions

 DLTextImage (const char *filename, DLBaseImage *imageType=NULL)

Detailed Description

DLImage representation of a text image.

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.


Constructor & Destructor Documentation

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:

forces doc.xyz to be loaded as a TIFF file.
Parameters:
filename name of file to be opened
imageType image format object pointer. This could be any instance of the supported image types.


The documentation for this class was generated from the following file:

DOCLIB is being developed under contract by a collaboration between:
The Laboratory for Language and Media Processing
Unviersity of Maryland, College Park
and
Booz | Allen | Hamilton

All Rights Reserved, 2003-2007