7 main (int argc, char **argv)
12 uint32_t *dest = malloc (WIDTH * HEIGHT * 4);
13 pixman_image_t *src_img;
14 pixman_image_t *dest_img;
16 pixman_gradient_stop_t stops[2] =
18 { pixman_int_to_fixed (0), { 0x0000, 0x0000, 0xffff, 0xffff } },
19 { pixman_int_to_fixed (1), { 0xffff, 0x1111, 0x1111, 0xffff } }
21 pixman_point_fixed_t p1 = { pixman_double_to_fixed (50), 0 };
22 pixman_point_fixed_t p2 = { pixman_double_to_fixed (200), 0 };
24 pixman_transform_t trans = {
25 { { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), },
26 { pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), },
27 { pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) }
31 pixman_transform_t trans = {
32 { { pixman_fixed_1, 0, 0 },
33 { 0, pixman_fixed_1, 0 },
34 { 0, 0, pixman_fixed_1 } }
39 pixman_point_fixed_t c_inner;
40 pixman_point_fixed_t c_outer;
41 pixman_fixed_t r_inner;
42 pixman_fixed_t r_outer;
45 for (i = 0; i < WIDTH * HEIGHT; ++i)
48 dest_img = pixman_image_create_bits (PIXMAN_a8r8g8b8,
54 c_inner.x = pixman_double_to_fixed (50.0);
55 c_inner.y = pixman_double_to_fixed (50.0);
56 c_outer.x = pixman_double_to_fixed (50.0);
57 c_outer.y = pixman_double_to_fixed (50.0);
59 r_outer = pixman_double_to_fixed (50.0);
61 src_img = pixman_image_create_conical_gradient (&c_inner, r_inner,
65 src_img = pixman_image_create_conical_gradient (&c_inner, r_inner,
67 src_img = pixman_image_create_linear_gradient (&c_inner, &c_outer,
72 src_img = pixman_image_create_linear_gradient (&p1, &p2,
75 pixman_image_set_transform (src_img, &trans);
76 pixman_image_set_repeat (src_img, PIXMAN_REPEAT_NONE);
78 pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img,
79 0, 0, 0, 0, 0, 0, 10 * WIDTH, HEIGHT);
81 printf ("0, 0: %x\n", dest[0]);
82 printf ("10, 10: %x\n", dest[10 * 10 + 10]);
83 printf ("w, h: %x\n", dest[(HEIGHT - 1) * 100 + (WIDTH - 1)]);
85 show_image (dest_img);
87 pixman_image_unref (src_img);
88 pixman_image_unref (dest_img);