NAME
XSetFunction − set the bitwise logical operation in a graphics context.
Synopsis
XSetFunction(display, gc, function)
Display *display;
GC gc;
int function;
Arguments
displaySpecifies a connection to an X server; returned from XOpenDisplay().
gcSpecifies the graphics context.
functionSpecifies the logical operation you want for the specified graphics context. See Description for the choices and their meanings.
Description
XSetFunction() sets the logical operation applied between the source pixel values (generated by the drawing request) and existing destination pixel values (already in the window or pixmap) to generate the final destination pixel values in a drawing request (what is actually drawn to the window or pixmap). Of course, the plane_mask and clip_mask in the GC also affect this operation by preventing drawing to planes and pixels respectively. GXcopy, GXinvert, and GXxor are the only logical operations that are commonly used. See Volume One, Chapter 5, The Graphics Context, for more information about the logical function. The function symbols and their logical definitions are:
| Symbol | Bit | Meaning | ||
| GXclear | 0x0 | 0 | ||
| GXand | 0x1 | src AND dst | ||
| GXandReverse | 0x2 | src AND (NOT dst) | ||
| GXcopy | 0x3 | src | ||
| GXandInverted | 0x4 | (NOT src) AND dst | ||
| GXnoop | 0x5 | dst | ||
| GXxor | 0x6 | src XOR dst | ||
| GXor | 0x7 | src OR dst | ||
| GXnor | 0x8 | (NOT src) AND (NOT dst) | ||
| GXequiv | 0x9 | (NOT src) XOR dst | ||
| GXinvert | 0xa | (NOT dst) | ||
| GXorReverse | 0xb | src OR (NOT dst) | ||
| GXcopyInverted | 0xc | (NOT src) | ||
| GXorInverted | 0xd | (NOT src) OR dst | ||
| GXnand | 0xe | (NOT src) OR (NOT dst) | ||
| GXset | 0xf | 1 |
Errors
BadAlloc
BadGC
BadValue
See Also
DefaultGC(), XChangeGC(), XCopyGC(), XCreateGC(), XFreeGC(), XGContextFromGC(), XSetArcMode(), XSetBackground(), XSetClipMask(), XSetClipOrigin(), XSetClipRectangles(), XSetDashes(), XSetFillRule(), XSetFillStyle(), XSetForeground(), XSetGraphicsExposures(), XSetLineAttributes(), XSetPlaneMask(), XSetState(), XSetStipple(), XSetSubwindowMode(), XSetTSOrigin().
Copyright O’Reilly & Assoc. —