NAME

cxRGBtoHSV - convert color values from red/green/blue to hue/saturation/value
#include <cx/DataAccess.h>

void cxRGBtoHSV( float rgb[3], float hsv[3] )
subroutine cxRGBtoHSV( rgb, hsv )
real rgb(3)
real hsv(3)
cxRGBtoHSV converts the Red/Green/Blue color values stored in rgb into Hue/Saturation/Value values stored in hsv.

The Hue/Saturation/Value color system is described in most elementary books on computer graphics. Hue is the "color" of the color. Here a value of 0 maps to red, 1/3 maps to green, 2/3 maps to blue and 1 also maps to red. Saturation is the amount of white in the color. Pure colors, such as red, have a saturation value of 1. Value is the brightness, or intensity of the color. A value of 0 produces black, regardless of the hue and saturation.

Input values are clamped to the range [0..1]. Output values will be in the range [0..1].

cxHSVtoRGB(3E), cxParamColorFloatGet(3E), cxParamColorFloatSet(3E), cxParamColorPackedGet(3E), cxParamColorPackedSet(3E).
Last modified: Mon Nov 6 16:33:47 GMT 2000
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1999