Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
L_RGBtoHSV
#include "l_bitmap.h"
L_LTDIS_API HSVREF L_RGBtoHSV(crColor)
L_COLORREF crColor; |
/* RGB input value */ |
Returns an HSV value that is an equivalent representation of the specified RGB value.
Parameter |
Description |
crColor |
The RGB input value. |
Returns
An HSVREF that contains the Hue, Saturation, Value equivalent of the specified RGB value.
Comments
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.
The HSV value is the Hue ,Saturation, Value color space. Traditionally, hue ranges from 0 to 359. However, the hue component of the HSVREF is represented by an unsigned byte. Therefore, the range of 0 to 359 is remapped to a range of 0..255. For example,
Color |
Hue(0..359) |
Hue(0..255) |
Red |
0 |
0 |
Green |
120 |
85 |
Blue |
240 |
170 |
Saturation ranges from 0 to 255 where 0 means the highest amount of white and 255 means no white.
Value ranges from 0 to 255 where 0 means highest amount of black and 255 means no black.
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. |
Platforms
Windows 2000 / XP/Vista, Windows CE.
See Also
Functions: |
L_RemapBitmapHue, L_SetBitmapRgnColorHSVRange, L_SetBitmapRgnColorRGBRange, L_HSVtoRGB, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect |
Topics: |
|
|
|
|
|
|
|
|
|
|
Example
For an example, refer to L_RemapBitmapHue.