BLOCK_WRITE(3G)
NAME
block_write − this is a main memory to frame buffer block transfer procedure.
SYNOPSIS
C SYNTAX
void block_write(fildes,x_dest,y_dest,length_x,length_y,
pixel_data,raw);
int fildes;
float x_dest,y_dest;
int length_x,length_y,raw;
unsigned char pixel_data[];
void dcblock_write(fildes,x_dest,y_dest,length_x,length_y,
pixel_data,raw);
int fildes,x_dest,y_dest;
int length_x,length_y,raw;
unsigned char pixel_data[];
FORTRAN77 SYNTAX
subroutine block_write(fildes,x_dest,y_dest,
length_x,length_y,pixel_data,raw)
integer*4 fildes
real x_dest,y_dest
integer*4 length_x,length_y,raw
integer*4 pixel_data()
subroutine dcblock_write(fildes,x_dest,y_dest,
length_x,length_y,pixel_data,raw)
integer*4 fildes,x_dest,y_dest
integer*4 length_x,length_y,raw,pixel_data()
PASCAL SYNTAX
type
gbyte=0..255;
procedure block_write(fildes:integer;x_dest,y_dest:real;
length_x,length_y:integer;var pixel_data:array[lo..hi:integer]
of gbyte;raw:integer);
procedure dcblock_write(fildes:integer;x_dest,y_dest,
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_dest, y_dest
are the coordinates of upper left corner of the destination in Virtual Device Coordinates (block_write) or Device Coordinates (dcblock_write).
length_x, length_y
are the length of the sides of the block to be written in pixels.
raw
if TRUE (1), and if the pixel data is arranged with multiple pixels per byte, the pixel data is written 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 is written as a 1 byte quantity. There are no padding bytes. Therefore, with Fortran, four pixels are written for each 32 bit integer array element.
pixel_data
is the packed array of pixel data to be transferred. This data is written to the frame buffer by the procedure.
DISCUSSION
Pixel data is considered to be a length_x by length_y byte rectangle for the following discussion. The pixel_data array contains values that are to be combined with the frame buffer destination rectangle beginning at location (x_dest,y_dest) with dimensions of length_x and length_y using the current drawing_mode and write_enable. The pixels are read from 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 frame buffer values outside the intersection of the destination rectangle and the current clip boundaries are left untouched. In all cases the dimensionality of the pixel_data source rectangle is preserved.
This is the exact inverse operation of block_read (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_write is done using Virtual Device Coordinate values and dcblock_write is done using Device Coordinate values.
SEE ALSO
block_move(3g), block_read(3g), clip_indicator(3g), clip_rectangle(3g), drawing_mode(3g), write_enable(3g)
Hewlett-Packard — last mod. May 11, 2021