.\"
.\" $XConsortium: p096,v 5.2 94/04/17 20:55:26 rws Exp $
.\"
.\" 
$XMCOPY
.\" Copyright (c) 1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
.\" 
.\"                         All Rights Reserved
.\" 
.\" Permission to use, copy, modify, and distribute this software and its 
.\" documentation for any purpose and without fee is hereby granted, 
.\" provided that the above copyright notice appear in all copies and that
.\" both that copyright notice and this permission notice appear in 
.\" supporting documentation, and that the names of Sun Microsystems,
.\" and the X Consortium not be used in advertising or publicity 
.\" pertaining to distribution of the software without specific, written 
.\" prior permission.  
.\" 
.\" SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
.\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
.\" EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
.\" CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
.\" USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.ds f \s-2QINQUIRE DEPTH CUE REPRESENTATION\s+2
.TH "INQUIRE COLOUR MAPPING REPRESENTATION" 3P+ "29 February 1991"
.SH NAME
INQUIRE COLOUR MAPPING REPRESENTATION \- inquire a colour mapping
representation for a given workstation  
.IX "Attribute Representations" "INQUIRE COLOUR MAPPING REPRESENTATION"
.IX "Inquiry functions" "INQUIRE COLOUR MAPPING REPRESENTATION"
.IX "Colour Mapping" "INQUIRE COLOUR MAPPING REPRESENTATION"
.IX "PHIGS Extension Functions" "INQUIRE COLOUR MAPPING REPRESENTATION"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.25i 3i
.nf
void
pinq_colr_map_rep ( ws, index, type, store, error_ind, map_method, map_data )
Pint	ws;	\fIworkstation identifier\fP
Pint	index;	\fIcolour mapping index\fP
Pinq_type	type;	\fItype of returned value\fP
Pstore	store;	\fIhandle to Store object\fP
Pint	*error_ind;	\fIOUT error indicator\fP
Pint	*map_method;	\fIOUT mapping method\fP
Pcolr_map_data	**map_data;	\fIOUT mapping method data record\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP,WSOP, *, *)
.SH DESCRIPTION
.SS Purpose
\s-2INQUIRE COLOUR MAPPING REPRESENTATION\s+2
returns a specified colour mapping table entry in a workstation's state
list.
.SS C Input Parameters
Applications using the \s-2C\s+2 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 \fIstore\fP argument.  
.LP
The store buffer is a data area managed by \s-2PHIGS\s+2. While the application 
is responsible for creating the inital buffer through a call to \s-2\CREATE STORE\s+2, 
\s-2PHIGS\s+2 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 \fImap_data\fR.
.IP \fIws\fP
The workstation identifier.
.IP \fIindex\fP
The colour mapping table index of the entry to return.
.IP  \fItype\fP
An enumerated value specifying whether the values to be returned are 
those originally specified by the application (\s-2PSET\s+2), or
those resulting after \s-2PHIGS\s+2 mapped them to ones available on the
workstation (\s-2PREALIZED\s+2).  A Pinq_type structure is defined in phigs.h as:
.nf
.ta .5i +\w'PREALIZED     'u
.sp .4
typedef enum {
.sp .2
	PSET,
	PREALIZED
.sp .2
} Pinq_type;
.fi
.IP \fIstore\fR
The memory buffer \s-2PHIGS\s+2 is to use for storing the information
returned.  This buffer must exist prior to calling this function (see
\s-2CREATE STORE (3P)\s+2).
.SS C Output Parameters
.IP \fIerror_ind\fP
A pointer to the location to store the error number
of any error detected by this function.
.IP \fImap_method\fP
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:
.ta .5i +1.25i
	1	PCOLR_MAP_TRUE
	2	PCOLR_MAP_PSEUDO
	3	PCOLR_MAP_PSEUDO_N
