'\"!  tbl | mmdoc
.if n .pH ref.color @(#)color	40.2
.\" turn off automatic hyphenation -- JHevelin (08-09-89)
.am RT
.nh
..
.SO mstr.hdr
.SO BP.HEADER
.BK "Shapes Reference Manual"
.CH "Cmap Object" 3
.H 1 "Cmap Object" 
.H 2 "Introduction"
.P
.nh
.IX "color map"
.IX "cmap"
.\" BEGIN SHAPES------------------------------------------------
.if !"\*(Lb"Paint" \{\
.br
Shapes supports the indexed color model,
a mapping of color indices into RGB settings.
The Shapes color model is determined by the RAS_CMAP attribute
of the raster.
This section describes how to manipulate the raster's color
map or any other color map object.
.br \}
.\"  ENDIF SHAPES------------------------------------------------
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
.br
Shapes supports two color models,
indexed and direct.
In the indexed color model,
indices are mapped to RGB settings.
In the direct model,
you specify RGB settings directly as colors.
.br \}
.\"  ENDIF Paint------------------------------------------------
.P
By default,
Shapes uses an indexed color map of depth 2 regardless
of the depth of the device.
On all color framebuffers,
index 0 outputs black, RGB setting (0,0,0).
Index 1 outputs white, RGB setting (1,1,1).
On black and white framebuffers,
however, the color interpretation of the indices is
device-dependent.
You can change the color map by defining a new
mapping of RGB settings to indices in the color map.
.P
In the indexed color model,
colors are specified as integer offsets into a color map.
The color map defines the relationship between consecutive
integer indices and the RGB color that is actually painted.
The mapping is defined by a user-specified function.
When an indexed color model is selected,
a hardware color map is used whenever possible.
Otherwise, the color map is maintained in software.
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
.br
.P
In the direct color models,
colors are specified as RGB values of the three primary colors
(red, green, and blue).
You indicate the intensity of each primary color as
a floating point number from 0 to 1,
where a zero indicates no intensity and 1 indicates
the maximum intensity.
If all three colors have equal intensity,
the perceived result is a pure gray.
If the colors are not all equal,
the result is some color that is a function off the
relative intensities of the primaries.
For example:
.TS
box tab(/);
cf4I | cf4I
l | l.
RGB Values/Color
=
1,0,0/Red
1,0.5,0/Orange
1,1,0/Yellow
0,1,0/Green
0,1,1/Cyan
1,0,1/Magenta
0,0,1/Blue
.TE
.P
If the raster device with which the color map is associated
does not support full color,
Shapes simulates the specified color as closely as possible.
.P
On a device of depth one,
it can only represent two colors;
the mapping will ensure that (0,0,0) differs from (1,1,1),
but no other guarantees are made.
On devices of depth 8,
Shapes constructs a color cube with 255 possible variations.
In a color cube,
every RGB combination maps into a series of possibilities
based on the length of the cube's R, G, and B axis.
For example, a color cube for direct color could allow
5 variations in red, 5 in blue,
and 9 in green,
for a total of 225 varying colors.
The color cube does a reasonable job of approximating
the colors you specify.
.br
 \}
.\"  ENDIF Paint-----------------------------------------------
.H 4 NAME
.P
Copy_Cmap \- Copies the attributes of the source color
map into the destination color map.
.IX "Copy_Cmap"
.tm .CE U 3 "Copy_Cmap" \n(PN
.H 4 SYNOPSIS
.P
\f3Copy_Cmap\f2(src, dst)\f1
.br
CMAP src;
.br
CMAP dst;
.H 4 DESCRIPTION
.P
Makes a copy of the attributes of a cmap.
If the destination color map parameter is NULL,
Shapes returns the handle to a new color map that
is a copy of the source.
If a destination color map is specified,
the destination may use a different color model than
the source color map,
but they both must have used,
ultimately, the same raster as the root of a Create_Cmap
invocation.
.P
\f2src\f1
The source color map from which the copy is to be made.
.P
\f2dst\f1
The destination color map to which the copy is made.
If the destination is NULL,
a destination cmap is created.
.H 4 "RETURNED VALUE"
.P
Handle to CMAP copy,
if copy is successful.
.br
[None] if a copy could not be made.
.H 4 "SEE ALSO"
.P
RAS_CMAP
.H 4 NAME
.P
Create_Cmap \- Creates a color map.
.IX "Create_Cmap"
.tm .CE U 3 "Create_Cmap" \n(PN
.H 4 SYNOPSIS
.P
\f3Create_Cmap\f2(root, input, size)\f1
.br
RASTER root;
.br
CMAP root;
.br
COL_type input;
.br
int size;
.H 4 DESCRIPTION
.P
Creates a color map object whose attribute initialization
depends on the \f2root\f1 \(em either a raster or another
color map.
.\" BEGIN SHAPES-----------------------------------------------
.if !"\*(Lb"Paint" \{\
.br
.FG "Color Map Sharing Between Rasters"
.DS
.BP PSART/ps.cmap 4.8i 
.DE
.br \}
.\"  ENDIF SHAPES----------------------------------------------
.P
\f2root\f1
.\" BEGIN SHAPES-----------------------------------------------
.if !"\*(Lb"Paint" \{\
.br
Defines the parent and characteristics of the cmap.
The root may either be a screen raster,
memory raster, or another color map.
.P
If the root is a screen raster,
the color map represents a segment of the
hardware color map associated with that raster.
When creating the initial color map,
use a screen RASTER root to represent the hardware color map.
All subsequent color maps that use this color map as
root represent segments of this original hardware map.
Allocation and management of hardware color map
segments is the responsibility of the caller;
Shapes does not detect overlap or efficiently partition
the hardware color map.
Screen rasters on different displays may not share the
same color map.
Screen rasters on the same display \f2must\fP have cmaps
derived from the same root
(i.e., they use the same hardware color map.)
.P
If the root is a memory raster or screen raster on a
frame buffer without hardware color map support,
the color map created is a software color map.
Memory rasters and/or screen rasters of the same depth
may share a software color map or color maps derived
from the same root.
Rasters of different depths must have different cmap objects,
even if all the CMAP attributes are the same.
A screen raster and a memory raster can share a CMAP
only if they are of the same depth and the screen raster
does not have a hardware color map.
For example, a depth 1 memory raster and a BW2 screen
raster can share the same CMAP,
whereas a CG2 screen raster and a depth8 memory raster cannot.
.P
If the root is a color map,
the created CMAP represents a hardware color map
or a software color map,
depending on ultimate raster root.
Therefore, nothing need be known about a screen
raster to create a color map if a CMAP object is used as the root.
A color map object can be partitioned into other color map objects
without having to understand the characteristics of the underlying
rasters.
.br \}
.\"  ENDIF SHAPES----------------------------------------------
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
.br
Defines the parent and characteristics of the cmap.
The root may either be a window raster,
memory raster, or another color map.
.P
Color maps for window rasters \f2must\fP use roots derived from a window
raster on the same display.
Memory rasters must use roots derived
from memory rasters of the same depth.
.P
The size of the color map you create for a window raster
may effect the smoothness of the color changes between windows.
For example if you create a color map equal in size
to that of your display device's maximum,
you may see color flashes as the windows system switches
out your window raster's color map for a color map or
maps used by other windows.
This strobing effect may also happen for far smaller
color map sizes,
depending on how the window system shares the hardware
color map between windows.
.P
.br \}
.\"  ENDIF Paint-----------------------------------------------
.P
\f2input\f1
.\" BEGIN SHAPES-----------------------------------------------
.if !"\*(Lb"Paint" \{\
.br
\f1Selects the type of color model and defines the initial
value of the attribute CMAP_INPUT.
In Shapes, the only possible choice is COL_INDEX.
This implies that the color mapping function,
CMAP_FUNC, will map from indexed color to RGB.
.br \}
.\"  ENDIF SHAPES----------------------------------------------
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
.br
Selects the type of color model and defines the initial
value of the attribute CMAP_INPUT.
.TS
box tab(/);
cf4I | cf4I
l | l.
Setting/Description
=
COL_INDEX/Selects the indexed color model.
COL_RGB/T{
Selects the direct color model.
On devices that do not support direct color,
Shapes maps the RGB colors into a color cube.
T}
.TE
.br \}
.\"  ENDIF Paint-----------------------------------------------
.P
\f2size\f1
.br
Specifies the initial size (number of colors) of the
color map and initializes CMAP_SIZE to this value.
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
.br
You can request direct color by setting the \f2input\f1
parameter to COL_RGB,
specify 0 for the \f2size\f1 parameter.
.br \}
.\"  ENDIF Paint-----------------------------------------------
.H 4 "RETURNED VALUE"
.P
CMAP
.br
Null is returned if a CMAP cannot be created.
.H 4 "SEE ALSO"
.P
Destroy_Cmap
.br
Temp_Cmap
.br
CMAP_FUNC
.br
CMAP_INPUT
.H 4 "NAME"
.P
Destroy_Cmap \- Destroys the specified color map.
.IX "Destroy_Cmap"
.tm .CE U 3 "Destroy_Cmap" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Destroy_Cmap\f2(cmap)\f1
.br
CMAP cmap;
.H 4 "DESCRIPTION"
.P
If other objects refer to the color map,
the resources are not freed until the
references are removed.
.P
\f2cmap\f1
Specifies the color map to be destroyed.
.P
NOTE: It is an error to reference an object after it
has been destroyed.
.H 4 "RETURNED VALUE"
.P
[None]
.H 4 "SEE ALSO"
.H 4 "NAME"
.P
Get_Cmap \- Returns the setting of an attribute.
.IX "Get_Cmap"
.tm .CE U 3 "Get_Cmap" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Get_Cmap\f2(cmap, attr)\f1
.br
CMAP cmap;
.br
CMAP_attr attr;
.H 4 "DESCRIPTION"
.P
Returns the setting of the specified cmap attribute.
.P
\f2cmap\f1
The color map from which the attribute setting is extracted.
.P
\f2attr\f1
The attribute for which the setting is returned.
.H 4 "RETURNED VALUE"
.P
Attribute type
.H 4 "SEE ALSO"
.P
CMAP Attributes
.H 4 "NAME"
.P
Read_Cmap \- Reads the cmap data into a user data structure.
.IX "Read_Cmap"
.tm .CE U 3 "Read_Cmap" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Read_Cmap\f2(cmap, data, format)\f1
.br
CMAP cmap;
.br
char *data;
.br
CMAP_FORMAT format;
.H 4 "DESCRIPTION"
.P
Reads the cmap data into a user/unpacked data structure.
.P
\f2cmap\f1
The cmap to be read.
.P
\f2data\f1
A pointer to either the data structure CMAP_RGB_UNPACKED
or CMAP_RGB_PACKED.
The data structure describes where to find allocated
memory for storing the red, green,
and blue values of the color map
(struct elements \f2red\fP, \f2green\fP,
and \f2blue\fP for unpacked,
or element \f2rgb\fP for packed),
where in the color map to begin reading data
(element \f2index\fP),
and how many values to read
(element \f2count\fP).
The pointers in the requested format must be valid pointers to
a data array that holds \f2count\fP cmap data values.
.P
The structure of \f2data\fP is defined for the format
CMAP_UNPACKED_RGB as follows:
.PC
typedef       struct
  {
    short     index;          /* starting cmap index */
    short     count;          /* number of cmap locations */
    short     *red;           /* list of RED values */
    short     *green;         /* list of GREEN values */
    short     *blue;          /* list of BLUE values */
  } *CMAP_RGB_UNPACKED;
.ft1
.SF
.P
The structure of \f2data\fP is defined for the format
CMAP_PACKED_RGB in the following box.
The struct element array \f2rgb\fP is divided up as 0BGR,
where R is the least significant byte of each 32 bit value.
.PC
typedef       struct
  {
    short     index;          /* starting cmap index */
    short     count;          /* number of cmap locations */
    unsigned long   *rgb;     /* list of 0/B/G/R values */
  }*CMAP_RGB_PACKED;
.ft1
.SF
.P
\f2format\f1
Indicates to Shapes whether the data is to be read out
in a packed on unpacked format.
.TB "Read_Cmap Formats"
.TS
box tab(/);
cf4I | cf4I
l | l.
Format/Description
=
CMAP_UNPACKED_RGB/T{
Red, green, and blue point to arrays of separate red,
green, and blue values
T}
_
CMAP_PACKED_RGB/T{
RGB points to an integer array of packed RGB values,
packed in 0/B/G/R order within each integer
T}
.TE
.H 4 "RETURNED VALUE"
.P
[None]
.H 4 "SEE ALSO"
.P
Write_Cmap
.br
Set_Raster
.br
CMAP_FUNC
.H 4 "NAME"
.P
Set_Cmap \- Sets the current type of an attribute.
.IX "Set_Cmap"
.tm .CE U 3 "Set_Cmap" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Set_Cmap\f2(cmap, attr, setting)\f1
.br
CMAP cmap;
.br
CMAP_attr attr;
.br
<attribute type> setting;
.H 4 "DESCRIPTION"
.P
Sets a color map attribute.
.P
\f3NOTE:\f1  After you finish setting color map attributes,
you must
explicitly set RAS_CMAP to load your changes into the hardware.
.P
\f2cmap\f1
The cmap for which the attributes are to be set.
.P
\f2attr\f1
The attribute to be set.
.P
\f2setting\f1
The setting for the specified attribute.
.H 4 "RETURNED VALUE"
.P
[None]
.H 4 "SEE ALSO"
.P
CMAP Attributes
.H 4 "NAME"
.P
Temp_Cmap \- Creates a color map with no references.
.IX "Temp_Cmap"
.tm .CE U 3 "Temp_Cmap" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Temp_Cmap\f2(root, input, size)\f1
.br
CMAP root;
.br
COL_type input;
.br
int size;
.H 4 "DESCRIPTION"
.P
Creates a color map object whose attribute initialization
depends on the \f2root\f1 \(em either a raster or another color map.
Temp_Cmap differs only in one respect from Create_Cmap:\ \&
the initial reference count is set to zero.
.P
\f2root\f1
Defines the object where the color map inherits some
of its attributes.
.P
\f2input\f1
Selects the type of color model and defines the initial
value of the attribute CMAP_INPUT.
.P
\f2size\f1
Specifies the initial depth of the color map and initializes
CMAP_DEPTH to that size.
.H 4 "RETURNED VALUE"
.P
CMAP
.H 4 "SEE ALSO"
.P
Destroy_Cmap
.br
Create_Cmap
.br
CMAP_FUNC
.br
CMAP_INPUT
.H 4 "NAME"
.P
Write_Cmap \- Updates the cmap data from a user data structure.
.IX "Write_Cmap"
.tm .CE U 3 "Write_Cmap" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Write_Cmap\f2(cmap, data, format)\f1
.br
CMAP cmap;
.br
CMAP_data data;
.br
CMAP_FORMAT format;
.H 4 "DESCRIPTION"
.P
Updates the cmap data without actually loading the hardware cmap
(if one exists).
Setting the RAS_CMAP attribute installs the hardware cmap.
Using Write_Cmap with a particular color map disables
the CMAP_FUNC attribute of that color map,
so that it is no longer called when the color map is installed.
The CMAP_FUNC attribute may be reenabled for the color
map by resetting that attribute.
.P
\f2cmap\f1
The cmap to be updated.
.P
\f2data\f1
A pointer to either the data structure CMAP_RGB_UNPACKED
or CMAP_RGB_PACKED.
The data structure describes:\ \&
1) where to find allocated memory that stores red, green,
and blue values to be written into the color map
(struct elements \f2red\fP, \f2green\fP,
and \f2blue\fP for unpacked,
or element \f2rgb\fP for packed),
2) where in the color map to begin writing data
(element \f2index\fP),
and 3) how many values to write (element \f2count\fP).
The pointers in the requested format must be valid pointers to
a data array that holds \f2count\fP cmap data values.
.P
The structure of \f2data\fP is defined for the format
CMAP_UNPACKED_RGB as follows:
.PC
typedef       struct
  {
    short     index;          /* starting cmap index */
    short     count;          /* number of cmap locations */
    short     *red;           /* list of RED values */
    short     *green;         /* list of GREEN values */
    short     *blue;          /* list of BLUE values */
  } *CMAP_RGB_UNPACKED;
.ft1
.SF
.P
The structure of \f2data\fP is defined for the format
CMAP_PACKED_RGB in the following box.
The struct element array \f2rgb\fP is divided up as 0/B/G/R,
where R is the least significant byte of each 32-bit value.
.PC
typedef       struct
  {
    short     index;          /* starting cmap index */
    short     count;          /* number of cmap locations */
    unsigned long   *rgb;     /* list of 0/B/G/R values */
  }*CMAP_RGB_PACKED;
.ft1
.SF
.P
\f2format\f1
Indicates whether the data is in a packed on unpacked format.
.TB "Write_Cmap Functions"
.TS
box tab(/);
cf4I | cf4I
l | l.
Format/Description
=
CMAP_UNPACKED_RGB/T{
Red, green, and blue point to arrays of separate red,
green, and blue values
T}
_
CMAP_PACKED_RGB/T{
Points to an integer array of packed rgb values,
packed in 0 B G R order within each integer
T}
.TE
.H 4 "RETURNED VALUE"
.P
[None]
.H 4 "SEE ALSO"
.P
Read_Cmap
.br
Set_Raster
.br
CMAP_FUNC
.H 2 "Color Macros"
.H 4 "NAME"
.P
Color_Index \- Initializes a COLOR structure to represent a color index.
.IX "Color_Index"
.tm .CE U 3 "Color_Index" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Color_Index\f2(c, n)\f1
.br
COLOR *c;
.br
int n;
.H 4 "DESCRIPTION"
.P
Initializes the color structure to be of type COL_INDEX
and index \f2n\f1\&.
Return value is the pointer to the color structure.
.P
\f2*c\f1
Pointer to color structure.
Prior to using the macro,
you must have already allocated a COLOR structure.
.P
\f2n\f1
The numeric setting representing the index.
No checking is done against a specific CMAP object.
Be careful that \f2n\fP does not exceed the number of
entries in the CMAP with which this color will be used.
.H 4 "RETURNED VALUE"
.P
COLOR *
.H 4 "SEE ALSO"
.P
Get_Col_Index
.br
CMAP_FUNC
.br
CTX_COLOR
.br
CTX_BACK_COLOR
.H 4 "NAME"
.P
Color_RGB \- Initializes an RGB color structure.
.IX "Color_RGB"
.tm .CE U 3 "Color_RGB" \n(PN
.H 4 "SYNOPSIS"
\f3Color_RGB\f2(c, r, g, b)\f1
.P
COLOR *c;
.br
float r;
.br
float g;
.br
float b;
.H 4 "DESCRIPTION"
.P
Initializes the color structure to be of type COL_RGB
and sets it to the specified red, green, and blue parameters.
Use this macro to describe the color map output mapping
for indexed color.
This macro is typically used with CMAP_FUNC to describe
the returned RGB components.
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
.P
Also use this macro to specify direct colors for use
as embedded colors in a path or as context colors.
.br \}
.\"  ENDIF Paint-----------------------------------------------
.P
\f2*c\f1
Pointer to color structure.
Prior to using the macro,
you must have already allocated a COLOR structure.
.P
\f2r\f1
The red setting,
a floating point value between 0 and 1.
.P
\f2g\f1
The green setting,
a floating point value between 0 and 1.
.P
\f2b\f1
The blue setting,
a floating point value between 0 and 1.
.H 4 "RETURNED VALUE"
.P
Integer
.H 4 "SEE ALSO"
.P
Get_Col_RGB
.br
CMAP_FUNC
.br
CTX_COLOR
.br
CTX_BACK_COLOR
.H 4 "NAME"
.P
Get_Col_Index \- Returns the index of the color.
.IX "Get_Col_Index"
.tm .CE U 3 "Get_Col_Index" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Get_Col_Index\f2(c)\f1
.br
COLOR *c;
.H 4 "DESCRIPTION"
.P
Returns the index of the color,
if it is of the type COL_INDEX.
If the color is not of type COL_INDEX,
an error is not detected or reported and an
undefined value is returned.
Use Get_Col_Type to affirm that the color is of
type COL_INDEX before using this macro.
.P
\f2*c\f1
Pointer to color structure.
Prior to using the macro,
you must have already allocated a COLOR structure.
.H 4 "RETURNED VALUE"
.P
COLOR *
.H 4 "SEE ALSO"
.P
Get_Col_Type
.br
Color_Index
.br
Color_RGB
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
.br
.H 4 "NAME"
.P
Get_Col_RGB \- Assigns the settings of an RGB color to the float parameters.

