INQUIRE COLOUR MAPPING REPRESENTATION(3P+) — Kubota Pacfic Computer Inc. (29 February 1991)
NAME
INQUIRE COLOUR MAPPING REPRESENTATION − inquire a colour mapping representation for a given workstation
SYNOPSIS
C Syntax
void
pinq_colr_map_rep ( ws, index, type, store, error_ind, map_method, map_data )
Pintws;workstation identifier
Pintindex;colour mapping index
Pinq_typetype;type of returned value
Pstorestore;handle to Store object
Pint∗error_ind;OUT error indicator
Pint∗map_method;OUT mapping method
Pcolr_map_data∗∗map_data; OUT mapping method data record
Required PHIGS Operating States
(PHOP,WSOP, ∗, ∗)
DESCRIPTION
Purpose
INQUIRE COLOUR MAPPING REPRESENTATION returns a specified colour mapping table entry in a workstation’s state list.
C Input Parameters
Applications using the C binding must create a buffer to be used by this function as memory space for storing data associated with the device state. This buffer is passed as the store argument.
The store buffer is a data area managed by PHIGS. While the application is responsible for creating the inital buffer through a call to CREATE STORE, PHIGS manages this area such that there is sufficient memory for the specific inquiry. The data record within the store buffer is accessed by the pointer pointed to by map_data.
wsThe workstation identifier.
indexThe colour mapping table index of the entry to return.
typeAn enumerated value specifying whether the values to be returned are those originally specified by the application (PSET), or those resulting after PHIGS mapped them to ones available on the workstation (PREALIZED). A Pinq_type structure is defined in phigs.h as:
typedef enum {
PSET,
PREALIZED
} Pinq_type;
storeThe memory buffer PHIGS is to use for storing the information returned. This buffer must exist prior to calling this function (see CREATE STORE (3P)).
C Output Parameters
error_ind
A pointer to the location to store the error number of any error detected by this function.
map_method
A pointer to the location to store the colour mapping method of the represenation. The colour mapping methods are defined in phigs.h as follows: 1 PCOLR_MAP_TRUE 2 PCOLR_MAP_PSEUDO 3 PCOLR_MAP_PSEUDO_N
map_data
A pointer to a pointer to a Pcolr_map_data structure that contains the information specific to the data mapping method. PHIGS will allocate space for the structure in the Pstore object and return the pointer to that allocated space in this parameter. Pcolr_map_data is defined in phigs.h as follows:
typedef union {
struct {
Pintcolr_model;
Pfloat_listweights;
Pcolr_rep_list colrs;
} method_r2
struct {
Pintcolr_model;
Pfloat_list_list colr_lists;
} method_r3
} Pcolr_map_data;
Pfloat_list is defined in phigs.h as follows:
typedef struct {
Pintnum_floats;/∗ number of Pfloats in list ∗/
Pfloat∗floats;/∗ list of floats ∗
} Pfloat_list;
Pfloat_list_list is defined in phigs.h as follows:
typedef struct {
Pintnum_lists;/∗ number of lists in list ∗/
Pfloat_list∗lists;/∗ list of float lists ∗/
} Pfloat_list_list;
Pcolr_rep_list is defined in phigs.h as follows:
typedef struct {
Pintnum_colr_reps;/∗ number of colours ∗/
Pcolr_rep∗colr_reps;/∗ array of colours ∗/
} Pcolr_rep_list;
Pcolr_rep is defined in phigs.h as follows:
typedef union {
Prgbrgb;/∗ Red Green Blue colour specification ∗/
Pcieluvcieluv;/∗ CIE L∗U∗V∗ colour specification ∗/
Phlshls;/∗ Hue Lightness Saturation colour specification ∗/
Phsvhsv;/∗ Hue Saturation Value colour specification ∗/
Pdataunsupp;/∗ Colour in unsupported colour model ∗/
} Pcolr_rep;
Prgb is defined in phigs.h as follows:
typedef struct {
Pfloatred;/∗ red, hue, etc ∗/
Pfloatgreen;/∗ green, saturation, lightness, etc ∗/
Pfloatblue;/∗ blue, value, saturation, etc ∗/
} Prgb;
Pcieluv is defined in phigs.h as follows:
typedef struct {
Pfloatcieluv_x;/∗ x coefficient ∗/
Pfloatcieluv_y;/∗ y coefficient ∗/
Pfloatcieluv_y_lum; /∗ y luminance ∗/
} Pcieluv;
Phsv is defined in phigs.h as follows:
typedef struct {
Pfloathue;/∗ hue ∗/
Pfloatsatur;/∗ saturation ∗/
Pfloatvalue;/∗ value ∗/
} Phsv;
Phls is defined in phigs.h as follows:
typedef struct {
Pfloathue;/∗ hue ∗/
Pfloatlightness;/∗ lightness ∗/
Pfloatsatur;/∗ saturation ∗/
} Phls;
Pdata is defined in phigs.h as follows:
typedef struct {
size_tsize;/∗ size of data ∗/
char∗data/∗pointer to data ∗/
} Pdata;
There is no data associated with mapping method PCOLR_MAP_TRUE. The data for method PCOLR_MAP_PSEUDO is a list of weights and a list of direct colours. colr_model specifies the type of colours given in the list of colours, colrs. The colour models are defined in phigs.h as follows:
1PMODEL_RGB
2PMODEL_CIELUV
3PMODEL_HSV
4PMODEL_HLS
The data for mapping method PCOLR_MAP_PSEUDO_N is N lists of direct colours. These colours may be of the same types as for PCOLR_MAP_PSEUDO.
Execution
If the inquired information is available, the error indicator is returned as zero and values are returned in the output parameters.
If the specified colour mapping index is not present in the colour mapping table on the workstation and the specified type of returned value is Realized, the representation for the colour mapping index zero 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 (that is, the workstation category is neither OUTPUT nor OUTIN)
101Ignoring function, the specified representation has not been defined
121Ignoring function, the colour mapping index is less than zero
SEE ALSO
SET COLOUR MAPPING REPRESENTATION (3P+)
SET COLOUR MAPPING INDEX (3P+)
INQUIRE LIST OF COLOUR MAPPING INDICES (3P+)
INQUIRE PREDEFINED COLOUR MAPPING REPRESENTATION (3P+)
CREATE STORE (3P)
DELETE STORE (3P)
September 02, 1992