Code

German translation update.
[inkscape.git] / src / sp-gradient-fns.h
1 #ifndef SEEN_SP_GRADIENT_FNS_H
2 #define SEEN_SP_GRADIENT_FNS_H
4 /** \file
5  * Macros and fn declarations related to gradients.
6  */
8 #include <glib/gtypes.h>
9 #include <glib-object.h>
10 #include <2geom/forward.h>
11 #include "sp-gradient-spread.h"
12 #include "sp-gradient-units.h"
14 class SPGradient;
16 #define SP_GRADIENT_STATE_IS_SET(g) (SP_GRADIENT(g)->state != SP_GRADIENT_STATE_UNKNOWN)
17 #define SP_GRADIENT_IS_VECTOR(g) (SP_GRADIENT(g)->state == SP_GRADIENT_STATE_VECTOR)
18 #define SP_GRADIENT_IS_PRIVATE(g) (SP_GRADIENT(g)->state == SP_GRADIENT_STATE_PRIVATE)
19 #define SP_GRADIENT_HAS_STOPS(g) (SP_GRADIENT(g)->has_stops)
20 #define SP_GRADIENT_SPREAD(g) (SP_GRADIENT(g)->spread)
21 #define SP_GRADIENT_UNITS(g) (SP_GRADIENT(g)->units)
23 /** Forces vector to be built, if not present (i.e. changed) */
24 void sp_gradient_ensure_vector(SPGradient *gradient);
26 /** Ensures that color array is populated */
27 void sp_gradient_ensure_colors(SPGradient *gradient);
29 void sp_gradient_set_units(SPGradient *gr, SPGradientUnits units);
30 void sp_gradient_set_spread(SPGradient *gr, SPGradientSpread spread);
32 SPGradientSpread sp_gradient_get_spread (SPGradient *gradient);
34 /* Gradient repr methods */
35 void sp_gradient_repr_write_vector(SPGradient *gr);
36 void sp_gradient_repr_clear_vector(SPGradient *gr);
38 void sp_gradient_render_vector_block_rgba(SPGradient *gr, guchar *px, gint w, gint h, gint rs, gint pos, gint span, bool horizontal);
39 void sp_gradient_render_vector_block_rgb(SPGradient *gr, guchar *px, gint w, gint h, gint rs, gint pos, gint span, bool horizontal);
41 /** Transforms to/from gradient position space in given environment */
42 Geom::Matrix sp_gradient_get_g2d_matrix(SPGradient const *gr, Geom::Matrix const &ctm,
43                                       Geom::Rect const &bbox);
44 Geom::Matrix sp_gradient_get_gs2d_matrix(SPGradient const *gr, Geom::Matrix const &ctm,
45                                        Geom::Rect const &bbox);
46 void sp_gradient_set_gs2d_matrix(SPGradient *gr, Geom::Matrix const &ctm, Geom::Rect const &bbox,
47                                  Geom::Matrix const &gs2d);
50 #endif /* !SEEN_SP_GRADIENT_FNS_H */
52 /*
53   Local Variables:
54   mode:c++
55   c-file-style:"stroustrup"
56   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
57   indent-tabs-mode:nil
58   fill-column:99
59   End:
60 */
61 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :