summaryrefslogtreecommitdiff
path: root/fimage.h
blob: cc357d29a1680d008015b86a9dc3677d8ba8aac9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
typedef struct fragment_t fragment_t;

#define TRUE 1
#define FALSE 0

fragment_t *fragment_new_blank  (int                   width,
				 int                   height);
fragment_t *fragment_new_white  (int                   width,
				 int                   height);
fragment_t *fragment_new_traps  (int                   width,
				 int                   height,
				 int                   n_traps,
				 pixman_trapezoid_t   *traps);
fragment_t *fragment_new_glyphs (int                   width,
				 int                   height,
				 pixman_glyph_cache_t *cache,
				 int                   n_glyphs,
				 pixman_glyph_t       *glyphs);
fragment_t *fragment_new_image  (int                   width,
				 int                   height,
				 pixman_image_t       *image);
fragment_t *fragment_new_region (pixman_region32_t    *region);

/* Creates a new fragment corresponding to the intersection of
 * source with destination. The content of this fragment is
 * (dest OP source).
 *
 * The intersection is subtracted from dest. The source is not changed
 */
fragment_t *  fragment_composite (fragment_t     *dest,
				  pixman_op_t     op,
				  fragment_t     *source);
/* A new fragment is create that is the same as dest with the
 * region of other subtracted. @dest is freed (or, more likely, recycled)
 */
fragment_t *  fragment_subtract  (fragment_t     *dest,
				  fragment_t     *other);
pixman_bool_t fragment_apply     (fragment_t     *fragment,
				  pixman_image_t *image);

void fragment_free (fragment_t *fragment);