Code

a hack to prevent the redraw of the entire area when a no-fill ctrlrect is deleted
[inkscape.git] / src / display / nr-filter-component-transfer.h
1 #ifndef __NR_FILTER_COMPONENT_TRANSFER_H__
2 #define __NR_FILTER_COMPONENT_TRANSFER_H__
4 /*
5  * feComponentTransfer filter primitive renderer
6  *
7  * Authors:
8  *   Felipe CorrĂȘa da Silva Sanches <felipe.sanches@gmail.com>
9  *
10  * Copyright (C) 2007 authors
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #include "display/nr-filter-primitive.h"
16 #include "display/nr-filter-slot.h"
17 #include <vector>
19 namespace NR {
21 enum FilterComponentTransferType {
22     COMPONENTTRANSFER_TYPE_IDENTITY,
23     COMPONENTTRANSFER_TYPE_TABLE,
24     COMPONENTTRANSFER_TYPE_DISCRETE,
25     COMPONENTTRANSFER_TYPE_LINEAR,
26     COMPONENTTRANSFER_TYPE_GAMMA,
27     COMPONENTTRANSFER_TYPE_ERROR
28 };
30 class FilterComponentTransfer : public FilterPrimitive {
31 public:
32     FilterComponentTransfer();
33     static FilterPrimitive *create();
34     virtual ~FilterComponentTransfer();
36     virtual int render(FilterSlot &slot, Matrix const &trans);
37     virtual void area_enlarge(NRRectL &area, Matrix const &trans);
39     void set_type(FilterComponentTransferType t);    
40     void set_tableValues(std::vector<gdouble>& tv);
41     void set_slope(double s);
42     void set_intercept(double i);
43     void set_amplitude(double a);
44     void set_exponent(double e);
45     void set_offset(double o);
47 private:
48     FilterComponentTransferType type;
49     std::vector<gdouble> tableValues;
50     double slope;
51     double intercept;
52     double amplitude;
53     double exponent;
54     double offset;
55 };
57 } /* namespace NR */
59 #endif /* __NR_FILTER_COMPONENT_TRANSFER_H__ */
60 /*
61   Local Variables:
62   mode:c++
63   c-file-style:"stroustrup"
64   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
65   indent-tabs-mode:nil
66   fill-column:99
67   End:
68 */
69 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :