ilWriteXDrawable(3X)
NAME
ilWriteXDrawable() − write a pipe image to an X drawable
SYNOPSIS
ilBool
ilWriteXDrawable (
ilPipe pipe,
Drawable drawable,
ilXWC XWC,
ilRect *pSrcRect,
int dstX,
int dstY,
unsigned long mustBeZero);
DESCRIPTION
ilWriteXDrawable() writes a pipe image to an X drawable (pixmap or window) at the drawable-relative location (dstX, dstY). The image is converted as necessary for display. For example, if the display is to a monochrome (bit/pixel) drawable, the image is converted to bitonal before display.
XWC is used to control rendering. A GC, visual and colormap are associated with the XWC when it is created with XWC. The specified drawable must be compatible with those structures; see Xlib documentation.
ilConvertForXWrite() is called to convert the image as necessary for display. The behavior of ilConvertForXWrite() depends on whether raw mode is enabled or disabled in the given ilXWC data structure. See ilConvertForXWrite() for details.
If using ilConvertForXWrite() results in a pipe image that is bit-per-pixel (nSamplesPerPixel and nBitsPerSample[0] are each equal to 1), the image is output to the drawable using XPutImage(), identifying the X image type as XYBitmap. With this mode, zeros (0) in the image are drawn with the GC background color and ones (1) with the GC foreground color. (Note that the GC is associated with the XWC by ilCreateXWC()). The client must set the foreground and background colors in the GC to ensure proper display of bitonal images.
pipe identifies a pipe created by ilCreatePipe().
drawable identifies an X drawable (pixmap or window).
XWC identifies an ilXWC (X Write Context) structure created by ilCreateXWC().
*pSrcRect defines how much of the pipe image to write. If *pSrcRect is NULL, the entire pipe image is written; otherwise, *pSrcRect identifies an ilRect structure that defines the part of the image to write.
dstX identifies where on the drawable to locate the top edge of the image.
dstY identifies where on the drawable to locate the left edge of the image.
mustBeZero identifies a value that must be zero; this parameter is reserved for future use.
RETURN VALUE
Upon successful completion, ilWriteXDrawable() returns TRUE.
ERRORS
If the call fails, context->error receives a non-zero error code.
EXAMPLE
The following example adds a consumer filter to write the pipe image to an X window (drawable). The image will be displayed when the pipe is executed.
ilPipe pipe;
Window window;
ilXWC XWC;
.
.
.
if (!ilWriteXDrawable (pipe, window, XWC,
(ilRect *)0, 0, 0, 0))
return(context->error);
AUTHOR
ilWriteXDrawable() was developed by HP.
SEE ALSO
ilCreatePipe(3X), ilReadXDrawable(3X).
Using the Image Developer’s Kit.
Hewlett-Packard Company — Image Library: February, 1995