Compute_Color

Functions

HC_BOOLEAN Compute_Color (const char *name, const char *out_type, HC_RGB *out_value)
 Allows access to the color-conversion routines used internally in HOOPS. More...
 
HC_BOOLEAN Compute_Color_By_Value (const char *in_type, const HC_RGB *in_value, const char *out_type, HC_RGB *out_value)
 Similar to Compute_Color(), but operates with a color values rather than names or map indices. More...
 

Detailed Description

Function Documentation

◆ Compute_Color()

HC_BOOLEAN Compute_Color ( const char *  name,
const char *  out_type,
HC_RGB *  out_value 
)

Allows access to the color-conversion routines used internally in HOOPS.

Parameters
name- A color-by-name color specification, in the style of Set_Color() .
out_type- Special constant—either "HLS", "HSV", "HIC", or "RGB". The constant is a quoted string. Uppercase versus lowercase is not significant.
out_value- A color triple that represents hue, lightness, and saturation, or red, green, and blue, etc., depending on the values of in_type and out_type. Returned to user. Passed by reference in all languages.
Returns
true if it succeeds in turning the input color string into a color value in the format specified by out_type; otherwise, it returns false.

DETAILS

These routines allow access to the internal color conversion routines used by HOOPS in the normal processing of Set_Color() and Set_Color_By_Value() . Compute_Color() takes a normal HOOPS color name, such as "pinkish purple" and returns the numeric equivalent in the selected color space. Compute_Color_By_Value() takes a numeric color in one color space and converts it to the equivalent color in another color space.

NOTES

Not all colors that can be represented in the HLS, HSV and HIC color space have an exact equivalent RGB value. For colors that can't be represented, the nearest legal RGB value is returned instead.

If in_type or out_type are not legitimate an error is signalled. Other errors are not signalled and are returned in the success flag.

The final RGB values passed to the device usually have a gamma correction applied—these routines do not include gamma correction.

RESTRICTIONS

See also
Set_Color, Set_Color_By_Value, Define_Color_Name.

◆ Compute_Color_By_Value()

HC_BOOLEAN Compute_Color_By_Value ( const char *  in_type,
const HC_RGB *  in_value,
const char *  out_type,
HC_RGB *  out_value 
)

Similar to Compute_Color(), but operates with a color values rather than names or map indices.

Parameters
in_type- Special constant—either "HLS", "HSV", "HIC", or "RGB". The constant is a quoted string. Uppercase versus lowercase is not significant.
in_value- A color triple that represents hue, lightness, and saturation, or red, green, and blue, etc., depending on the values of in_type and out_type. Passed by reference in all languages.
out_type- Special constant—either "HLS", "HSV", "HIC", or "RGB". The constant is a quoted string. Uppercase versus lowercase is not significant.
out_value- A color triple that represents hue, lightness, and saturation, or red, green, and blue, etc., depending on the values of in_type and out_type. Returned to user. Passed by reference in all languages.
Returns
true if the function succeeds in turning the input color string into a color value in the format specified by out_type; otherwise, it returns false.

DETAILS

No additional details. See Compute_Color()