void pset_light_source_rep(
Pint ws_id, /* workstation identifier */ Pint index, /* light source index */ const Plight_source_rep *rep; /* light source representation */
)
typedef struct {
Pint type; /* light source type */
union Plight_source_rep_data {
struct Plight_source_rep_amb {
Pgcolr colr;
} amb;
struct Plight_source_rep_dir {
Pgcolr colr;
Pvec3 dir;
} dir;
struct Plight_source_rep_pos {
Pgcolr colr;
Ppoint3 pos;
Pfloat c1;
Pfloat c2;
} pos;
struct Plight_source_rep_spot {
Pgcolr colr;
Ppoint3 pos;
Pvec3 dir;
Pfloat concent_exp;
Pfloat c1;
Pfloat c2;
Pfloat spread_angle;
} spot;
} data;
} Plight_source_rep;
typedef struct {
Pint colr_type; /* colour type */
Pcolrv colr_value; /* colour value */
} Pgcolr;
typedef union {
Pint colr_ind; /* colour index */
Pcolr_rep colr_rep; /* colour representation */
} Pcolrv;
typedef union {
Prgb rgb; /* red green blue colour specification */
Pcieluv cieluv; /* CIE L*u*v* colour specification */
Phls hls; /* hue lightness saturation colour specification */
Phsv hsv; /* hue saturation value colour specification */
} Pcolr_rep;
The rep values are placed in the light source bundle table at index in the workstation state list.
The light source bundle table is initialized from the ws_id workstation description table
Light source TYPES are:
PLIGHT_SOURCE_AMB ambient
PLIGHT_SOURCE_DIR directional
PLIGHT_SOURCE_POS positional
PLIGHT_SOURCE_SPOT spot
During structure traversal, the current light source state in the traversal state list is used to select zero or more entries in the light source table of a workstation. Entries in the current light source state, that are not defined in a workstation's light source table are ignored.
During structure traversal, if the colour type of any selected light source representation is indirect, and the colour index is not defined on the workstation, colour index 1 is used for that light source.
set light source state, set individual asf, inquire light source representation, inquire predefined light source representation, inquire light source facilities, inquire workstation state table length plus