14.2. Data Definitions for libXrender

This section defines global identifiers and their values that are associated with interfaces contained in libXrender. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.

This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.

This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.

14.2.1. X11/extensions/Xrender.h


#define XFixedToDouble(f)	(((XDouble) (f)) / 65536)
#define XDoubleToFixed(f)	((XFixed) ((f) * 65536))
#define PictFormatID	(1 << 0)
#define PictFormatType	(1 << 1)
#define PictFormatAlphaMask	(1 << 10)
#define PictFormatColormap	(1 << 11)
#define PictFormatDepth	(1 << 2)
#define PictFormatRed	(1 << 3)
#define PictFormatRedMask	(1 << 4)
#define PictFormatGreen	(1 << 5)
#define PictFormatGreenMask	(1 << 6)
#define PictFormatBlue	(1 << 7)
#define PictFormatBlueMask	(1 << 8)
#define PictFormatAlpha	(1 << 9)
#define PictStandardARGB32	0
#define PictStandardRGB24	1
#define PictStandardA8	2
#define PictStandardA4	3
#define PictStandardA1	4
#define PictStandardNUM	5

typedef long unsigned int GlyphSet;
typedef int XFixed;
typedef struct _XPointFixed {
    XFixed x;
    XFixed y;
} XPointFixed;
typedef struct _XCircle {
    XFixed x;
    XFixed y;
    XFixed radius;
} XCircle;
typedef double XDouble;
typedef struct _XSpanFix {
    XFixed left;
    XFixed right;
    XFixed y;
} XSpanFix;
typedef struct _XLineFixed {
    XPointFixed p1;
    XPointFixed p2;
} XLineFixed;

typedef struct _XTrapezoid {
    XFixed top;
    XFixed bottom;
    XLineFixed left;
    XLineFixed right;
} XTrapezoid;
typedef struct {
    unsigned short red;
    unsigned short green;
    unsigned short blue;
    unsigned short alpha;
} XRenderColor;
typedef long unsigned int Glyph;
typedef long unsigned int PictFormat;
typedef struct {
    short red;
    short redMask;
    short green;
    short greenMask;
    short blue;
    short blueMask;
    short alpha;
    short alphaMask;
} XRenderDirectFormat;
typedef struct {
    PictFormat id;
    int type;
    int depth;
    XRenderDirectFormat direct;
    Colormap colormap;
} XRenderPictFormat;
typedef struct _XGlyphInfo {
    unsigned short width;
    unsigned short height;
    short x;
    short y;
    short xOff;
    short yOff;
} XGlyphInfo;
typedef struct _XFilters {
    int nfilter;
    char **filter;
    int nalias;
    short int *alias;
} XFilters;
typedef struct _XTransform {
    XFixed matrix[3][3];
} XTransform;
typedef struct _XAnimCursor {
    Cursor cursor;
    long unsigned int delay;
} XAnimCursor;
typedef struct _XRadialGradient {
    XCircle inner;
    XCircle outer;
} XRadialGradient;
typedef struct _XGlyphElt32 {
    GlyphSet glyphset;
    const unsigned int *chars;
    int nchars;
    int xOff;
    int yOff;
} XGlyphElt32;
typedef struct _XGlyphElt8 {
    GlyphSet glyphset;
    const char *chars;
    int nchars;
    int xOff;
    int yOff;
} XGlyphElt8;
typedef struct _XConicalGradient {
    XPointFixed center;
    XFixed angle;
} XConicalGradient;
typedef struct _XLinearGradient {
    XPointFixed p1;
    XPointFixed p2;
} XLinearGradient;
typedef struct _XPointDouble {
    XDouble x;
    XDouble y;
} XPointDouble;
typedef struct _XRenderPictureAttributes {
    int repeat;
    Picture alpha_map;
    int alpha_x_origin;
    int alpha_y_origin;
    int clip_x_origin;
    int clip_y_origin;
    Pixmap clip_mask;
    int graphics_exposures;
    int subwindow_mode;
    int poly_edge;
    int poly_mode;
    Atom dither;
    int component_alpha;
} XRenderPictureAttributes;
typedef struct _XTrap {
    XSpanFix top;
    XSpanFix bottom;
} XTrap;
typedef struct _XIndexValue {
    long unsigned int pixel;
    unsigned short red;
    unsigned short green;
    unsigned short blue;
    unsigned short alpha;
} XIndexValue;
typedef struct _XGlyphElt16 {
    GlyphSet glyphset;
    const short unsigned int *chars;
    int nchars;
    int xOff;
    int yOff;
} XGlyphElt16;
typedef struct _XTriangle {
    XPointFixed p1;
    XPointFixed p2;
    XPointFixed p3;
} XTriangle;
extern void XRenderAddGlyphs(Display * dpy, GlyphSet glyphset,
			     const Glyph * gids, const XGlyphInfo * glyphs,
			     int nglyphs, const char *images,
			     int nbyte_images);
extern void XRenderAddTraps(Display * dpy, Picture picture, int xOff,
			    int yOff, const XTrap * traps, int ntrap);
extern void XRenderChangePicture(Display * dpy, Picture picture,
				 long unsigned int valuemask,
				 const XRenderPictureAttributes *
				 attributes);
extern void XRenderComposite(Display * dpy, int op, Picture src,
			     Picture mask, Picture dst, int src_x,
			     int src_y, int mask_x, int mask_y, int dst_x,
			     int dst_y, unsigned int width,
			     unsigned int height);
extern void XRenderCompositeDoublePoly(Display * dpy, int op, Picture src,
				       Picture dst,
				       const XRenderPictFormat *
				       maskFormat, int xSrc, int ySrc,
				       int xDst, int yDst,
				       const XPointDouble * fpoints,
				       int npoints, int winding);
extern void XRenderCompositeString16(Display * dpy, int op, Picture src,
				     Picture dst,
				     const XRenderPictFormat * maskFormat,
				     GlyphSet glyphset, int xSrc, int ySrc,
				     int xDst, int yDst,
				     const short unsigned int *string,
				     int nchar);
extern void XRenderCompositeString32(Display * dpy, int op, Picture src,
				     Picture dst,
				     const XRenderPictFormat * maskFormat,
				     GlyphSet glyphset, int xSrc, int ySrc,
				     int xDst, int yDst,
				     const unsigned int *string,
				     int nchar);
extern void XRenderCompositeString8(Display * dpy, int op, Picture src,
				    Picture dst,
				    const XRenderPictFormat * maskFormat,
				    GlyphSet glyphset, int xSrc, int ySrc,
				    int xDst, int yDst, const char *string,
				    int nchar);
extern void XRenderCompositeText16(Display * dpy, int op, Picture src,
				   Picture dst,
				   const XRenderPictFormat * maskFormat,
				   int xSrc, int ySrc, int xDst, int yDst,
				   const XGlyphElt16 * elts, int nelt);
extern void XRenderCompositeText32(Display * dpy, int op, Picture src,
				   Picture dst,
				   const XRenderPictFormat * maskFormat,
				   int xSrc, int ySrc, int xDst, int yDst,
				   const XGlyphElt32 * elts, int nelt);
extern void XRenderCompositeText8(Display * dpy, int op, Picture src,
				  Picture dst,
				  const XRenderPictFormat * maskFormat,
				  int xSrc, int ySrc, int xDst, int yDst,
				  const XGlyphElt8 * elts, int nelt);
extern void XRenderCompositeTrapezoids(Display * dpy, int op, Picture src,
				       Picture dst,
				       const XRenderPictFormat *
				       maskFormat, int xSrc, int ySrc,
				       const XTrapezoid * traps,
				       int ntrap);
extern void XRenderCompositeTriFan(Display * dpy, int op, Picture src,
				   Picture dst,
				   const XRenderPictFormat * maskFormat,
				   int xSrc, int ySrc,
				   const XPointFixed * points, int npoint);
extern void XRenderCompositeTriStrip(Display * dpy, int op, Picture src,
				     Picture dst,
				     const XRenderPictFormat * maskFormat,
				     int xSrc, int ySrc,
				     const XPointFixed * points,
				     int npoint);
extern void XRenderCompositeTriangles(Display * dpy, int op, Picture src,
				      Picture dst,
				      const XRenderPictFormat * maskFormat,
				      int xSrc, int ySrc,
				      const XTriangle * triangles,
				      int ntriangle);
extern Cursor XRenderCreateAnimCursor(Display * dpy, int ncursor,
				      XAnimCursor * cursors);
extern Picture XRenderCreateConicalGradient(Display * dpy,
					    const XConicalGradient *
					    gradient, const XFixed * stops,
					    const XRenderColor * colors,
					    int nstops);
