1
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3
Copyright (C) 2009 Red Hat, Inc.
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with this library; if not, see <http://www.gnu.org/licenses/>.
19
#ifndef _H__PIXMAN_UTILS
20
#define _H__PIXMAN_UTILS
22
#include <spice/types.h>
24
#define PIXMAN_DONT_DEFINE_STDINT
33
/* This lists all possible 2 argument binary raster ops.
34
* This enum has the same values as the X11 GXcopy type
35
* and same as the GL constants (GL_AND etc) if you
36
* or it with 0x1500. However it is not exactly the
37
* same as the win32 ROP2 type (they use another order).
40
SPICE_ROP_CLEAR, /* 0x0 0 */
41
SPICE_ROP_AND, /* 0x1 src AND dst */
42
SPICE_ROP_AND_REVERSE, /* 0x2 src AND NOT dst */
43
SPICE_ROP_COPY, /* 0x3 src */
44
SPICE_ROP_AND_INVERTED, /* 0x4 (NOT src) AND dst */
45
SPICE_ROP_NOOP, /* 0x5 dst */
46
SPICE_ROP_XOR, /* 0x6 src XOR dst */
47
SPICE_ROP_OR, /* 0x7 src OR dst */
48
SPICE_ROP_NOR, /* 0x8 (NOT src) AND (NOT dst) */
49
SPICE_ROP_EQUIV, /* 0x9 (NOT src) XOR dst */
50
SPICE_ROP_INVERT, /* 0xa NOT dst */
51
SPICE_ROP_OR_REVERSE, /* 0xb src OR (NOT dst) */
52
SPICE_ROP_COPY_INVERTED, /* 0xc NOT src */
53
SPICE_ROP_OR_INVERTED, /* 0xd (NOT src) OR dst */
54
SPICE_ROP_NAND, /* 0xe (NOT src) OR (NOT dst) */
55
SPICE_ROP_SET /* 0xf 1 */
59
int spice_pixman_image_get_bpp(pixman_image_t *image);
61
pixman_format_code_t spice_surface_format_to_pixman(uint32_t surface_format);
62
pixman_format_code_t spice_bitmap_format_to_pixman(int bitmap_format,
63
uint32_t palette_surface_format);
64
pixman_image_t *spice_bitmap_try_as_pixman(int src_format, int flags,
65
int width, int height,
66
uint8_t *data, int stride);
67
pixman_image_t *spice_bitmap_to_pixman(pixman_image_t *dest_image,
68
int src_format, int flags,
69
int width, int height,
70
uint8_t *src, int src_stride,
71
uint32_t palette_surface_format,
72
SpicePalette *palette);
73
pixman_image_t *spice_bitmap_convert_to_pixman(pixman_format_code_t dest_format,
74
pixman_image_t *dest_image,
75
int src_format, int flags,
76
int width, int height,
77
uint8_t *src, int src_stride,
78
uint32_t palette_surface_format,
79
SpicePalette *palette);
81
void spice_pixman_region32_init_from_bitmap(pixman_region32_t *region,
83
int width, int height,
85
pixman_bool_t spice_pixman_region32_init_rects(pixman_region32_t *region,
86
const SpiceRect *rects,
88
void spice_pixman_fill_rect(pixman_image_t *dest,
92
void spice_pixman_fill_rect_rop(pixman_image_t *dest,
97
void spice_pixman_tile_rect(pixman_image_t *dest,
100
pixman_image_t *tile,
103
void spice_pixman_tile_rect_rop(pixman_image_t *dest,
106
pixman_image_t *tile,
110
void spice_pixman_blit(pixman_image_t *dest,
112
int src_x, int src_y,
113
int dest_x, int dest_y,
115
void spice_pixman_blit_rop(pixman_image_t *dest,
117
int src_x, int src_y,
118
int dest_x, int dest_y,
121
void spice_pixman_blit_colorkey(pixman_image_t *dest,
123
int src_x, int src_y,
124
int dest_x, int dest_y,
125
int width, int height,
126
uint32_t transparent_color);
127
void spice_pixman_copy_rect(pixman_image_t *image,
128
int src_x, int src_y,
130
int dest_x, int dest_y);
136
#endif /* _H__PIXMAN_UTILS */