]> Git Repo - qemu.git/blame - include/ui/qemu-pixman.h
qapi: improve TransactionAction doc
[qemu.git] / include / ui / qemu-pixman.h
CommitLineData
daa8e5a0
GH
1/*
2 * This work is licensed under the terms of the GNU GPL, version 2 or later.
3 * See the COPYING file in the top-level directory.
4 */
5
d2ec7e24
GH
6#ifndef QEMU_PIXMAN_H
7#define QEMU_PIXMAN_H
8
092bb306
GH
9/* pixman-0.16.0 headers have a redundant declaration */
10#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
e6f53fd5 11#pragma GCC diagnostic push
092bb306
GH
12#pragma GCC diagnostic ignored "-Wredundant-decls"
13#endif
d2ec7e24 14#include <pixman.h>
092bb306 15#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
e6f53fd5 16#pragma GCC diagnostic pop
092bb306 17#endif
d2ec7e24 18
d2ec7e24
GH
19/*
20 * pixman image formats are defined to be native endian,
21 * that means host byte order on qemu. So we go define
22 * fixed formats here for cases where it is needed, like
23 * feeding libjpeg / libpng and writing screenshots.
24 */
25
26#ifdef HOST_WORDS_BIGENDIAN
27# define PIXMAN_BE_r8g8b8 PIXMAN_r8g8b8
43db7c3d
GH
28# define PIXMAN_BE_x8r8g8b8 PIXMAN_x8r8g8b8
29# define PIXMAN_BE_a8r8g8b8 PIXMAN_a8r8g8b8
30# define PIXMAN_BE_b8g8r8x8 PIXMAN_b8g8r8x8
31# define PIXMAN_BE_b8g8r8a8 PIXMAN_b8g8r8a8
32# define PIXMAN_BE_r8g8b8x8 PIXMAN_r8g8b8x8
33# define PIXMAN_BE_r8g8b8a8 PIXMAN_r8g8b8a8
34# define PIXMAN_BE_x8b8g8r8 PIXMAN_x8b8g8r8
35# define PIXMAN_BE_a8b8g8r8 PIXMAN_a8b8g8r8
c1d37cd3 36# define PIXMAN_LE_x8r8g8b8 PIXMAN_b8g8r8x8
d2ec7e24
GH
37#else
38# define PIXMAN_BE_r8g8b8 PIXMAN_b8g8r8
43db7c3d
GH
39# define PIXMAN_BE_x8r8g8b8 PIXMAN_b8g8r8x8
40# define PIXMAN_BE_a8r8g8b8 PIXMAN_b8g8r8a8
41# define PIXMAN_BE_b8g8r8x8 PIXMAN_x8r8g8b8
42# define PIXMAN_BE_b8g8r8a8 PIXMAN_a8r8g8b8
43# define PIXMAN_BE_r8g8b8x8 PIXMAN_x8b8g8r8
44# define PIXMAN_BE_r8g8b8a8 PIXMAN_a8b8g8r8
45# define PIXMAN_BE_x8b8g8r8 PIXMAN_r8g8b8x8
46# define PIXMAN_BE_a8b8g8r8 PIXMAN_r8g8b8a8
c1d37cd3 47# define PIXMAN_LE_x8r8g8b8 PIXMAN_x8r8g8b8
d2ec7e24
GH
48#endif
49
50/* -------------------------------------------------------------------- */
51
a93a3af9 52PixelFormat qemu_pixelformat_from_pixman(pixman_format_code_t format);
1527a25e 53pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian);
d2ec7e24
GH
54int qemu_pixman_get_type(int rshift, int gshift, int bshift);
55pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf);
8cd996f4
GH
56bool qemu_pixman_check_format(DisplayChangeListener *dcl,
57 pixman_format_code_t format);
d2ec7e24
GH
58
59pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format,
60 int width);
61void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb,
bc210eb1 62 int width, int x, int y);
43c7d8bd
GH
63void qemu_pixman_linebuf_copy(pixman_image_t *fb, int width, int x, int y,
64 pixman_image_t *linebuf);
d9a86569
GH
65pixman_image_t *qemu_pixman_mirror_create(pixman_format_code_t format,
66 pixman_image_t *image);
d2ec7e24
GH
67void qemu_pixman_image_unref(pixman_image_t *image);
68
867c538f 69pixman_color_t qemu_pixman_color(PixelFormat *pf, uint32_t color);
b7627952
GH
70pixman_image_t *qemu_pixman_glyph_from_vgafont(int height, const uint8_t *font,
71 unsigned int ch);
72void qemu_pixman_glyph_render(pixman_image_t *glyph,
73 pixman_image_t *surface,
74 pixman_color_t *fgcol,
75 pixman_color_t *bgcol,
76 int x, int y, int cw, int ch);
867c538f 77
d2ec7e24 78#endif /* QEMU_PIXMAN_H */
This page took 0.21159 seconds and 4 git commands to generate.