summaryrefslogtreecommitdiff
path: root/qemu-pixman.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-09-25 16:23:24 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-11-01 14:00:04 +0100
commitd2ec7e24a270ba72a151b506ac57c6cd21e3c587 (patch)
tree42f1b5427bf7bb729d8e5cdb2d957aafd9f85797 /qemu-pixman.h
parente2134eb9223edac82cc7aa2281779c92c920d579 (diff)
downloadqemu-d2ec7e24a270ba72a151b506ac57c6cd21e3c587.tar.gz
pixman: helper functions
Add some helper functions which will be put into use by following patches. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'qemu-pixman.h')
-rw-r--r--qemu-pixman.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/qemu-pixman.h b/qemu-pixman.h
new file mode 100644
index 0000000000..7652c41277
--- /dev/null
+++ b/qemu-pixman.h
@@ -0,0 +1,32 @@
+#ifndef QEMU_PIXMAN_H
+#define QEMU_PIXMAN_H
+
+#include <pixman.h>
+
+#include "console.h"
+
+/*
+ * pixman image formats are defined to be native endian,
+ * that means host byte order on qemu. So we go define
+ * fixed formats here for cases where it is needed, like
+ * feeding libjpeg / libpng and writing screenshots.
+ */
+
+#ifdef HOST_WORDS_BIGENDIAN
+# define PIXMAN_BE_r8g8b8 PIXMAN_r8g8b8
+#else
+# define PIXMAN_BE_r8g8b8 PIXMAN_b8g8r8
+#endif
+
+/* -------------------------------------------------------------------- */
+
+int qemu_pixman_get_type(int rshift, int gshift, int bshift);
+pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf);
+
+pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format,
+ int width);
+void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb,
+ int width, int y);
+void qemu_pixman_image_unref(pixman_image_t *image);
+
+#endif /* QEMU_PIXMAN_H */