.IX Get_"Color_RGB"
.tm .CE U 3 "Get_Col_RGB" \n(PN
.H 4 "SYNOPSIS"
\f3Get_Col_RGB\f2(c,r,g,b)\f1
.P
COLOR *c;
.br
float r;
.br
float g;
.br
float b;
.H 4 "DESCRIPTION"
.P
Assigns the settings of an RGB color to the float parameters.
Use to query the RGB components of a color structure.
If the color is not of type COL_RGB,
no error is detected or reported and an undefined value is returned.
Use Get_Col_Type to affirm that the color is of type
COL_RGB before using this macro.
.P
\f2*c\f1
Pointer to color structure.
Prior to using the macro,
you must have already allocated a COLOR structure;
.P
\f2r\f1
Stores the red value,
as a float in the range of 0 to 1.
.P
\f2g\f1
Stores the green value,
as a float in the range of 0 to 1.
.P
\f2b\f1
Stores the blue value,
as a float in the range of 0 to 1.
.H 4 "RETURNED VALUE"
.P
[None]
.H 4 "SEE ALSO"
.P
Get_Col_Type
.br
Get_Col_Index
.br
Color_RGB
.H 4 "NAME"
.P
Get_Col_Type \- Returns the type of color.
.IX "Get_Col_Type"
.tm .CE U 3 "Get_Col_Type" \n(PN
.H 4 "SYNOPSIS"
.P
\f3Get_Col_Type\f2(c)\f1
.br
COLOR * c;
.H 4 "DESCRIPTION"
.P
Returns the color type,
either COL_INDEX or COL_RGB.
.P
\f2*c\f1
Pointer to color structure.
Prior to using the macro,
you must have already allocated a COLOR structure;
.H 4 "RETURNED VALUE"
.P
Integer
.H 4 "SEE ALSO"
.P
Get_Col_Index
.br
Color_Index
.br
Get_Col_RGB
.br
Color_RGB
.br \}
.\"  ENDIF Paint------------------------------------------------
.H 2 "Cmap Attributes"

.H 4 "NAME"
.P
CMAP_FUNC
.IX "CMAP_FUNC"
.tm .CE U 3 "CMAP_FUNC" \n(PN
.H 4 "DESCRIPTION"
.P
CMAP_FUNC is a pointer to a user-defined function that
accepts colors defined by CMAP_INPUT and returns colors
defined by CMAP_OUTPUT.
The color mappings are calculated based on this function.
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
Since the  function is only called when the indexed color model is in use,
it is always a function mapping color indices into RGB values.
\}
.\"  ENDIF Paint-----------------------------------------------
The function is called once for every entry in the color map.
(The number of color map entries is determined by the
CMAP_SIZE attribute.)
.P
The CMAP_FUNC is typically called when RAS_CMAP is set,
but not necessarily every time the attribute is updated.
If you update CMAP_FUNC,
be sure to reload this color map by explicitly setting
RAS_CMAP to it again.
Keep in mind that the CMAP_FUNC may also be called more
frequently than just when the color map is loaded.
.P
The calling convention for the function CMAP_FUNC points to is:
.P
COLOR *cmap_func((CMAP)cmap, (COLOR *)incol)\fP
.P
\f2cmap\f1
The CMAP object for which this function is called.
.P
\f2incol\f1
The pointer to a color structure of type COL_INDEX.
.H 4 "RETURNED VALUE"
.P
COLOR *cmap_func()
.P
Pointer to a COLOR structure of type COL_RGB,
mapping the input index value to an RGB color.
Since the address of this color is being returned,
you must declare it as a \f2static\fP variable in CMAP_FUNC
mapping function.
.H 4 "SEE ALSO"
.P
Read_Cmap
.br
Write_Cmap
.br
Color_RGB
.br
Color_Index
.br
Get_Col_Index
.H 4 "NAME"
.P
CMAP_INPUT
.IX "CMAP_INPUT"
.tm .CE U 3 "CMAP_INPUT" \n(PN
.H 4 "DESCRIPTION"
.P
Color map input format.
.P
.\" BEGIN SHAPES------------------------------------------------
.if !"\*(Lb"Paint" \{\
.br
COL_INDEX is the only type.
.br \}
.\"  ENDIF SHAPES------------------------------------------------
.\" BEGIN Paint------------------------------------------------
.if "\*(Lb"Paint" \{\
.br
.TS
box tab(/);
cf4I | cf4I
l | l.
Type/Description
=
COL_INDEX/Indexed color model
COL_RGB/Direct color model
.TE
.br \}
.\"  ENDIF Paint------------------------------------------------