extern Cursor XRenderCreateCursor(Display * dpy, Picture source,
				  unsigned int x, unsigned int y);
extern GlyphSet XRenderCreateGlyphSet(Display * dpy,
				      const XRenderPictFormat * format);
extern Picture XRenderCreateLinearGradient(Display * dpy,
					   const XLinearGradient *
					   gradient, const XFixed * stops,
					   const XRenderColor * colors,
					   int nstops);
extern Picture XRenderCreatePicture(Display * dpy, Drawable drawable,
				    const XRenderPictFormat * format,
				    long unsigned int valuemask,
				    const XRenderPictureAttributes *
				    attributes);
extern Picture XRenderCreateRadialGradient(Display * dpy,
					   const XRadialGradient *
					   gradient, const XFixed * stops,
					   const XRenderColor * colors,
					   int nstops);
extern Picture XRenderCreateSolidFill(Display * dpy,
				      const XRenderColor * color);
extern void XRenderFillRectangle(Display * dpy, int op, Picture dst,
				 const XRenderColor * color, int x, int y,
				 unsigned int width, unsigned int height);
extern void XRenderFillRectangles(Display * dpy, int op, Picture dst,
				  const XRenderColor * color,
				  const XRectangle * rectangles,
				  int n_rects);
extern XRenderPictFormat *XRenderFindFormat(Display * dpy,
					    long unsigned int mask,
					    const XRenderPictFormat *
					    templ, int count);
extern XRenderPictFormat *XRenderFindStandardFormat(Display * dpy,
						    int format);
extern XRenderPictFormat *XRenderFindVisualFormat(Display * dpy,
						  const Visual * visual);
extern void XRenderFreeGlyphSet(Display * dpy, GlyphSet glyphset);
extern void XRenderFreeGlyphs(Display * dpy, GlyphSet glyphset,
			      const Glyph * gids, int nglyphs);
extern void XRenderFreePicture(Display * dpy, Picture picture);
extern int XRenderParseColor(Display * dpy, char *spec,
			     XRenderColor * def);
extern int XRenderQueryExtension(Display * dpy, int *event_basep,
				 int *error_basep);
extern XFilters *XRenderQueryFilters(Display * dpy, Drawable drawable);
extern int XRenderQueryFormats(Display * dpy);
extern XIndexValue *XRenderQueryPictIndexValues(Display * dpy,
						const XRenderPictFormat *
						format, int *num);
extern int XRenderQuerySubpixelOrder(Display * dpy, int screen);
extern int XRenderQueryVersion(Display * dpy, int *major_versionp,
			       int *minor_versionp);
extern GlyphSet XRenderReferenceGlyphSet(Display * dpy, GlyphSet existing);
extern void XRenderSetPictureClipRectangles(Display * dpy, Picture picture,
					    int xOrigin, int yOrigin,
					    const XRectangle * rects,
					    int n);
extern void XRenderSetPictureClipRegion(Display * dpy, Picture picture,
					Region r);
extern void XRenderSetPictureFilter(Display * dpy, Picture picture,
				    const char *filter, XFixed * params,
				    int nparams);
extern void XRenderSetPictureTransform(Display * dpy, Picture picture,
				       XTransform * transform);
extern int XRenderSetSubpixelOrder(Display * dpy, int screen,
				   int subpixel);

14.2.2. X11/extensions/render.h


