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

This function reverses the color sequence in the pixels of image hIGear's image bitmap.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_IP_swap_red_blue ( HIGEAR hIGear);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.

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++. 

Non-RGB images are converted to RGB for processing, and then back to original color space.

Sample:

Image Processing

Example:

 
Copy Code
HIGEAR hIGear;      /* HIGEAR handle of 24-bit image */
IG_IP_swap_red_blue ( hIGear );

Remarks:

If the sequence is Blue-Green-Red (the standard sequence for a DIB), it is reversed to Red-Green-Blue. If Red-Green-Blue, each pixel is reversed to Blue-Green-Red. This function is typically used on 24-bit RGB images, but it can operate on other image types as well.

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