Code

initial filter UI code drop from Nick
[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     BLEND_ENDMODE
33 };
35 class FilterBlend : public FilterPrimitive {
36 public:
37     FilterBlend();
38     static FilterPrimitive *create();
39     virtual ~FilterBlend();
41     virtual int render(FilterSlot &slot, Matrix const &trans);
43     virtual void set_input(int slot);
44     virtual void set_input(int input, int slot);
45     void set_mode(FilterBlendMode mode);
47 private:
48     FilterBlendMode _blend_mode;
49     int _input2;
50 };
53 } /* namespace NR */
58 #endif /* __NR_FILTER_BLEND_H__ */
59 /*
60   Local Variables:
61   mode:c++
62   c-file-style:"stroustrup"
63   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
64   indent-tabs-mode:nil
65   fill-column:99
66   End:
67 */
68 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :