pe_setup_pseudo_colr(3g) — Subroutines
Name
pe_setup_pseudo_colr − Creates an array of colors of constant hue and saturation but varying luminance, and sets the weight vector.
Operating States: PHOP, WSOP, ∗, ∗
Digital PHIGS extension function
Syntax
void pe_setup_pseudo_colr (
Pint wsid, /∗ (I) Workstation identifier ∗/
Pcolr_rep ∗colours, /∗ (I) Input color value in red, green,
and blue (RGB) ∗/
Ppseudo_approx_rec ∗datarec /∗ (M) Computed data record ∗/
)
Data Structures
typedef union {
Prgb rgb; /∗ red, green, and blue color specification ∗/
Pcieluv cieluv; /∗ CIELUV color specification ∗/
Phls hls; /∗ hue, lightness, and saturation color
specification ∗/
Phsv hsv; /∗ hue, saturation, and value color
specification ∗/
Pdata unsupp; /∗ color in an unsupported color model ∗/
int impl_dep; /∗ implementation-defined ∗/
} Pcolr_rep;
typedef struct {
Pfloat red; /∗ red intensity ∗/
Pfloat green; /∗ green intensity ∗/
Pfloat blue; /∗ blue intensity ∗/
} Prgb;
typedef struct {
Pfloat cieluv_x; /∗ x coefficient ∗/
Pfloat cieluv_y; /∗ y coefficient ∗/
Pfloat cieluv_y_lum; /∗ y luminance ∗/
} Pcieluv;
typedef struct {
Pfloat hue; /∗ hue ∗/
Pfloat lightness; /∗ lightness ∗/
Pfloat satur; /∗ saturation ∗/
} Phls;
typedef struct {
Pfloat hue; /∗ hue ∗/
Pfloat satur; /∗ saturation ∗/
Pfloat value; /∗ value ∗/
} Phsv;
typedef struct {
size_t size; /∗ size of data ∗/
void ∗data; /∗ pointer to the data ∗/
} Pdata;
typedef struct { /∗ pseudo color approximation ∗/
Pint range; /∗ number of colors ∗/
Pfloat weight[3]; /∗ weight vector ∗/
Pint model; /∗ color model ∗/
Pcolr_rep ∗colr; /∗ color map ∗/
} Ppseudo_apprfqox_rec;
Description
pe_setup_pseudo_colr creates an array of colors of constant hue and saturation but varying in luminance from dark to light, and sets the weight vector as appropriate. The function returns the color map and the weight vector in the data record. Digital PHIGS generates the color map by holding constant the hue and saturation of colors and varying the luminance from 0.0 to 1.0. Digital PHIGS sets the weight vector to (one-third, one-third, one-third).
Digital PHIGS applies the weight vector to the resultant color in the output pipeline after the lighting and shading phase in the following manner:
luminance = red_component ∗ weight(0) +
blue_component ∗ weight(1) +
green_component ∗ weight(2)
Digital PHIGS uses the luminance from the previous equation as an index into the pseudo color map for the final color.
The application can install the color map by calling the pe_set_pseudo_colr function.