Code

Fixed a rendering problem in feOffset
[inkscape.git] / src / display / nr-filter-blend.h
1 #ifndef __NR_FILTER_BLEND_H__
2 #define __NR_FILTER_BLEND_H__
4 /*
5  * SVG feBlend renderer
6  *
7  * "This filter composites two objects together using commonly used
8  * imaging software blending modes. It performs a pixel-wise combination
9  * of two input images." 
10  * http://www.w3.org/TR/SVG11/filters.html#feBlend
11  *
12  * Authors:
13  *   Niko Kiirala <niko@kiirala.com>
14  *
15  * Copyright (C) 2007 authors
16  *
17  * Released under GNU GPL, read the file 'COPYING' for more information
18  */
20 #include "display/nr-filter-primitive.h"
21 #include "display/nr-filter-slot.h"
22 #include "libnr/nr-matrix.h"
24 namespace NR {
26 enum FilterBlendMode {
27     BLEND_NORMAL,
28     BLEND_MULTIPLY,
29     BLEND_SCREEN,
30     BLEND_DARKEN,
31     BLEND_LIGHTEN
32 };
34 class FilterBlend : public FilterPrimitive {
35 public:
36     FilterBlend();
37     static FilterPrimitive *create();
38     virtual ~FilterBlend();
40     virtual int render(FilterSlot &slot, Matrix const &trans);
42     virtual void set_input(int slot);
43     virtual void set_input(int input, int slot);
44     void set_mode(FilterBlendMode mode);
46 private:
47     FilterBlendMode _blend_mode;
48     int _input2;
49 };
52 } /* namespace NR */
57 #endif /* __NR_FILTER_BLEND_H__ */
58 /*
59   Local Variables:
60   mode:c++
61   c-file-style:"stroustrup"
62   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
63   indent-tabs-mode:nil
64   fill-column:99
65   End:
66 */
67 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :