source: trunk/third/librsvg/rsvg-paint-server.h @ 18805

Revision 18805, 3.0 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18804, which included commits to RCS files with non-trunk default branches.
Line 
1/* vim: set sw=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2/*
3   rsvg-paint-server.h : RSVG colors
4
5   Copyright (C) 2000 Eazel, Inc.
6   Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com>
7
8   This program is free software; you can redistribute it and/or
9   modify it under the terms of the GNU Library General Public License as
10   published by the Free Software Foundation; either version 2 of the
11   License, or (at your option) any later version.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16   Library General Public License for more details.
17
18   You should have received a copy of the GNU Library General Public
19   License along with this program; if not, write to the
20   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21   Boston, MA 02111-1307, USA.
22
23   Author: Raph Levien <raph@artofcode.com>
24*/
25
26#ifndef RSVG_PAINT_SERVER_H
27#define RSVG_PAINT_SERVER_H
28
29#include <glib/gtypes.h>
30#include <libart_lgpl/art_render_gradient.h>
31#include "rsvg-defs.h"
32
33G_BEGIN_DECLS
34
35typedef struct _RsvgGradientStop RsvgGradientStop;
36typedef struct _RsvgGradientStops RsvgGradientStops;
37typedef struct _RsvgLinearGradient RsvgLinearGradient;
38typedef struct _RsvgRadialGradient RsvgRadialGradient;
39
40typedef struct _RsvgPaintServer RsvgPaintServer;
41
42typedef struct _RsvgPSCtx RsvgPSCtx;
43
44struct _RsvgPSCtx {
45        int dummy;
46        /* todo: we need to take in some context information, including:
47           
48        1. The global affine transformation.
49       
50        2. User coordinates at time of reference (to implement
51        gradientUnits = "userSpaceOnUse").
52       
53        3. Object bounding box (to implement gradientUnits =
54        "objectBoundingBox").
55       
56        Maybe signal for lazy evaluation of object bbox.
57        */
58};
59
60struct _RsvgGradientStop {
61        double offset;
62        guint32 rgba;
63};
64
65struct _RsvgGradientStops {
66        int n_stop;
67        RsvgGradientStop *stop;
68};
69
70struct _RsvgLinearGradient {
71        RsvgDefVal super;
72        gboolean obj_bbox;
73        double affine[6]; /* user space to actual at time of gradient def */
74        RsvgGradientStops *stops;
75        ArtGradientSpread spread;
76        double x1, y1;
77        double x2, y2;
78};
79
80struct _RsvgRadialGradient {
81        RsvgDefVal super;
82        gboolean obj_bbox;
83        double affine[6]; /* user space to actual at time of gradient def */
84        RsvgGradientStops *stops;
85        ArtGradientSpread spread;
86        double cx, cy;
87        double r;
88        double fx, fy;
89};
90
91/* Create a new paint server based on a specification string. */
92RsvgPaintServer *
93rsvg_paint_server_parse (const RsvgDefs *defs, const char *str);
94
95void
96rsvg_render_paint_server (ArtRender *ar, RsvgPaintServer *ps,
97                                                  const RsvgPSCtx *ctx);
98
99void
100rsvg_paint_server_ref (RsvgPaintServer *ps);
101
102void
103rsvg_paint_server_unref (RsvgPaintServer *ps);
104
105RsvgRadialGradient *
106rsvg_clone_radial_gradient (const RsvgRadialGradient *grad, gboolean * shallow_cloned);
107
108RsvgLinearGradient *
109rsvg_clone_linear_gradient (const RsvgLinearGradient *grad, gboolean * shallow_cloned);
110
111G_END_DECLS
112
113#endif
Note: See TracBrowser for help on using the repository browser.