.H 4 "RETURNED VALUE"
.P
COL_type
.H 4 "SEE ALSO"
.P
CMAP_OUTPUT
.br
CMAP_FUNC
.br
Create_Cmap
.br
Get_Col_Type
.\" BEGIN SHAPES-----------------------------------------------
.if !"\*(Lb"Paint" \{\
.br
.H 4 "NAME"
.P
CMAP_OFFSET
.IX "CMAP_OFFSET"
.tm .CE U 3 "CMAP_OFFSET" \n(PN
.H 4 "DESCRIPTION"
.P
Index specifying the beginning of the color map.
.H 4 "RETURNED VALUE"
.P
Integer
.H 4 "SEE ALSO"
.P
Create_Cmap
.br
Read_Cmap
.br
Write_Cmap
.br \}
.\"  ENDIF SHAPES----------------------------------------------
.H 4 "NAME"
.P
CMAP_OUTPUT
.IX "CMAP_OUTPUT"
.tm .CE U 3 "CMAP_OUTPUT" \n(PN
.H 4 "DESCRIPTION"
.P
Color map output format.
The only format is COL_RGB.
.H 4 "RETURNED VALUE"
.P
COL_type
.H 4 "SEE ALSO"
.P
CMAP_INPUT
.br
CMAP_FUNC
.H 4 "NAME"
.P
CMAP_SIZE
.IX "CMAP_SIZE"
.tm .CE U 3 "CMAP_SIZE" \n(PN
.H 4 "DESCRIPTION"
.P
Number of entries in the color map at time of creation.
.H 4 "RETURNED VALUE"
.P
Integer
.H 4 "SEE ALSO"
.P
CMAP_FUNC
.br
Create_Cmap
.br
Read_Cmap
.br
Write_Cmap
.\" BEGIN SHAPES------------------------------------------------
.if !"\*(Lb"Paint" \{\
.H 4 "NAME"
.P
CMAP_RASTER
.IX "CMAP_RASTER"
.tm .CE U 3 "CMAP_RASTER" \n(PN
.H 4 "DESCRIPTION"
.P
The raster with which the color map was originally created.
This is the ``root'' argument which was passed to Create_Cmap.
.H 4 "RETURNED VALUE"
.P
RASTER
.H 4 "SEE ALSO"
.P
Create_Cmap
\}
.\"  ENDIF SHAPES------------------------------------------------
