.\"##
.\" $XConsortium: p353,v 5.2 94/04/17 20:58:34 rws Exp $
.\"##
.\"## 
$XMCOPY
.\"## Copyright (c) 1990, 1991 by Sun Microsystems, Inc. 
.\"## 
.\"##                         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 name of Sun Microsystems,
.\"## 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.
.\" 1. Substitute PHIGS Extension function name (in CAPS) for "PNAME" in line .\"below:
.ds pN SET PATTERN REPRESENTATION PLUS
.TH "\*(pN" 3P+ "29 February 1991"
.SH NAME
\*(pN \-
set an extended pattern attribute bundle on a workstation
.IX "PHIGS Extension Functions" "\*(pN"
.IX "Pattern Fill" "SET PATTERN REPRESENTATION PLUS"
.IX "Attribute Representations" "SET PATTERN REPRESENTATION PLUS"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.25i 3i
.nf
.\" 6. Insert C syntax below
void
pset_pat_rep_plus ( ws, index, rep )
Pint	ws;	\fIworkstation identifier\fP
Pint	index;	\fIpattern bundle index\fP
Ppat_rep_plus	*rep;	\fIpattern representation pointer\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP, WSOP, *, *)
.SH DESCRIPTION
.SS Purpose
\s-2SET PATTERN REPRESENTATION PLUS\s+2 sets an extended
pattern attribute bundle on a workstation.
.SS C Input Parameters
.IP \fIws\fP
The identifier of the workstation.
.IP \fIindex\fP
This is an index to the workstation pattern bundle table.
.IP \fIrep\fP
A pointer to a Ppat_rep_plus structure. Ppat_rep_plus is defined as:
.sp .2
.nf
.ta .5i +1i  +1.25i   +1.25i
.sp .2
typedef struct {
.sp .2
	Pint_size	dims;	/* pattern's dimensions */
	Pint	type;	/* colour model */
	Pcoval	*colr_array;	/* array of colours */
.sp .2
} Ppat_rep_plus;
.fi
.IP
Pint_size is defined as:
.sp .2
.nf
.ta .5i +1i +1i
.sp .2
typedef struct {
.sp .2
	Pint	size_x;	/* dimension (number of divisions) along X */
	Pint	size_y;	/* dimension (number of divisions) along Y */
.sp .2
} Pint_size;
.fi
.IP
Pcoval is defined as:
.sp .2
.nf
.ta .5i +1i +1i
.sp .2
typedef union {
.sp .2
	Pint	ind;	/* index in workstation colour bundle table */
	Pcolr_rep	direct;	/* direct colour components */
.sp .2
}Pcoval;
.fi
.IP
Pcolr_rep is defined as:
.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
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
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
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
.SS Execution
In the pattern table of the workstation state list, the given
index is associated with the specified parameters.
.LP
A grid of \fI\s-2DX\s+2\fP by  \fI\s-2DY\s+2\fP cells is specified with 
\fI\s-2DX\s+2\fP
being horizontal and \fI\s-2DY\s+2\fP being vertical. If the colour type 
is indirect colour, then colour is given individually for each cell
by the colour index, which is an index into the colour table of 
the workstation. Otherwise, the colour is given individually for
each cell by a direct colour value in the specified colour model.
.LP
If the workstation supports interior style \s-2PATTERN\s+2, the pattern
table in the workstation state list has predefined entries taken from
the workstation description table. A number of these entries are predefined
for every workstation of category \s-2OUTPUT\s+2 and \s-2OUTIN\s+2
supporting interior style \s-2PATTERN\s+2. Any table entry, including
the predefined entries, may be redefined with this function.
.LP
When area-defining primitives are displayed during structure traversal,
if the currently selected interior style is \s-2PATTERN\s+2, the current
or back interior style index in the \s-2PHIGS\s+2
state list
refers to an entry in the extended pattern table. The selection is made
either via the interior bundle or individually, depending on the
corresponding Aspect Source Flags(\s-2ASF\s+2s). If the
current or back interior style index is not present in the extended 
pattern table, then interior style index one is used. If interior style
index one is not present, the result is workstation dependent and the
interior style \s-2PATTERN\s+2 is not supported for this workstation.
The setting of the corresponding \s-2ASF\s+2s determines which 
aspects in the entry are used.
.LP
During structure traversal, if the colour type of a specified pattern
table entry is indirect colour and if a pattern colour index specified
in the pattern colour array is not available on the workstation, then 
colour index one is used.
.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,
\s-2OUTIN\s+2, nor \s-2MO\s+2)
.IP 103
Ignoring function, setting this bundle table entry would exceed the maximum
number of entries allowed in the workstation bundle table
.IP 110
Ignoring function, the specified colour model is not available on the
workstation
.IP 112
Ignoring function, the pattern index value is less than one
.IP 113
Ignoring function, the colour index value is less than zero
.IP 116
Ignoring function, one of the dimensions of the pattern colour array
is less than one
.IP 136
Ignoring function, one of the components of the colour specification
is out of range
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "SET INDIVIDUAL ASF (3P)"
.SM "INQUIRE LIST OF PATTERN INDICES (3)"
.SM "INQUIRE PATTERN FACILITIES (3P)"
.SM "INQUIRE PATTERN REPRESENTATION PLUS (3P+)"
.SM "INQUIRE PREDEFINED PATTERN REPRESENTATION PLUS (3P+)"
.SM "SET PATTERN REPRESENTATION (3P)"
.fi
