Working with the LEADTOOLS Mixed Raster Content (MRC) C++ Class Library
LEADTOOLS offers the LEADTOOLS Mixed Raster Content (MRC) C++ Class Library to handle mixed raster content files. This class library enhances LEADTOOLS input/output functionality by adding support for color documents containing mixed image and text components. The Mixed Raster Content (MRC) format was developed by the International Telecommunications Union as part of ITU-T Recommendation T.44, and is defined in the proposed standard, RFC-2301, File Format for Internet Fax. The MRC model divides a page into strips and up to 3 layers: consisting of Mask, Foreground and Background layers. Each layer can be coded and compressed independently. Subsequently, these layers can be uncompressed and combined to restore the original image.
The LEADTOOLS implementation of the MRC model involves dividing an object into segments. A segment is a rectangular area on the bitmap that can be classified as text, grayscale, or picture, depending on the number of colors used in its area.
LEADTOOLS offers several functions for saving files: the LSegment::MrcSaveBitmap, LSegment::MrcSaveBitmapT44 and LSegment::MrcSaveBitmapList functions. With these functions it is possible to save an MRC bitmap in any of the following modes:
MRC: This mode uses the Standard MRC file format. The default extension is *.MRC. Please note that multipage files using this format can be loaded, but only one page can be saved. Use the LSegment::MrcSaveBitmapT44 function to save a file in this format.
LEAD MRC: This mode uses the LEAD proprietary MRC file format. The default extension is *.MRC. Please note that this is a single page file format. Use the LSegment::MrcSaveBitmap function to save a file in this format.
TIF-MRC: This mode uses the Tagged Image Format and the Standard MRC format as a subtype. The default extension is *.TIF. Multipage files using this format can be loaded and can also be saved. Use the LSegment::MrcSaveBitmapT44 function to save a file in this format.
TIF-LEAD-MRC: This mode uses the Tagged Image Format and the LEAD proprietary MRC format as a subtype. The default extension is *.TIF. Multipage files using this format can be loaded and can also be saved. Use the LSegment::MrcSaveBitmap or LSegment::MrcSaveBitmapList function to save a file in this format.
The Standard MRC format file uses two different segment types: 1-bit Text and picture. The 1-bit text segments can be compressed using Fax G3 1D, Fax G3 2D, Fax G4 or JBIG compression and picture segments can be compressed using JPEG compression. Some of these compression schemes use a quality factor that allows the amount of compression to be controlled.
The LEAD proprietary MRC formats use the following segment types: 1-bit text, 2-bit text, 2-bit picture grayscale, 8-bit grayscale, and picture. The 1-bit text segments can be compressed using Fax G3 1D, Fax G3 2D, Fax G4 or JBIG compression. The 2 bit grayscale segments can be compressed using JBIG compression. The 8-bit grayscale segments can be compressed using JPEG, LEAD CMP or LEAD CMW compression, and pictures can be compressed using JPEG, LEAD CMP or LEAD CMW compression. Some of these compression schemes use a quality factor that allows the amount of compression to be controlled.