DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

DrawImage(D3nfb)


DrawImage -- NFB routine to draw a pixmap in a region of a window

Synopsis

#include "nfbWinStr.h"

void xxxDrawImage ( BoxPtr pbox, void *image, unsigned int stride, unsigned char alu, unsigned long planemask, DrawablePtr pDraw);

Description

DrawImage draws the pixmap pointed to by image in a rectangular region of the specified window.

Arguments

The arguments are:

pbox
describes the rectangular area in which the image should appear in the frame buffer. pbox points to an X structure called a BoxRec(D4nfb) where the last pixel of the image should appear.

This means that the pixel width can be determined by subtracting x1 from x2 and the height by subtracting y1 from y2. This is how the X server deals with rectangular coordinates at the lowest level. Your Link Kit driver will never have to deal with situations where the rectangle's width or height are less than or equal to zero so it is not necessary to add code to check these values.


image
points to the actual image data that must be copied into the frame buffer. If you are writing an 8-bits-per-pixel driver, then this void * is actually an unsigned char *. If you are writing a 16-bits-per-pixel driver, then this void * is actually an unsigned short *. If you are writing a 24-bits-per-pixel driver, then this void * is actually an unsigned int *. image points to a contiguous chunk of memory that is stride x pixel width in size.

stride
is the memory offset in bytes between two rows in image memory. See ``stride'' in Developing NFB graphics adapter drivers.

alu
is the raster bit operation that is to be applied when mixing the image with the contents of the frame buffer. See ``alu'' in Developing NFB graphics adapter drivers.

planemask
contains a value that determines which frame buffer planes get modified when drawing this image. If a bit is set, the plane will be modified. If no bits are set, the plane will not be modified. Almost all X drawing operations use a planemask that specifies modification of all planes.

pDraw
pointer to an X structure called DrawableRec. This pointer is used only to access your Screen Private data. The ScreenRec structure is pointed to by pDraw->pScreen. Your Screen Private hangs off the bottom of ScreenRec.

Exit codes

None

Usage

Driver writers must supply this routine for their drivers. The xmkddx utility creates a skeleton in the driver's xxxImage.c file that is pointed to by the nfbWinOps(D4nfb) structure. The driver writer must add code to implement the capabilities of the graphics adapter hardware.

Note that different functions are required to support depths 1, 2, 4, 8, and 16. Note the following:

Version applicability

This function is supported for NFB drivers on all releases of SCO OpenServer 5, SVR5, and AIX 5L.

Source files


Driver source file
xxxImage.c

Defined in
nfbWinOps structure in xxxData.c

Prototyped in
xxxProcs.h

References

nfbWinOps(D4nfb)

Examples

See the example in the nteImage.c file.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005