GenerateColormap

DESCRIPTION

GenerateColormap is an IRIS Explorer module for editing color maps. Spline curves are used to establish a relationship between data values and color parameters. Colors may be edited in the RGB (Red, Green, Blue) and HSV (Hue, Saturation, Value) color spaces. GenerateColormap's output is a one dimensional floating point lattice of 4-tuples, of length 256. Each entry in the output lattice is a color vector with Red, Green, Blue, and Opacity components. Opacity here is 1 minus Transparency. The 256 color values are mapped uniformly on the minimum and maximum data domain values.

Palette Window
GenerateColormap has a Palette window to show the current colormap. Only the three real color components are shown here; Opacity is not represented.
Edit Window
The Edit window is used to edit spline curves mapping the color parameters to data domain values. A colored curve appears for each parameter. In RGB mode, the curves are colored as you would expect. In HSV mode the Hue curve is red, the Saturation curve is green, and the Value curve is blue. In both modes, the Opacity curve is white. The curve currently selected for editing is drawn more heavily. Curve control points are drawn as filled points; derivative points are drawn as empty boxes. Only the derivative points for the currently selected control point are drawn. Use the control points to move the curve, and the derivative points to change its slope.
Scale Window
The Scale window displays the data value domain of the color map.
Edit Mode
The Edit Mode option menu chooses the type of user interaction in the Edit window. Move mode allows the user to move control points and derivative points by clicking and dragging these points. Insert mode allows insertion of a new control point by clicking at the insertion location. Use Delete mode to delete a control point by clicking on it. After a point is inserted or deleted, the Edit window reverts to Move mode.
Color Space
The Color Space option menu chooses either the RGB or HSV color space. When the color space is changed, GenerateColormap fits new curves to the color map. Given the non-linearity of the HSV space, the newly fitted curves may not be exact. An attempt is made to recover the original curve when converting back.
Other Controls
The Color Band option menu chooses which of the four color curves will be edited. The Output? option menu chooses whether or not to output new color maps. In Build mode, color map data is not sent from the module. In Run mode, a new map is output with each change in the map. The two dials select the Minimum and Maximum of the domain of the color map. The defaults are zero and one, respectively.
Usage Notes
The leftmost and rightmost control points in each curve cannot be moved horizontally and cannot be deleted. If a color map is saved (by using the WriteLat module) and then restored (by using the ReadLat module) all control information is lost. This means that the control points will most likely not be in the same location. The curves will, however, be as close to the input color map as possible.
The UNIX version of GenerateColormap borrows code from xloadimage to initialize color visuals, and therefore must present this copyright notice:
Copyright 1989, 1990, 1991 Jim Frost
Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The author makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.

THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

INPUTS

Port: Colormap In
Type: Lattice
Optional: This port is optional.
Constraints: 1-D
Constraints: 4-vector
Constraints: float
Constraints: uniform

Input colormap.

Port: Data In
Type: Lattice
Optional: This port is optional.

This lattice is used to set the minimum and maximum domain for the colormap. The module will scan the data in this lattice and assign the minimum and maximum domain values to those in the lattice.

Port: Data In Pyr
Type: Pyramid
Optional: This port is optional.
Constraints: 1..-layer
Constraints: 1..-baseLat
Constraints: n-D compression
Constraints: n-compression type

This pyramid is used to set the minimum and maximum domain for the colormap. The module will scan the data in the selected data lattice from this pyramid and assign the minimum and maximum domain values to those in the lattice. Lattice selection is handled by the "Pyramid Layer" widget (see below).

WIDGETS

Port: Palette Window
Type: Drawing Area

Port: Edit Window
Type: Drawing Area

Port: Scale Window
Type: Drawing Area

Port: Min Domain
Type: Dial

Lower bound of the domain of the generated colormap.

Port: Max Domain
Type: Dial

Upper bound of the domain of the generated colormap.

Port: Color Band
Type: Option Menu
Menu Item: Red
Menu Item: Green
Menu Item: Blue
Menu Item: Opacity

Curve to edit, hue, saturation, value, or opacity in HSV mode; red, blue, green, or opacity in RGB mode.

Port: Edit Mode
Type: Option Menu
Menu Item: Move
Menu Item: Insert
Menu Item: Delete

Mode of user editing, moving control points, adding new ones, or removing old ones.

Port: Color Space
Type: Option Menu
Menu Item: R-G-B
Menu Item: H-S-V
RGB or HSV color space

Port: Output?
Type: Check Box

Whether to send out the colormap on each change. Outputs automatically when checked.

Port: Channel
Type: Slider

Determines which channel of the Data In lattice to be used for setting the domain.

Port: Pyramid Layer
Type: Slider

Select the layer of the pyramid from which to take the data lattice. Layer 0 is the base lattice which is the most common choice. If a layer is selected that has no data lattice a warning message will appear and the base lattice will be used.

OUTPUTS

Port: Colormap
Type: Lattice
Constraints: 1-D
Constraints: 4-vector
Constraints: float
Constraints: uniform

Output colormap in a lattice.

KNOWN PROBLEMS

UNIX systems only: when using X Pseudo-Color Visuals with limited bit planes, GenerateColormap can fail to allocate the color cells required for its display, and will not display the Palette window.

SEE ALSO

WaveFormColormap, Contour, PyrToGeom, LatToGeom, Render


[Documentation Home]