ImageGear for C and C++ on Windows v20.1 - Updated
IG_IP_color_separate
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image Processing Functions > IG_IP_color_separate

This function is the reverse of IG_IP_color_combine_ex().

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_IP_color_separate (
        HIGEAR hIGearOrig,  
        LPHIGEAR lphIGear1,
        LPHIGEAR lphIGear2, 
        LPHIGEAR lphIGear3,
        LPHIGEAR lphIGear4, 
        AT_MODE nColorSpace 
);

Arguments:

Name Type Description
hIGearOrig HIGEAR HIGEAR handle of the original image to be separated.
lphIGear1 LPHIGEAR Far pointer to an object of type HIGEAR to receive the handle of the separated channel 1 image.
lphIGear2 LPHIGEAR Far pointer to receive handle of channel 2 image.
lphIGear3 LPHIGEAR Far pointer to receive handle of channel 3 image.
lphIGear4 LPHIGEAR Far pointer to receive handle of channel 4 image.
nColorSpace AT_MODE A constant such as IG_COLOR_SPACE_RGB or IG_COLOR_SPACE_CMYK describing how the individual channels are to be separated or extracted.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

Color

Example:

 
Copy Code
HIGEAR hIGear,    /* HIGEAR handle of input image  */
 hIGearRed, /* Handle of Red output image,   */
 hIGearGreen, hIGearBlue,   /* Green, Blue output images */
 hIGearNULL;    /* (Not used when IG_COLOR_SPACE_RGB)   */
AT_ERRCOUNT nErrcount;  /* Returned count of errors */
nErrcount = IG_IP_color_separate ( hIGear, &hIGearRed, &hIGearGreen, &hIGearBlue,
&hIGearNull, IG_COLOR_SPACE_RGB );

Remarks:

This function is the reverse of IG_IP_color_combine_ex(). See the description of that function. Each of the output images created by this function (lphIGear1, etc.) will be grayscale. That is, each will have a grayscale palette. The pixel values will be those obtained from the input image.

Is this page helpful?
Yes No
Thanks for your feedback.