Set_Color_Map

Functions

void Set_Color_Map (const char *colors)
 Sets up the colors to be used when displaying images or "by index" color attributes. More...
 
void Set_Color_Map_By_Value (const char *color_space, int count, const HC_RGB *values)
 Similar to Set_Color_Map(), but operates with a color values rather than names or map indices. More...
 
void UnSet_Color_Map (void)
 Removes all settings established by a previous call to Set_Color_Map(). More...
 

Detailed Description

Function Documentation

◆ Set_Color_Map()

void Set_Color_Map ( const char *  colors)

Sets up the colors to be used when displaying images or "by index" color attributes.

Parameters
colors- A (long!) string that contains English descriptions of the desired colors, separated by commas within the string. Note that the "by value" routines below are the ones most people use.

DETAILS

Color maps are most commonly used with images. Images in HOOPS Visualize are defined in terms of "color #3", "color #5", etc.—essentially "paint by number". The current color map attribute is what assigns actual colors to that "# 3" and "# 5".
A color map is simply a list of colors. If, for example, an image or a Set_Color_By_Value call refers to "index 0", the system indexes into the very first entry in that current color map list and uses the color it finds there. This lookup occurs each time the picture is updated, not just at the time the image or set-by-index was declared.
The "list of colors" (for consistency with the rest of the color routines) can be defined in English. For example: "red, blue, green, white, black" defines a color map of length 5. But more commonly you would use the Set_Color_Map_By_Value() entry point, and pass a large array of computed numeric values. See Set_Color_By_Value() for more details on color spaces and the formats of these numbers. A value of "*" in a color map means that the color should be inherited from the segment in which the geometry resides.

Color space can be any one of the following:


--------------------------------------------------------------------------------------
"HLS"     For hue, lightness, and saturation (a "double cone", with black and white     
          at the tips).                                                                 
"HSV"     For hue, lightness, and value (a "single cone" standing on its point, with    
          black at the tip and white at the center of the base).                        
"HIC"     For hue, intensity, and chromaticity (a cylinder, with black and white at     
          the two ends).                                                                
"RGB"     For red, green, and blue (a cube, with white, black, and six primary colors   
          at the corners).                                                              
--------------------------------------------------------------------------------------

All values must be in the range of zero to one inclusive, except for hues, which range from zero to 360 degrees. If a hue is outside this range, the system will normalize the value.

NOTES

The color map is a segment attribute itself, and follows the same inheritance rules as the other attributes in the world. Specifically, a color map attached to a segment applies to that segment and to all its subsegments, except for those subsegments that have their own explicit color maps. In the same way as any other attribute, a color map on a low-level segment overrides the map on a higher-level segment.

RESTRICTIONS

See also
Modify_Color_Map, Insert_Image, Set_Color, Set_Color_By_Value, Set_Color_By_Index, Set_Color_By_FIndex.

◆ Set_Color_Map_By_Value()

void Set_Color_Map_By_Value ( const char *  color_space,
int  count,
const HC_RGB *  values 
)

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

Parameters
color_space- Special constant—either "HLS", "HSV", "HIC", or "RGB". Note that the constant is a quoted string. Upper case versus lowercase is not significant.
count- The number of colors contained in the values array.
values- An array of triples (the same format as the array in Insert_Polyline() ) in the selected color space (see details below).

DETAILS

No additional details. See Set_Color_Map()

◆ UnSet_Color_Map()

void UnSet_Color_Map ( void  )

Removes all settings established by a previous call to Set_Color_Map().

DETAILS

No additional details. See Set_Color_Map()