L_INT LFile::SaveCMYKArray(ppBitmapArray, uBitmapArrayCount, nFormat, nBitsPerPixel, nQFactor, uFlags, pSaveOptions)
This function saves an array of bitmaps as a CMYK TIFF file.
Array of pointers to the bitmaps that contain each color plane. There should be 4 or 5 members in the array, depending on whether there is alpha channel information to save.
All the bitmaps must have the same width, height, bits per pixel and palette. The uBitmapArrayCount parameter indicates how many pointers are stored in the array. The bitmaps are in this order: C, M, Y, K, Alpha (optional).
Number of bitmaps present in ppBitmapArray.
Output file format. Possible values are:
Value | Meaning |
---|---|
FILE_TIF_CMYK | [85] Tagged Image File, with no compression and with CMYK color space. |
FILE_TIF_PACKBITS_CMYK | [88] Tagged Image File with PackBits Compression and CMYK color space. |
FILE_TIFLZW_CMYK | [86] Tagged Image File with LZW Compression and CMYK color space. |
FILE_JPEG_CMYK | [391] JPEG file with CMYK color space and 4:4:4 subsampling. |
FILE_JPEG_CMYK_411 | [392] JPEG file with CMYK color space and 4:1:1 subsampling. |
FILE_JPEG_CMYK_422 | [393] JPEG file with CMYK color space and 4:2:2 subsampling. |
FILE_TIF_JPEG_CMYK | [394] Tagged Image File with JPEG Compression, CMYK color space and 4:4:4 subsampling. |
FILE_TIF_JPEG_CMYK_411 | [395] Tagged Image File with JPEG Compression, CMYK color space and 4:1:1 subsampling. |
FILE_TIF_JPEG_CMYK_422 | [396] Tagged Image File with JPEG Compression, CMYK color space and 4:2:2 subsampling. |
FILE_RAS_PDF_CMYK | [333] Raster PDF with uncompressed CMYK color space. |
FILE_RAS_PDF_LZW_CMYK | [334] Raster PDF with LZW Compression and CMYK color space. |
Resulting bits per pixel for each plane. Possible values are:
Value | Meaning |
---|---|
0 | Default bits per pixel. LEADTOOLS will pick the closest valid value. |
8 | Save 8 bits per component. The generated file will contain 32 bits (no alpha) or 40 bits (with alpha). Note that LFile::GetInfo will report 8 bits less (24 or 32-bit). |
16 | Save 16 bits per component. The generated file will contain 64 bits (no alpha) or 80 bits (with alpha). Note that LFile::GetInfo will report 16 bits less (48 or 64-bit). |
For TIF format only. |
Reserved for future use. Pass 2.
Binary flags that determine the behavior of LFile::SaveCMYKArray. You can specify one of the following values:
Value | Meaning |
---|---|
0 | [0x0000] If the output file exists, it will be overwritten. |
SAVEFILE_MULTIPAGE | [0x0004] If the output file exists and is a valid TIFF file, the new image is appended to the end of the file. More advanced options can be passed using pSaveOptions. |
Pointer to optional extended save options. Pass NULL to use the default save options.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
ERROR_INV_COLORSPACE | Invalid color space |
< 1 | An error occurred. Refer to Return Codes. |
This function will save a CMYK file without performing a color conversion. Each bitmap in the array will contain one of the C, M, Y, K, or Alpha planes. The Alpha plane is optional. The ppBitmapArray should contain:
4 elements if no Alpha information is included or
5 elements if the Alpha information is included (this is not available when saving files with JPEG compression)
To load the array of bitmaps, use LFile::LoadCMYKArray.
To save the array of bitmaps as a file format not supported by this function, call LBitmap::ColorMerge to create a BGR bitmap and save the generated bitmap using LFile::SaveFile.
CMYK TIFF files can be saved as planar (each bitmap in its own plane) or chunky (the data from all the bitmaps is interleaved while saving). Planar images will be saved faster, while chunky images are more compatible (some TIFF readers will not read planar files) and require less memory during the load process. The default is to save chunky files.
To select the planar save mode, set SAVEFILEOPTION.Flags2 to ESO2_SAVEPLANAR [0x00000002]. Note that this option is set in the Flags2 member, not the Flags member (the SAVEFILEOPTION structure has two flag members: Flags and Flags2).
Win32, x64.
For an example, refer to LFile::LoadCMYKArray.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document