XSetFunction()XSetFunction()NameXSetFunction – set the bitwise logical operation in a graphics context.
Synopsis
XSetFunction(display, gc, function)
Display *display;
GC gc;
int function;
Arguments
display Specifies a connection to an X server; returned from XOpenDis‐
play().
gc Specifies the graphics context.
function
Specifies the logical operation you want for the specified
graphics context. See Description for the choices and their
meanings.
DescriptionXSetFunction() sets the logical operation applied between the source
pixel values (generated by the drawing request) and existing destina‐
tion 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 Value 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)
Symbol Bit Meaning
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 AlsoXDefaultGC(), XChangeGC(), XCopyGC(), XCreateGC(), XFreeGC(), XGCon‐
textFromGC(), XSetArcMode(), XSetBackground(), XSetClipMask(), XSetCli‐
pOrigin(), XSetClipRectangles(), XSetDashes(), XSetFillRule(), XSet‐
FillStyle(), XSetForeground(), XSetGraphicsExposures(), XSetLineAt‐
tributes(), XSetPlaneMask(), XSetState(), XSetStipple(), XSetSubwindow‐
Mode(), XSetTSOrigin().
Xlib - Graphics Context XSetFunction()