Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XPutImage(3X) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought




XPutImage(3X) XPutImage(3X)
NAME XPutImage, XGetImage, XGetSubImage - transfer images SYNOPSIS XPutImage (display, d, gc, image, src-x, src-y, dst-x, dst-y, width, height) Display *display; Drawable d; GC gc; XImage *image; int src-x,src-y; int dst-x,dst-y; unsigned int width, height; XImage *XGetImage (display, d, x, y, width, height, plane-mask, format) Display *display; Drawable d; int x,y; unsigned int width, height; unsigned long plane-mask; int format; XImage *XGetSubImage (display, d, x, y, width, height, plane-mask, format, dest-image, dest-x, dest-y) Display *display; Drawable d; int x,y; unsigned int width,height; unsigned long plane-mask; int format; XImage *dest-image; int dest-x, dest-y; DESCRIPTION The XPutImage function combines an image in memory with a rectangle of the specified drawable. If XYBitmap format is used, the depth must be 1, or a BadMatch error results. The foreground pixel in the graphic context defines the source for the 1 bits in the image, and the background pixel de- fines the source for the 0 bits. For XYPixmap and ZPixmap, the depth must match the depth of the drawable, or a Bad- Match error results. The section of the image defined by the src-x, src-y, width, and height arguments is drawn on the specified part of the drawable. This function uses these graphic context components: function, plane-mask, subwindow-mode, clip-x-origin, clip- y-origin, and clip-mask. It also uses these mode-dependent graphic context components: foreground and background. November, 1990 1



XPutImage(3X) XPutImage(3X)
The XGetImage function returns a pointer to an XImage struc- ture. This structure provides the contents of the specified rectangle of the drawable in your specified format. If the format argument is XYPixmap, the image contains only the bit planes you passed to the plane-mask argument. If the plane-mask argument only requests a subset of the planes of the display, the depth of the returned image is the number of planes requested. If the format argument is ZPixmap, XGetImage returns as 0 the bits in all planes not specified in the plane-mask argument. The function performs no range checking on the values in plane-mask and ignores extraneous bits. XGetImage returns the depth of the image to the depth member of the XImage structure. The depth of the image is as specified when the drawable was created, except when getting a subset of the planes in XYPixmap format, when the depth is given by the number of bits set to 1 in plane-mask. If the drawable is a pixel map, the given rectangle must be wholly contained within the pixel map, or a BadMatch error results. If the drawable is a window, the window must be viewable, and if there were no inferiors or overlapping win- dows, the specified rectangle of the window would be fully visible on the screen and wholly contained within the out- side edges of the window, or a BadMatch error results. Note that the borders of the window can be included and read with this request. If the window has backing-store, the backing-store contents are returned for regions of the win- dow that are obscured by noninferior windows. If the window does not have backing-store, the returned contents of such obscured regions are undefined. The returned contents of visible regions of inferiors of a different depth than the specified window's depth are also undefined. The pointer image is not included in the returned contents. If a prob- lem occurs, XGetImage returns NULL. The XGetSubImage function updates dest-image with the speci- fied subimage in the same manner as XGetImage. If the for- mat argument is XYPixmap, the image contains only the bit planes passed in the plane-mask argument. If the format ar- gument is ZPixmap, XGetSubImage returns as 0 the bits in all planes not specified in the plane-mask argument. The func- tion performs no range checking on the values in plane-mask and ignores extraneous bits. As a convenience, XGetSubImage returns a pointer to the same XImage structure specified by dest-image. The depth of the destination XImage structure must be the same as that of the drawable. If the specified subimage does not fit at the specified location on the destination 2 November, 1990



XPutImage(3X) XPutImage(3X)
image, the right and bottom edges are clipped. If the draw- able is a pixel map, the given rectangle must be wholly con- tained within the pixel map, or a BadMatch error results. If the drawable is a window, the window must be viewable, and if there were no inferiors or overlapping windows, the specified rectangle of the window would be fully visible on the screen and wholly contained within the outside edges of the window, or a BadMatch error results. If the window has backing-store, the backing-store contents are returned for regions of the window that are obscured by noninferior win- dows. If the window does not have backing-store, the re- turned contents of such obscured regions are undefined. The returned contents of visible regions of inferiors of a dif- ferent depth than the specified window's depth are also un- defined. If a problem occurs, XGetSubImage returns NULL. Arguments These functions accept the following arguments: d Specifies the drawable. dest-image Specifies the destination image. dest-x, dest-y Specify the x and y coordinates of the destination rectangle relative to its origin. These coordinates specify the upper-left corner of the destination rectangle and determine where the subimage will be placed within the destination image. display Specifies the connection to the X server. dst-x, dst-y Specify the x and y coordinates. These are the su- bimage coordinates and are relative to the origin of the drawable where the image will be drawn. format Specifies the format for the image. You can pass one of the following constants: XYPixmap or ZPix- map. gc Specifies the graphic context. image Specifies the image to be combined with the rectan- gle. plane-mask Specifies the plane mask. src-x Specifies the x offset from the left edge of the im- November, 1990 3



XPutImage(3X) XPutImage(3X)
age defined by the XImage data structure. src-y Specifies the y offset from the top edge of the im- age defined by the XImage data structure. width, height Specify the width and height of the subimage. These arguments define the dimensions of the rectangle. x, y Specify the x and y coordinates. These coordinates define the upper-left corner of the rectangle and are relative to the origin of the drawable. ERRORS BadDrawable A value for a Drawable argument does not name a de- fined window or pixel map. BadGC A value for a GC argument does not name a defined graphic context. BadMatch An InputOnly window is used as a drawable; or, an argument or pair of arguments has the correct type and range but fails to match in some other required way. BadValue A numeric value falls outside the range of values accepted by the request. Unless a range is speci- fied for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. The XPutImage and XGetImage functions can generate BadDrawable, BadGC, BadMatch, and BadValue errors. The XGetImage function can generate BadDrawable, BadMatch, and BadValue errors. SEE ALSO Xlib - C Language Interface 4 November, 1990

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026