BLOCK_READ(3G)
NAME
block_read − a frame buffer to main memory block transfer procedure.
SYNOPSIS
C SYNTAX
void block_read(fildes,x_source,y_source,length_x,
length_y,pixel_data,raw);
int fildes;
float x_source,y_source;
int length_x,length_y,raw;
unsigned char pixel_data[];
void dcblock_read(fildes,x_source,y_source,length_x,
length_y,pixel_data,raw);
int fildes,x_source,y_source,length_x,length_y,raw;
unsigned char pixel_data[];
FORTRAN77 SYNTAX
subroutine block_read(fildes,x_source,y_source,
length_x,length_y,pixel_data,raw)
integer*4 fildes
real x_source,y_source
integer*4 length_x,length_y,raw,pixel_data()
subroutine dcblock_read(fildes,x_source,y_source,
length_x,length_y,pixel_data,raw)
integer*4 fildes,x_source,y_source
integer*4 length_x,length_y,raw,pixel_data()
PASCAL SYNTAX
type
gbyte=0..255;
procedure block_read(fildes:integer;x_source,y_source:real;
length_x,length_y:integer;var pixel_data:array[lo..hi:integer]
of gbyte;raw:integer);
procedure dcblock_read(fildes:integer;x_source,y_source,
length_x,length_y:integer;var pixel_data:array[lo..hi:integer]
of gbyte;raw:integer);
HP-UX COMPATIBILITY
Level: HP-UX/STANDARD
Origin: ANSI Computer Graphics Interface
DESCRIPTION
INPUT PARAMETERS
fildes
is an integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
x_source, y_source
are the coordinates of upper left corner of the source in Virtual Device Coordinates (block_read) or Device Coordinates (dcblock_read).
length_x, length_y
are the length of the sides of the block to be read in pixels.
raw
if TRUE (1), and if the pixel data is arranged with multiple pixels per byte, the pixel data is read in a device dependent format and potentially rounded to a pixel in the x-axis direction that aligns with a byte or word boundary. Clipping of data is not performed in the raw mode.
If FALSE (0), each pixel value is returned as a 1 byte quantity. There are no padding bytes. Therefore, with Fortran, four pixels are returned for each 32 bit integer array element.
OUTPUT PARAMETERS
pixel_data
is the packed array of pixel data to be transferred. This data is returned by the procedure.
DISCUSSION
Pixel_data is considered to be a length_x by length_y byte rectangle for the following discussion. The returned array will contain frame buffer values from the source rectangle beginning at location (x_source,y_source) with dimensions of length_x and length_y combined with the values in pixel_data using the current drawing_mode. Write_enable does not have any affect on block_read. The pixels are put in the array ordered from left to right, and then from top to bottom. If the clip_indicator is not CLIP_OFF or the rectangle extends outside the device’s raster limits then the pixel_data values outside the intersection of the source rectangle and the current clip boundaries are left untouched. In all cases the dimensionality of the resultant pixel_data rectangle is preserved.
This is the exact inverse operation of block_write (except for write_enable).
For device independent operation do not use raw mode. Raw mode should only be used where speed of image read is critical and the number of pixels read is not critical. This speed improvement is significant only if the device frame buffer organization is not a byte or word per pixel.
A block_read is done using Virtual Device Coordinate values and dcblock_read is done using Device Coordinate values.
SEE ALSO
block_move(3g), block_write(3g), clip_indicator(3g), clip_rectangle(3g), drawing_mode(3g), write_enable(3g).
Hewlett-Packard — last mod. May 11, 2021