HSV Procedure
Standard Library procedure that generates and loads color tables into an image display device based on the HSV color system. The final color table is loaded into the display device.
Usage
Input Parameters
vlo—The starting color value or intensity, expressed as 0 to 100 percent. Full intensity is 100 percent.
vhi—The ending color value or intensity, expressed as 0 to 100 percent.
stlo—The starting color saturation, expressed as 0 to 100 percent. Full saturation (undiluted or pure color) is expressed as 100 percent.
sthi—The ending color saturation, expressed as 0 to 100 percent.
hue—The starting hue, expressed as 0 to 360 degrees.
lp—The number of loops around the color cone. The value may be floating-point. A positive value will traverse the color cone in a clockwise direction; a negative value will traverse the color cone in a counterclockwise direction.
Output Parameters
rgb—(optional) A 256-by-3 integer output array containing the red, green, and blue vector values that were translated from the HSV system and loaded into the color tables. The following example shows the ordering of the RGB values in the output array:
Red_Vec(i) = RGB(i, 0) Green_Vec(i) = RGB(i, 1) Blue_Vec(i) = RGB(i, 2)
Keywords
None.
Discussion
The HSV procedure traces a spiral through the HSV color cone. Points along the spiral are converted from HSV values to RGB values and then loaded into the color tables with the TVLCT procedure. The color representation of pixel values between 0 and 255 is linearly interpolated from the hue, saturation, and value of the end points.
Example
The statement:
HSV, 0, 100, 50, 100, 0, -2.5
loads a color table that ranges from 0 to 100 percent in intensity or brightness and from 50 to 100 percent in saturation. This color table begins with a color of red, and makes two and a half full loops around the color solid in the direction of red to blue.
See Also
COLOR_CONVERT, HLS, LOADCT, MODIFYCT, RGB_TO_HSV, TVLCT, WgCeditTool, WgCtTool
For more information, see PV‑WAVE User Guide.
The HSV procedure is adapted from a program in Fundamentals of Interactive Computer Graphics by Foley and Van Dam, Addison Wesley Publishing Company, Reading, MA, 1982.