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

This function colors all pixels in an 8-bit gray level image whose values are outside the range nLow to nHigh.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_IP_pseudocolor_limits (
        HIGEAR hIGear, 
        LPAT_RGB lpRGB_Low,
        LPAT_RGB lpRGB_High, 
        AT_PIXEL nLow, 
        AT_PIXEL nHigh 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of 8-bit grayscale image to be colored.
lpRGB_Low LPAT_RGB Far pointer to an AT_RGB struct (note: B-G-R) specifying the color to apply to all pixels below the nLow value.
lpRGB_High LPAT_RGB Far pointer to an AT_RGB struct (note: B-G-R) specifying the color to apply to all pixels above the nHigh value.
nLow AT_PIXEL All pixels below this value are colored.
nHigh AT_PIXEL All pixels above this value are colored.

Return Value:

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

Supported Raster Image Formats:

Grayscale – 8-16 bpp.

Sample:

None

Example:

 
Copy Code
HIGEAR hIGear; /* HIGEAR handle of image  */
AT_RGB cLowColor, cHighColor; /* The colors to apply */
AT_PIXEL nLow, nHigh;  /* Where to apply them  */
cLowColor.b  = cLowColor.g  = 0;  cLowColor.r  = 255; /* bright red  */
cHighColor.b = cHighColor.r = 0;  cHighColor.g = 255; /* bright green*/
        /* Retain image colors for pixel values 25 through 225:     */
nLow = 25;  nHigh = 225;
IG_IP_pseudocolor_limits ( hIGear, &cLowColor, &cHighColor, nLow, nHigh );

Remarks:

Those values above the range receive the color pointed to by lpRGB_High, and those below the range receive the color pointed to by lpRGB_Low. This function can be used to see how much of the image is saturated or unsaturated.

Remember that the order in the RGB structure is B-G-R. See the section Device-Independent Bitmaps (DIB) for more information.

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