1#include <math.h> 2#include <stdio.h> 3#include <stdlib.h> 4#include "utils.h" 5 6#define WIDTH 100 7#define HEIGHT 100 8 9int 10main () 11{ 12 pixman_image_t *radial; 13 pixman_image_t *dest = pixman_image_create_bits ( 14 PIXMAN_a8r8g8b8, WIDTH, HEIGHT, NULL, -1); 15 16 static const pixman_transform_t xform = 17 { 18 { { 0x346f7, 0x0, 0x0 }, 19 { 0x0, 0x346f7, 0x0 }, 20 { 0x0, 0x0, 0x10000 } 21 }, 22 }; 23 24 static const pixman_gradient_stop_t stops[] = 25 { 26 { 0xde61, { 0x4481, 0x96e8, 0x1e6a, 0x29e1 } }, 27 { 0xfdd5, { 0xfa10, 0xcc26, 0xbc43, 0x1eb7 } }, 28 { 0xfe1e, { 0xd257, 0x5bac, 0x6fc2, 0xa33b } }, 29 }; 30 31 static const pixman_point_fixed_t inner = { 0x320000, 0x320000 }; 32 static const pixman_point_fixed_t outer = { 0x320000, 0x3cb074 }; 33 34 enable_divbyzero_exceptions (); 35 enable_invalid_exceptions (); 36 37 radial = pixman_image_create_radial_gradient ( 38 &inner, 39 &outer, 40 0xab074, /* inner radius */ 41 0x0, /* outer radius */ 42 stops, sizeof (stops) / sizeof (stops[0])); 43 44 pixman_image_set_repeat (radial, PIXMAN_REPEAT_REFLECT); 45 pixman_image_set_transform (radial, &xform); 46 47 pixman_image_composite ( 48 PIXMAN_OP_OVER, 49 radial, NULL, dest, 50 0, 0, 0, 0, 51 0, 0, WIDTH, HEIGHT); 52 53 pixman_image_unref (radial); 54 pixman_image_unref (dest); 55 56 return 0; 57} 58