SunPHIGS 3.0 Extensions Reference Manual
  Искать только в названиях книг
Загрузить это руководство в формате PDF

NAME

SET COLOUR MAPPING REPRESENTATION - set colour mapping representation entry in the workstation table of defined colour mapping representations

SYNOPSIS

C Syntax

void
pset_colr_map_rep ( ws, index, map_method, map_data )
Pint               ws;              workstation identifier
Pint               index;           colour mapping bundle index
Pint               map_method;      mapping method
Pcolr_map_data     * map_data;      mapping method data record

FORTRAN Syntax

SUBROUTINE pscmr ( WKID, CMRI, MMETH, LDR, DATREC )
INTEGER             WKID               workstation identifier
INTEGER             CMRI               predefined index
INTEGER             MMETH              colour mapping method
INTEGER             LDR                dimension of data record array
CHARACTER* 80       DATREC(LDR)        data record

Required PHIGS Operating States

(PHOP, WSOP, * ,* )

DESCRIPTION

Purpose

SET COLOUR MAPPING REPRESENTATION defines or sets a colour mapping representation in the specified workstation's colour mapping table.

C Input Parameters

ws
The workstation identifier specifies the workstation for which the colour mapping representation is to be defined.
index
The index of the colour mapping representation to set.
map_method
The colour mapping method. Colour mapping methods are defined in phigs.h as follows:
1
PCOLR_MAP_TRUE
2
PCOLR_MAP_PSEUDO
3
PCOLR_MAP_PSEUDO_N

C Output Parameters

map_data
A pointer to a pointer to a Pcolr_map_data structure that contains the information specific to the data mapping method. Pcolr_map_data is defined in phigs.h as follows:
typedef union {
struct {
Pint
colr_model;
Pfloat_list
weights;
Pcolr_rep_list
colrs;
} method_r2
struct {
Pint
colr_model;
Pfloat_list_list
colr_lists;
} method_r3
} Pcolr_map_data;
Pfloat_list is defined in phigs.h as follows:
typedef struct {
Pint            num_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 {
Pint            num_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 {
Pint            num_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 {
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 * /
Pdata       unsupp;     /* Colour in unsupported colour model * /

} Pcolr_rep;
Prgb is defined in phigs.h as follows:
typedef struct {
Pfloat           red;            /* red, hue, and so on * /
Pfloat           green;          /* green, saturation, lightness,
                                   and so on * /
Pfloat           blue;           /* blue, value, saturation,
                                   and so on * /

} Prgb;
Pcieluv is defined in phigs.h as follows:
typedef struct {
Pfloat           cieluv_x;       /* x coefficient * /
Pfloat           cieluv_y;       /* y coefficient * /
Pfloat           cieluv_y_lum; /* y luminance * /

} Pcieluv;
Phsv is defined in phigs.h as follows:
typedef struct {
Pfloat           hue;            /* hue * /
Pfloat           satur;          /* saturation * /
Pfloat           value;          /* value * /

} Phsv;
Phls is defined in phigs.h as follows:
typedef struct {
Pfloat           hue;            /* hue * /
Pfloat           lightness;      /* lightness * /
Pfloat           satur;          /* saturation * /

} Phls;
Pdata is defined in phigs.h as follows:
typedef struct {
size_t          size;           /* 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 are 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:
1
PMODEL_RGB
2
PMODEL_CIELUV
3
PMODEL_HSV
4
PMODEL_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.

FORTRAN Input Parameters

WKID
The workstation identifier of the workstation for which the colour mapping representation is to be defined.
CMRI
The index of the colour mapping representation to set.
MMETH
The colour mapping method. Colour mapping methods are defined in phigs77.h as follows:
1
PCMAPTRUE
2
PCMAPPSEUDO
3
PCMAPPSEUDON
LDR
The dimension of the data record array, DATREC.
DATREC(LDR)
The data record is packed by PACK DATA RECORD. The contents depend on the mapping method specified:
For MMETH = PCMAPTRUE:
IL = the number of integers, 0
RL = the number of real values, 0
SL = the number of strings, 0
For MMETH = PCMAPPSEUDO:
IL = the number of integers, 3
IA = an array of integers, with the following values:
IA(1) = the colour model. Valid values defined in phigs77.h are:
1
PRGB
2
PCIE
3
PHSV
4
PHLS
IA(2) = the number of weights.
IA(3) = the number of colour representations.
RL = the number of reals, IA(2) + 3 * IA(3).
RA = an array of reals with the following values:
RA(1) - RA(IA(2)) =
the weights RA(IA(2)+1) - RA(IA(2) + 3 + IA(3)) = the colour values for each colour representation (r1, g1, b1, r2, g2, b2, and so
on).
SL = the number of strings, 0
For MMETH = PCMAPPSEUDON:
IL = the number of integers, 2 + (number of lists).
IA = an array of integers, with the following values:
IA(1) = the colour model. Valid values are defined in phigs77.h as
follows:
1
PRGB
2
PCIE
3
PHSV
4
PHLS
IA(2) = the number of lists of float values.
IA(3) - IA(IL) =
a list of end indices in RA for each list of colour coordinates.
RL = the number of reals, equal to the total of the list lengths in IA(3) -IA(IL).
RA = a list of lists of floats, whose end indices are indicated in IA(3) through IA(IL).

Execution

When SET COLOUR MAPPING REPRESENTATION is called, the specified entry in the table of defined colour mapping representations of the specified workstation is set to the values specified.
During structure traversal, the current colour mapping representation is selected from the workstation table by a structure element created by the SET COLOUR MAPPING INDEX subroutine.

ERRORS

003
Ignoring function, function requires state (PHOP, WSOP, * ,* )
054
Ignoring function, the specified workstation is not open
059
Ignoring function, the specified workstation does not have output capability (that is, the workstation category is not OUTPUT or OUTIN)
103
Ignoring function, setting this bundle table entry would exceed the maximum number of entries allowed in the workstation bundle table
110
Ignoring function, the specified colour model is not available on the workstation
121
Ignoring function, colour mapping index is less than 0.
125
Ignoring function, the total of the colour range fields in all the table entries is too large.
126
Ignoring function, the specified colour mapping method is not available on the specified workstation.
136
Ignoring function, one of the components of the colour specification is out of range
138
Ignoring function, one or more of the fields in the specified data record is inconsistent with the specified type.

SEE ALSO

PACK DATA RECORD (3P)
SET COLOUR MAPPING INDEX (3PP)
INQUIRE COLOUR MAPPING REPRESENTATION (3PP)
UNPACK DATA RECORD (3P)