#define FilterBest	"best"
#define FilterBilinear	"bilinear"
#define FilterConvolution	"convolution"
#define FilterFast	"fast"
#define FilterGood	"good"
#define FilterNearest	"nearest"
#define RENDER_NAME	"RENDER"
#define CPRepeat	(1 << 0)
#define CPAlphaMap	(1 << 1)
#define CPPolyMode	(1 << 10)
#define CPDither	(1 << 11)
#define CPComponentAlpha	(1 << 12)
#define CPAlphaXOrigin	(1 << 2)
#define CPAlphaYOrigin	(1 << 3)
#define CPClipXOrigin	(1 << 4)
#define CPClipYOrigin	(1 << 5)
#define CPClipMask	(1 << 6)
#define CPGraphicsExposure	(1 << 7)
#define CPSubwindowMode	(1 << 8)
#define CPPolyEdge	(1 << 9)
#define RenderNumberErrors	(BadGlyph+1)
#define RenderNumberRequests	(X_RenderCreateConicalGradient+1)
#define FilterAliasNone	-1
#define BadPictFormat	0
#define PictOpClear	0
#define PictOpMinimum	0
#define PictTypeIndexed	0
#define PolyEdgeSharp	0
#define PolyModePrecise	0
#define RENDER_MAJOR	0
#define RepeatNone	0
#define SubPixelUnknown	0
#define X_RenderQueryVersion	0
#define PictOpDisjointClear	0x10
#define PictOpDisjointMinimum	0x10
#define PictOpDisjointSrc	0x11
#define PictOpDisjointDst	0x12
#define PictOpDisjointOver	0x13
#define PictOpDisjointOverReverse	0x14
#define PictOpDisjointIn	0x15
#define PictOpDisjointInReverse	0x16
#define PictOpDisjointOut	0x17
#define PictOpDisjointOutReverse	0x18
#define PictOpDisjointAtop	0x19
#define PictOpDisjointAtopReverse	0x1a
#define PictOpDisjointMaximum	0x1b
#define PictOpDisjointXor	0x1b
#define PictOpConjointClear	0x20
#define PictOpConjointMinimum	0x20
#define PictOpConjointSrc	0x21
#define PictOpConjointDst	0x22
#define PictOpConjointOver	0x23
#define PictOpConjointOverReverse	0x24
#define PictOpConjointIn	0x25
#define PictOpConjointInReverse	0x26
#define PictOpConjointOut	0x27
#define PictOpConjointOutReverse	0x28
#define PictOpConjointAtop	0x29
#define PictOpConjointAtopReverse	0x2a
#define PictOpConjointMaximum	0x2b
#define PictOpConjointXor	0x2b
#define BadPicture	1
#define PictOpSrc	1
#define PictTypeDirect	1
#define PolyEdgeSmooth	1
#define PolyModeImprecise	1
#define RepeatNormal	1
#define SubPixelHorizontalRGB	1
#define X_RenderQueryPictFormats	1
#define PictOpAtopReverse	10
#define RENDER_MINOR	10
#define X_RenderTrapezoids	10
#define PictOpXor	11
#define X_RenderTriangles	11
#define CPLastBit	12
#define PictOpAdd	12
#define X_RenderTriStrip	12
#define PictOpMaximum	13
#define PictOpSaturate	13
#define X_RenderTriFan	13
#define X_RenderColorTrapezoids	14
#define X_RenderColorTriangles	15
#define X_RenderCreateGlyphSet	17
#define X_RenderReferenceGlyphSet	18
#define X_RenderFreeGlyphSet	19
#define BadPictOp	2
#define PictOpDst	2
#define RepeatPad	2
#define SubPixelHorizontalBGR	2
#define X_RenderQueryPictIndexValues	2
#define X_RenderAddGlyphs	20
#define X_RenderAddGlyphsFromPicture	21
#define X_RenderFreeGlyphs	22
#define X_RenderCompositeGlyphs8	23
#define X_RenderCompositeGlyphs16	24
#define X_RenderCompositeGlyphs32	25
#define X_RenderFillRectangles	26
#define X_RenderCreateCursor	27
#define X_RenderSetPictureTransform	28
#define X_RenderQueryFilters	29
#define BadGlyphSet	3
#define PictOpOver	3
#define RepeatReflect	3
#define SubPixelVerticalRGB	3
#define X_RenderQueryDithers	3
#define X_RenderSetPictureFilter	30
#define X_RenderCreateAnimCursor	31
#define X_RenderAddTraps	32
#define X_RenderCreateSolidFill	33
#define X_RenderCreateLinearGradient	34
#define X_RenderCreateRadialGradient	35
#define X_RenderCreateConicalGradient	36
#define BadGlyph	4
#define PictOpOverReverse	4
#define SubPixelVerticalBGR	4
#define X_RenderCreatePicture	4
#define PictOpIn	5
#define SubPixelNone	5
#define X_RenderChangePicture	5
#define PictOpInReverse	6
#define X_RenderSetPictureClipRectangles	6
#define PictOpOut	7
#define X_RenderFreePicture	7
#define PictOpOutReverse	8
#define X_RenderComposite	8
#define PictOpAtop	9
#define X_RenderScale	9

typedef long unsigned int Picture;