pattern_define(3G)
NAME
pattern_define − define a fill pattern
SYNOPSIS
C Syntax:
void pattern_define(fildes,dx,dy,pattern);
int fildes,dx,dy;
unsigned char pattern[];
FORTRAN77 Syntax:
subroutine pattern_define(fildes,dx,dy,pattern)
integer*4 fildes,dx,dy
character*(*) pattern()
Pascal Syntax:
type
gbyte = 0..255;
procedure pattern_define(fildes,dx,dy:integer;pattern:packed
array[lo..hi:integer] of gbyte);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
dx,dy The number of pixels defined in the x, and y directions, respectively. The maximum value for each is 16, and both dx and dy must be powers of two (i.e. 1, 2, 4, 8, or 16).
pattern The fill pattern. Each element of the array (up to 8 bits) represents one pixel in the pattern. The first element of the array corresponds to the upper left corner of the pattern. The next pixel (and second element of the array) is immediately to its right (or directly below if the pattern is only one column wide). The last pixel (and last element of the array) is the lower right corner (or bottom pixel if the pattern is only one column wide).
Discussion
A dx by dy pixel fill pattern can be defined by the user. The value of each element of the pattern array corresponds to the current color in that position of the color map.
For example, the following segment:
for (i=0; i<256; i++)
pattern[i]=0x06;
pattern_define(fildes,16,16,pattern);
would set all the pixels to blue (assuming the default color map). The pattern is not used unless interior_style has been called with style = INT_PATTERN.
For hardware that does not support the full 16x16 cell size, the cell size will be device-dependent. See the Starbase Device Drivers Library manual for the specifics for a particular device.
The pattern is used for filling only when shade_mode is set to CMAP_NORMAL or CMAP_MONOTONIC.
Defaults
All elements in the pattern are set to white.
SEE ALSO
interior_style(3G), rgb_to_index(3G), shade_mode(3G).
Hewlett-Packard Company — HP-UX Release 9.03: April 1994