INQUIRE LIGHT SOURCE REPRESENTATION(3P+) — Kubota Pacfic Computer Inc. (29 February 1991)
NAME
INQUIRE LIGHT SOURCE REPRESENTATION − inquire light source representation for a given workstation
SYNOPSIS
C Syntax
void
pinq_light_src_rep ( ws, index, type, error_ind, rep )
Pintws;workstation identifier
Pintindex;light source index
Pinq_typetype;type of returned value
Pint∗error_ind;OUT error indicator
Plight_src_bundle∗rep; OUT light source representation
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
INQUIRE LIGHT SOURCE REPRESENTATION returns the attribute values of a specified entry in a workstation extended light source bundle table. See SET LIGHT SOURCE REPRESENTATION for a full description of the contents of the bundle table entry and a description of the extended light source bundle table.
C Input Parameters
wsThe workstation identifier.
indexThe light source index.
typeAn enumerated value specifying whether the values to be returned are those originally specified by the application (PINQ_SET), or those resulting after PHIGS mapped them to ones available on the workstation (PINQ_REALIZED). A Pinq_type structure is defined as:
typedef enum {
PINQ_SET,
PINQ_REALIZED
} Pinq_type;
C Output Parameters
error_ind
A pointer to the location to store the error number of any error detected by this function.
repA pointer to the location in which to return the light source representation. The Plight_src_bundle data structure contains values needed to define the specified type of light source representation. Plight_src_bundle is defined as:
typedef struct {
Pinttype;/∗ light source type ∗/
Plight_src_recrec; /∗ light source data record ∗/
} Plight_src_bundle;
Plight_src_rec is defined as:
typedef union {
Pamb_light_src_recambient;
Pdir_light_src_recdirectional;
Ppos_light_src_recpositional;
Pspot_light_src_recspot;
} Plight_src_rec;
Pamb_light_src_rec is defined as:
typedef struct {
Pgcolrcolr;/∗ light source colour ∗/
} Pamb_light_src_rec;
Pgcolr is defined as:
typedef struct {
Pinttype;/∗ indirect, RGB, CIE, HSV, HLS ∗/
union {
Pintind;/∗ index in workstation colour bundle table ∗/
struct {
Pfloatx;/∗ red, hue, etc. ∗/
Pfloaty;/∗ green, saturation, lightness, etc. ∗/
Pfloatz;/∗ blue, value, saturation, etc. ∗/
} general;
} val;
} Pgcolr;
Pdir_light_src_rec is defined as:
typedef struct {
Pgcolrcolr;/∗ light source colour ∗/
Pvec3dir;/∗ light source direction ∗/
} Pdir_light_src_rec;
Pvec3 is defined as:
typedef struct {
Pfloatdelta_x;/∗ x magnitude ∗/
Pfloatdelta_y;/∗ y magnitude ∗/
Pfloatdelta_z;/∗ z magnitude ∗/
} Pvec3;
Ppos_light_src_rec is defined as:
typedef struct {
Pgcolrcolr;/∗ light source colour ∗/
Ppoint3pos;/∗ light source position ∗/
Pfloatcoef[2];/∗ attenuation coefficients ∗/
} Ppos_light_src_rec;
Ppoint3 is defined as:
typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
} Ppoint3;
Pspot_light_src_rec is defined as:
typedef struct {
Pgcolrcolr;/∗ light source colour ∗/
Ppoint3pos;/∗ light source position ∗/
Pvec3dir;/∗ light source direction ∗/
Pfloatexp;/∗ concentration exponent ∗/
Pfloatcoef[2];/∗ attenuation coefficients ∗/
Pfloatangle;/∗ spread angle ∗/
} Pspot_light_src_rec;
Execution
If the specified light source index is not present in the light source table on the workstation and the specified type of returned value is Realized, the representation for light source index one is returned.
If the inquired information is not available, the values returned in the output parameters are undefined and the error indicator is set to one of the following error numbers to indicate the reason for nonavailability.
Since this is an inquiry function, ERROR HANDLING is not invoked when an error is detected by this function.
ERRORS
003Ignoring function, function requires state (PHOP,WSOP,∗,∗)
054Ignoring function, the specified workstation is not open
059Ignoring function, the specified workstation does not have output capability (i.e. the workstation category is neither OUTPUT, OUTIN, nor MO)
101Ignoring function, the specified representation has not been defined
614Ignoring function, the light source index is less than one
SEE ALSO
SET LIGHT SOURCE STATE (3P+)
SET LIGHT SOURCE REPRESENTATION (3P+)
INQUIRE LIST OF LIGHT SOURCE INDICES (3P+)
INQUIRE LIGHT SOURCE FACILITIES (3P+)
INQUIRE PREDEFINED LIGHT SOURCE REPRESENTATION (3P+)
September 02, 1992