DdSetShadeRanges(3D) — Kubota Pacfic Computer Inc. (\*(Dd)
NAME
DdSetShadeRanges − Set one or more shade range table entries of a device
SYNOPSIS
C:
void DdSetShadeRanges(device, start, count, entries)
DtObject device;
DtInt start;
DtInt count;
DtInt entries[];
FORTRAN:
CALL DDSSR(DEVICE, START, COUNT, ENTRYS)
INTEGER∗4 DEVICE
INTEGER∗4 START
INTEGER∗4 COUNT
INTEGER∗4 ENTRYS(COUNT∗2)
DESCRIPTION
DdSetShadeRanges sets one or more shade range table entries on the device, device. The shade range table is used when a device is in pseudocolor mode and the shademode is set to DcRange <DCRNG>. Each entry in the shade range table consists of a pair of values defining a shade range that specifies a range in the color table entries into which computed intensities map. Intensities between 0.0 and 1.0 are used to linearly interpolate between the two specified limits in the color lookup table. This interpolated color table index is then sent to the device’s frame buffer.
The parameter start specifies the first entry to be set. The parameter count specifies the number of entries to be written. The parameter entries is an array containing the new range boundaries.
To use this mode, the application should subdivide the color map into a set of shade ranges. Each color table entry within the range has the same base color (hue) but has steadily increasing intensity as the index goes from the first entry in the range to the last.
For example, consider an image of a mechanical part consisting of three colors: bronze, silver and grey. Instead of having unused colors in the color map, the application can use shade ranges to partition the color map into the necessary shades of bronze, silver and grey. When a shade is computed by the renderer, it is converted to an intensity between 0.0 and 1.0 that interpolates between the entries of the current shade range (set by DoShadeIndex <DOSI>). The application program then uses DdSetShadeRanges <DDSSR> to define three shade ranges:
Shade range 1 specifying the minimum and maximum entries for bronze.
Shade range 2 specifying the minimum and maximum entries for silver.
Shade range 3 specifying the minimum and maximum entries for grey.
The shade index primitive attribute is used to select a particular shade range; see DoShadeIndex.
Because the actual size of each color table is specified for each device, an application can adapt the color table to eliminate unneeded entries. The number of entries used by each shade range can be based on the importance of the shade to the image and the size of the device color lookup table. If the image is being displayed on several devices, each with color lookup tables of different sizes, the number of elements in each shade range can be adjusted appropriately.
ERRORS
DdSetShadeRanges will fail if the device handle is invalid.
[WARNING - invalid device handle]
DdSetShadeRanges will fail if the start or count parameters refer to entries outside the shade range table boundaries.
[WARNING - bad start and/or count values]
SEE ALSO
DdInqColorEntries(3D), DdInqColorTableSize(3D), DdInqShadeMode(3D), DdInqShadeRanges(3D), DdInqVisualType(3D), DdSetColorEntries(3D), DdSetShadeMode(3D), DoShadeIndex(3D)
September 02, 1992