Saves MRC images contained in a bitmap list to a file using the MRC LEAD, standard Proprietary T44 or PDF format.
L_INT LSegment::MrcSaveBitmapList( hSegmentList, uhSegmentCount, hList, pCmpOption, pszFileName, nFormat)
An array of segmentation handles. This handle is obtained by calling the LSegment::MrcStartBitmapSegmentation function.
Number of segmentations.
Handle to the list of bitmaps that holds the image data.
Pointer to the COMPRESSIONOPTIONS structure that contains the compression information to use when saving the file.
Character string that contains the output file name.
Output file format. Possible values are:
|FILE_TIF_MRC|| Tagged Image File with standard MRC Compression (Standard T44). (Supports multipage).|
|FILE_PDF_LEAD_MRC|| PDF compression using MRC segmentation technique.|
|FILE_TIF_LEAD_MRC|| Tagged Image File with LEAD proprietary MRC. (Supports multipage). The default file extension is *.TIF.|
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
Use this function to save a list of bitmaps as a TIF file using the Standard T44 format (if the nFormat value is FILE_TIF_MRC), as a TIF file with a LEAD MRC subtype format (if the nFormat value is FILE_TIF_LEAD_MRC), or as a multipage PDF using segmentation capabilities (if the nFormat value is FILE_PDF_LEAD_MRC). If nFormat is FILE_TIF_MRC or FILE_TIF_LEAD_MRC, *.TIF is the default file extension. If nFormat is FILE_PDF_LEAD_MRC, *.PDF is the default file extension.
Use the LSegment::MrcSaveBitmapList function to save a list of bitmaps as a TIF file with a Standard T44 subtype format, LEAD MRC subtype format, or PDF file, based on the LEAD segmentation technique, if you want to:
Take advantage of the greater number of different segment types available when using the proprietary format.
Create smaller files than would be possible by saving them to the Standard T44 format.
Create higher quality files than would be possible by saving them to the Standard T44 format.
All formats supported by this function generate multipage files (TIF, or PDF). The number of pages in the file is either uhSegmentCount or the number of images in hList, whichever is smaller.
Use the LSegment::MrcSaveBitmapT44, or LSegment::MrcSaveBitmap functions to save a single image or to append, inset overwrite to already existing TIF file.
It is best to perform segmentation for all images in the list before calling the LSegment::MrcSaveBitmapList function. Segmentation can be performed automatically by calling the LSegment::MrcSegmentBitmap function, or performed manually by calling the LSegment::MrcCreateNewSegment function.
Call the LSegment::MrcStartBitmapSegmentation function before calling any of the segmentation methods. When the LSegment class object is no longer needed, free it by calling the LSegment::MrcStopBitmapSegmentation function. For more information on segmentation, refer to General Segmentation, Auto-Segmentation, and Manual Segmentation.
When using the LSegment::MrcSaveBitmapList function, segments can be any of the following types:
If the bitmap hasnt been segmented, or has any NULL element, then the function will automatically segment the bitmaps in hList by calling LSegment::MrcSegmentBitmap. The LSegment::MrcSegmentBitmap function maps the text, grayscale and picture segments into layers (mask, background and foreground layers) as defined in the NLS* model of the T.44 standard. 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. The Mixed Raster Content (MRC) format was developed by the International Telecommunications Union as part of ITU-T Recommendation T.44. For more information on Mixed Raster Content (MRC) formats, refer to General Information.
If the pCmpOption parameter is NULL, then the function will use Fax G4 compression for the mask layer (1-bit), JPEG compression for the 24 bit image segments and 2 for the quality factor, JPEG compression for the 8 bit grayscale segments and 2 for the quality factor, and JBIG compression for the 2 bit text and 2 bit grayscale segments. For more information, refer to COMPRESSIONOPTIONS. Note that the nGrayscale2BitCoder, the nGrayscale8BitCoder, and the nGrayscale8BitQFactor members of the COMPRESSIONOPTIONS structure are used only with the FILE_TIF_LEAD_MRC formats. The nText2BitCoder member of the COMPRESSIONOPTIONS structure is used with the FILE_TIF_LEAD_MRC and FILE_PDF_LEAD_MRC formats only.
L_INT LSegment__MrcSaveBitmapListExample(LSegment& LeadSegment, L_UINT uhSegments, HBITMAPLIST hList, L_TCHAR* pszFileName)
/* Initialize the compression structure */
CmpOption.uStructSize = sizeof(COMPRESSIONOPTIONS);
CmpOption.nMaskCoder = MRC_MASK_COMPRESSION_FAX_G3_1D;
CmpOption.nPictureCoder = MRC_PICTURE_COMPRESSION_JPEG;
CmpOption.nPictureQFactor = 10;
CmpOption.nGrayscale8BitCoder = MRC_GRAYSCALE_COMPRESSION_GRAYSCALE_CMW_8BIT;
CmpOption.nGrayscale8BitFactor = 2;
CmpOption.nGrayscale2BitCoder = MRC_GRAYSCALE_COMPRESSION_JBIG_2BIT;
CmpOption.nText2BitCoder = MRC_TEXT_COMPRESSION_JBIG_2BIT;
/* Save the MRC bitmap list using the LEAD Proprietary T44 Format */
nRet = LeadSegment.MrcSaveBitmapList(NULL, uhSegments, hList, &CmpOption, pszFileName, FILE_TIF_LEAD_MRC);