GINO Graphics Suite - GINO v9.0  

gDefinePixelPacking

Syntax

[C/C++:]
void gDefinePixelPacking(int nbp, int nrb, int npw, int ndir, int dir);
[F90:]
subroutine gDefinePixelPacking(nbp, nrb ,npw, ndir, dir)
integer, intent(in) :: nbp,nrb,npw,ndir,dir

Arguments

nbp
The number of bits per pixel

nrb
The number of relevant bits

npw
The number of pixels per word

ndir
Pixel order within machine word

= + 1, Normal direction
= -1, Reverse direction
dir
Drawing direction

= 1, Start top left, access horizontally (default)
= 2, Start top left, access vertically
= 3, Start top right, access horizontally
= 4, Start top right, access vertically
= 5, Start bottom left, access horizontally
= 6, Start bottom left, access vertically
= 7, Start bottom right, access horizontally
= 8, Start bottom right, access vertically

Description

The routine gDefinePixelPacking() defines the users pixel data characteristics as used by gDrawPixelArea() and gGetPixelArea(). It defines the form of bit packing or unpacking between the users data storage and the actual device.

The bit characteristics are those of the integer data stored in the pixel array. In the case of gDrawPixelArea(), gDefinePixelPacking() defines the format of the pixel information that is already stored in the pixel array and is required to be unpacked and sent to the device. In the case of gGetPixelArea(), gDefinePixelPacking() defines the format that is required in the pixel array after packing the pixel data from the device.

Where more than one pixel is stored in a word, ndir specifies the order. The normal order is for the first pixel to be stored at the high end and the last pixel to be stored at the low end. If pixels are stored in the reverse order then ndir should be set negative.

dir specifies the order in which pixel data is stored in the pixel array. This does not effect packing but the order in which elements of the pixel array are accessed.

If nbp, nrb, npw or ndir are zero then no bit packing or unpacking is done and one full integer word is assumed to carry the information for one pixel on the device.

If any of nbp, nrb, npw are negative or dir is out or range a warning message is output and no change is made to the current pixel definition.

If the number of relevant bits (nrb) is greater that the number of bits per pixel (nbp) or the number of pixels per word (npw) * number of bits per pixel (nbp) is greater than 32 then a warning messages is output and no change is made to the current pixel definition.

See Also

gDefinePixelPacking Usage
gDrawPixelArea
gGetPixelArea