diff options
Diffstat (limited to 'renderops.cpp')
-rw-r--r-- | renderops.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/renderops.cpp b/renderops.cpp new file mode 100644 index 0000000..562734a --- /dev/null +++ b/renderops.cpp @@ -0,0 +1,42 @@ +#include <QX11Info> +#include "renderops.h" + +#include <X11/extensions/Xrender.h> + + +Picture ARGB32Creator(int w, int h) +{ + XRenderPictFormat *fmt = XRenderFindStandardFormat(QX11Info::display(), PictStandardARGB32); + XRenderPictureAttributes att; + + Drawable draw = XCreatePixmap(QX11Info::display(), draw, w, h, fmt->depth); + att.dither = 1; + att.component_alpha = 1; + att.repeat = 0; + return XRenderCreatePicture(QX11Info::display(), draw, fmt, + CPRepeat | CPDither | CPComponentAlpha, &att); +} + + +Picture RGB24Creator(int w, int h) +{ + return ARGB32Creator(w, h); +} + + +Picture A8Creator(int w, int h) +{ + return ARGB32Creator(w, h); +} + + +Picture A4Creator(int w, int h) +{ + return ARGB32Creator(w, h); +} + + +Picture A1Creator(int w, int h) +{ + return ARGB32Creator(w, h); +} |