7
main (int argc, char **argv)
13
pixman_image_t *checkerboard;
14
pixman_image_t *destination;
15
#define D2F(d) (pixman_double_to_fixed(d))
16
pixman_transform_t trans = { {
17
{ D2F (-1.96830), D2F (-1.82250), D2F (512.12250)},
18
{ D2F (0.00000), D2F (-7.29000), D2F (1458.00000)},
19
{ D2F (0.00000), D2F (-0.00911), D2F (0.59231)},
23
checkerboard = pixman_image_create_bits (PIXMAN_a8r8g8b8,
27
destination = pixman_image_create_bits (PIXMAN_a8r8g8b8,
31
for (i = 0; i < HEIGHT / TILE_SIZE; ++i)
33
for (j = 0; j < WIDTH / TILE_SIZE; ++j)
35
double u = (double)(j + 1) / (WIDTH / TILE_SIZE);
36
double v = (double)(i + 1) / (HEIGHT / TILE_SIZE);
37
pixman_color_t black = { 0, 0, 0, 0xffff };
38
pixman_color_t white = {
41
(1 - (double)u) * 0xffff,
46
if ((j & 1) != (i & 1))
51
fill = pixman_image_create_solid_fill (c);
53
pixman_image_composite (PIXMAN_OP_SRC, fill, NULL, checkerboard,
54
0, 0, 0, 0, j * TILE_SIZE, i * TILE_SIZE,
55
TILE_SIZE, TILE_SIZE);
59
pixman_image_set_transform (checkerboard, &trans);
60
pixman_image_set_filter (checkerboard, PIXMAN_FILTER_BEST, NULL, 0);
61
pixman_image_set_repeat (checkerboard, PIXMAN_REPEAT_NONE);
63
pixman_image_composite (PIXMAN_OP_SRC,
64
checkerboard, NULL, destination,
68
show_image (destination);