.bp
.IP \fImap_data\fP
A pointer to a pointer to a Pcolr_map_data structure that contains the
information specific to the data mapping method.
\s-2PHIGS\s+2 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:
.nf
.ta .5i +.5i +1i
.sp .4
typedef union {
.sp .2
	struct {
		Pint		colr_model;
		Pfloat_list	weights;
		Pcolr_rep_list	colrs;
	} method_r2
	struct {
		Pint		colr_model;
		Pfloat_list_list	colr_lists;
	} method_r3
.sp .2
} Pcolr_map_data;
.fi
.sp .4
Pfloat_list is defined in phigs.h as follows:
.ta .5i +1i +1.25i
.nf
.sp .4
typedef struct {
.sp .2
	Pint	num_floats;	/* number of Pfloats in list */
	Pfloat	*floats;	/* list of floats *
.sp .2
} Pfloat_list;
.fi
.sp .4
Pfloat_list_list is defined in phigs.h as follows:
.ta .5i +1i +1.25i
.nf
.sp .4
typedef struct {
.sp .2
	Pint	num_lists;	/* number of lists in list */
	Pfloat_list	*lists;	/* list of float lists */
.sp .2
} Pfloat_list_list;
.fi
.sp .4
Pcolr_rep_list is defined in phigs.h as follows:
.ta .5i +1i +1.25i
.nf
.sp .4
typedef struct {
.sp .2
	Pint	num_colr_reps;	/* number of colours */
	Pcolr_rep	*colr_reps;	/* array of colours */
.sp .2
} Pcolr_rep_list;
.fi
.sp .4
Pcolr_rep is defined in phigs.h as follows:
.ta .5i +1i +1i
.nf
.sp .2
typedef union {
.sp .2
	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 */
.sp .2
} Pcolr_rep;
.sp .2
.fi
.IP
Prgb is defined in phigs.h as follows:
.nf
.ta .5i +1i +1i
.sp .2
typedef struct {
.sp .2
	Pfloat	red;	/* red, hue, etc */
	Pfloat	green;	/* green, saturation, lightness, etc */
	Pfloat	blue;	/* blue, value, saturation, etc */
.sp .2
} Prgb;
.fi
.IP
Pcieluv is defined in phigs.h as follows:
.nf
.ta .5i +1i +1i
.sp .2
typedef struct {
.sp .2
	Pfloat	cieluv_x;	/* x coefficient */
	Pfloat	cieluv_y;	/* y coefficient */
	Pfloat	cieluv_y_lum;	/* y luminance */
.sp .2
} Pcieluv;
.fi
.IP
Phsv is defined in phigs.h as follows:
.nf
.ta .5i +1i +1i
.sp .2
typedef struct {
.sp .2
	Pfloat	hue;	/* hue */
	Pfloat	satur;	/* saturation */
	Pfloat	value;	/* value */
.sp .2
} Phsv;
.fi
.IP
Phls is defined in phigs.h as follows:
.nf
.ta .5i +1i +1i
.sp .2
typedef struct {
.sp .2
	Pfloat	hue;	/* hue */
	Pfloat	lightness;	/* lightness */
	Pfloat	satur;	/* saturation */
.sp .2
} Phls;
.fi
.IP
Pdata is defined in phigs.h as follows:
.nf
.ta .5i +1i +1i
.sp .2
typedef struct {
.sp .2
	size_t	size;	/* size of data */	
	char	*data	/*pointer to data */
.sp .2
} Pdata;
.fi
.IP
There is no data associated with mapping method \s-2PCOLR_MAP_TRUE\s+2.
The data for method \s-2PCOLR_MAP_PSEUDO\s+2 is a list of weights
and a list of direct colours.  \fIcolr_model\fR specifies the
type of colours given in the list of colours, \fIcolrs\fR.
The colour models are defined in phigs.h as follows:
.ta .5i +.5i
.nf
	1	PMODEL_RGB
	2	PMODEL_CIELUV
	3	PMODEL_HSV
	4	PMODEL_HLS
.fi
.IP
The data for mapping method \s-2PCOLR_MAP_PSEUDO_N\s+2
is \fIN\fR lists of direct colours.  These colours may be of the same
types as for \s-2PCOLR_MAP_PSEUDO\s+2.
.SS Execution
If the inquired information is available, the error indicator is
returned as zero and values are returned in the output parameters.
.LP
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 \fIRealized\fP, the representation for the colour mapping index
zero is returned.
.LP
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.
.LP
Since this is an inquiry function, \s-2ERROR HANDLING\s+2 is not 
invoked when an error is detected by this function.
.RE
.SH ERRORS
.IP 003
Ignoring function, function requires state (\s-2PHOP,WSOP,*,*\s+2)
.IP 054
Ignoring function, the specified workstation is not open
.IP 059
Ignoring function, the specified workstation does not have output
capability (that is, the workstation category is neither \s-2OUTPUT\s+2
nor \s-2OUTIN\s+2)
.IP 101
Ignoring function, the specified representation has not been defined
.IP 121
Ignoring function, the colour mapping index is less than zero
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "SET COLOUR MAPPING REPRESENTATION (3P+)"
.SM "SET COLOUR MAPPING INDEX (3P+)"
.SM "INQUIRE LIST OF COLOUR MAPPING INDICES (3P+)"
.SM "INQUIRE PREDEFINED COLOUR MAPPING REPRESENTATION (3P+)"
.SM "CREATE STORE (3P)"
.SM "DELETE STORE (3P)"
.fi
