#include "l_bitmap.h"
L_LTDIS_API L_COLORREF L_HSVtoRGB(hsvColor)
Returns a COLORREF value that is an equivalent representation of the specified HSV value.
The HSV input value.
An L_COLORREF that contains the RGB equivalent of the specified HSV value.
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
Win32, x64, Linux.
This example takes displays the H,S,V value of a HSVREF and the equivalent RGB components.
L_INT HSVtoRGBExample(HSVREF hsvColor)
{
L_TCHAR szMsg[100];
COLORREF cr;
wsprintf(szMsg, TEXT("Hue[%d] Saturation[%d] Value[%d]\n"), hsvColor.uH, hsvColor.uS, hsvColor.uV);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
cr = L_HSVtoRGB(hsvColor);
wsprintf(szMsg, TEXT("R[%d] G[%d] B[%d]\n"), GetRValue(cr), GetBValue(cr), GetGValue(cr));
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document