1 | #include <glib/gtypes.h> |
---|
2 | #include <libart_lgpl/art_render_gradient.h> |
---|
3 | #include "rsvg-defs.h" |
---|
4 | |
---|
5 | typedef struct _RsvgGradientStop RsvgGradientStop; |
---|
6 | typedef struct _RsvgGradientStops RsvgGradientStops; |
---|
7 | typedef struct _RsvgLinearGradient RsvgLinearGradient; |
---|
8 | typedef struct _RsvgRadialGradient RsvgRadialGradient; |
---|
9 | |
---|
10 | typedef struct _RsvgPaintServer RsvgPaintServer; |
---|
11 | |
---|
12 | typedef struct _RsvgPSCtx RsvgPSCtx; |
---|
13 | |
---|
14 | struct _RsvgPSCtx { |
---|
15 | int dummy; |
---|
16 | /* todo: we need to take in some context information, including: |
---|
17 | |
---|
18 | 1. The global affine transformation. |
---|
19 | |
---|
20 | 2. User coordinates at time of reference (to implement |
---|
21 | gradientUnits = "userSpaceOnUse"). |
---|
22 | |
---|
23 | 3. Object bounding box (to implement gradientUnits = |
---|
24 | "objectBoundingBox"). |
---|
25 | |
---|
26 | Maybe signal for lazy evaluation of object bbox. |
---|
27 | */ |
---|
28 | }; |
---|
29 | |
---|
30 | struct _RsvgGradientStop { |
---|
31 | double offset; |
---|
32 | guint32 rgba; |
---|
33 | }; |
---|
34 | |
---|
35 | struct _RsvgGradientStops { |
---|
36 | int n_stop; |
---|
37 | RsvgGradientStop *stop; |
---|
38 | }; |
---|
39 | |
---|
40 | struct _RsvgLinearGradient { |
---|
41 | RsvgDefVal super; |
---|
42 | double affine[6]; /* user space to actual at time of gradient def */ |
---|
43 | double x1, y1; |
---|
44 | double x2, y2; |
---|
45 | ArtGradientSpread spread; |
---|
46 | RsvgGradientStops *stops; |
---|
47 | }; |
---|
48 | |
---|
49 | struct _RsvgRadialGradient { |
---|
50 | RsvgDefVal super; |
---|
51 | double affine[6]; /* user space to actual at time of gradient def */ |
---|
52 | double cx, cy; |
---|
53 | double r; |
---|
54 | double fx, fy; |
---|
55 | RsvgGradientStops *stops; |
---|
56 | }; |
---|
57 | |
---|
58 | /* Create a new paint server based on a specification string. */ |
---|
59 | RsvgPaintServer * |
---|
60 | rsvg_paint_server_parse (const RsvgDefs *defs, const char *str); |
---|
61 | |
---|
62 | void |
---|
63 | rsvg_render_paint_server (ArtRender *ar, RsvgPaintServer *ps, |
---|
64 | const RsvgPSCtx *ctx); |
---|
65 | |
---|
66 | void |
---|
67 | rsvg_paint_server_ref (RsvgPaintServer *ps); |
---|
68 | |
---|
69 | void |
---|
70 | rsvg_paint_server_unref (RsvgPaintServer *ps); |
---|
71 | |
---|