| Function Name | Description |
|---|---|
| XintView3DCreateColorTable | Creates a new color table. |
| XintView3DColor4ToPixel | Converts a XintColor4 value into a pixel. |
| XintView3DColorRecToColorTable | Creates or updates a color table from a XintColorRec structure. |
| XintView3DColorTableData | Returns the colors and number of colors of the specified color table. |
| XintView3DColorTableFree | Frees a color table. |
| XintView3DPixelToColor4 | Converts a color pixel to a XintColor4 value. |
| XintView3DReadColorTable | Reads a color table stored in a file and create or update a color table. |
| XintView3DSetColor4ByName | Converts a color specified by a name into a XintColor4 value. |
| XintView3DUpdateColorTable | Updates an existing color table. |
XintView3DColorTable * XintView3DCreateColorTable (...)
| XintColor4 * | colors | List of colors. |
| int | count | Number of colors in array colors. |
The function returns a pointer to the color table created.
void XintView3DColor4ToPixel(...)
| Widget | view3d | View3D widget. |
| XintColor4 | color | Color to convert. |
| Pixel * | pixel | Returns the closest pixel value corresponding to color. |
XintView3DColorTable *XintView3DColorRecToColorTable (...)
| XintView3DColorTable * | color_table | Specify NULL to create a new color_table, or pass an existing color table to update it. |
| Widget | widget | Widget that is using color_rec to store its color information. |
| XintColorRec * | color_rec | Pointer to the color record structure. |
This function returns the address of a new color table if argument color_table was set to NULL. Otherwise it returns color_table.
XintColor4 *XintView3DColorTableData (...)
| XintView3DColorTable * | color_table | Specify a color table. |
| int * | ncolors | Returns the number of colors in the color table. |
This function returns a pointer to the array of colors contained in the color table. The pointer should not be freed by the application.
void XintView3DColorTableFree (...)
| XintView3DColorTable * | color_table | Color table to free. |
void XintView3DPixelToColor4(...)
| widget | view3d | View3D widget. |
| Pixel | pixel | Pixel value to convert. |
| XintColor4 | color | After function returns, contains the color specification corresponding to pixel. |
XintView3DColorTable *XintView3DReadColorTable (...)
| XintView3DColorTable * | color_table | Specify NULL to create a new color_table, or pass an existing color table to update it. |
| char * | filename | Specifies the name of a file containing the color table description. |
This function returns the address of a new color table if argument color_table was set to NULL. Otherwise it returns color_table. If the file specified in argument filename could not be opened or did not contain a valid color table description, NULL is returned.
The colormap file is formatted as an ASCII file containing a line giving the number of colors defined in the colormap, followed by lines specifying the red, green and blue intensities as integers between 0 and 65535. An optional transparency is specified as a floating point value between 0 and 1. The following is an example of a valid colormap file where the first color is black and the last color is white.
ncolors = 7
0 0 0 1.0
10000 1870 5482 1.0
30942 20056 59035 1.0
1004 6003 900 1.0
10023 4938 5933 1.0
5833 28000 3500 1.0
65535 65535 65535 1.0
Boolean XintView3DSetColor4ByName(...)
| Widget | view3d | ID of widget (does not need to be a View3D widget). |
| char * | color_name | Color name to convert. |
| XintColor4 | color | Contains on return the color specification corresponding to color_name. |
The function returns False if it did not recognize the color name, True otherwise.
void XintView3DUpdateColorTable (...)
| XintView3DColorTable * | color_table | Specifies the color table to update. |
| XintColor4 * | colors | New list of colors. |
| int | ncolors | Number of colors in array colors. |