LBitmap::ColorSeparate
#include "ltwrappr.h"
virtual L_INT LBitmap::ColorSeparate(pLBitmaps, uStructSize, uFlags)
/* an array of LBitmap objects that will reference the grayscale bitmaps when they are created */ | |
L_UINT uStructSize; |
/* size in bytes, of the structures pointed to by pLBitmaps. */ |
L_UINT32 uFlags; |
/* flag that indicates the type of separation */ |
Separates the class object's bitmap by color plane to produce one grayscale image per plane. You can specify any of several color-space models, including CMYK.
Parameter |
Description |
|
pLBitmaps |
An array of LBitmap objects that will reference the grayscale bitmaps when they are created. |
|
|
The objects in the array should be in the appropriate order, which in most cases is the order of the letters in the name. For example, for CMY separation, the first object should be for the cyan plane, the second for magenta, and the third for yellow. The only exception is RGB, which should be in BGR (blue, green, red) order. |
|
uStructSize |
Size in bytes, of the structures pointed to by pLBitmaps. Use sizeof(BITMAPHANDLE). |
|
uFlags |
Flag that indicates the type of separation. Possible values are: |
|
|
Value |
Meaning |
|
COLORSEP_RGB |
[0x00] Create images for three RGB planes. |
|
COLORSEP_CMYK |
[0x01] Create images for four CMYK planes. |
|
COLORSEP_HSV |
[0x02] Create images for three HSV planes. |
|
COLORSEP_HLS |
[0x03] Create images for three HLS planes. |
|
COLORSEP_CMY |
[0x04] Create images for three CMY planes. |
|
COLORSEP_YUV |
[0x05] Create images for three YUV planes. |
|
COLORSEP_XYZ |
[0x06] Create images for three XYZ planes. |
|
COLORSEP_LAB |
[0x07] Create images for three LAB planes. |
|
COLORSEP_YCrCb |
[0x08] Create images for three YCrCb planes. |
|
COLORSEP_SCT |
[0x09] Create images for three SCT planes. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
The supported color-space models are RGB, CMYK, CMY, HSV. HLS, YUV, XYZ, LAB, YCrCb and SCT.
This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
If the source bitmap is 48 or 64-bit then the created bitmaps are 16-bit grayscale. Otherwise, the created bitmaps are 8-bit grayscale.
To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.
This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.
Required DLLs and Libraries
LTDIS For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LBitmap::ColorMerge, LBuffer::ConvertColorSpace, LDialogColor::DoModalColorRes, LBitmap::WindowLevel, Class Members |
Topics: |
|
|
|
|
|
|
Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images |
|
|
|
Example
/* This example creates color separations and merges them */
LBitmap LeadBitmap; /* Bitmap handle to hold the loaded image */
LBitmap ColorPlanes[4]; /* Array of bitmap handles */
/* load an image */
LeadBitmap.Load(TEXT("image1.cmp"));
/* Separate the color planes */
LeadBitmap.ColorSeparate(ColorPlanes, sizeof(BITMAPHANDLE), COLORSEP_CMYK);
/* Free the bitmap */
LeadBitmap.Free();
/* Merge the color planes */
LeadBitmap.ColorMerge(ColorPlanes, sizeof(BITMAPHANDLE), COLORSEP_CMYK);
/* Free the bitmaps used for color planes */
ColorPlanes[0].Free();
ColorPlanes[1].Free();
ColorPlanes[2].Free();
ColorPlanes[3].Free();