1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef SP_FECOMPONENTTRANSFER_FUNCNODE_H_SEEN
3 #define SP_FECOMPONENTTRANSFER_FUNCNODE_H_SEEN
4 
5 /** \file
6  * SVG <filter> implementation, see sp-filter.cpp.
7  */
8 /*
9  * Authors:
10  *   Hugo Rodrigues <haa.rodrigues@gmail.com>
11  *   Niko Kiirala <niko@kiirala.com>
12  *   Felipe Corrêa da Silva Sanches <juca@members.fsf.org>
13  *
14  * Copyright (C) 2006,2007 Authors
15  *
16  * Released under GNU GPL v2+, read the file 'COPYING' for more information.
17  */
18 
19 #include "../sp-object.h"
20 #include "display/nr-filter-component-transfer.h"
21 
22 #define SP_FEFUNCNODE(obj) (dynamic_cast<SPFeFuncNode*>((SPObject*)obj))
23 
24 class SPFeFuncNode : public SPObject {
25 public:
26     enum Channel {
27         R, G, B, A
28     };
29 
30 	SPFeFuncNode(Channel channel);
31 	~SPFeFuncNode() override;
32 
33     Inkscape::Filters::FilterComponentTransferType type;
34     std::vector<double> tableValues;
35     double slope;
36     double intercept;
37     double amplitude;
38     double exponent;
39     double offset;
40     Channel channel;
41 
42 protected:
43 	void build(SPDocument* doc, Inkscape::XML::Node* repr) override;
44 	void release() override;
45 
46 	void set(SPAttr key, const gchar* value) override;
47 
48 	void update(SPCtx* ctx, unsigned int flags) override;
49 
50 	Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags) override;
51 };
52 
53 #endif /* !SP_FECOMPONENTTRANSFER_FUNCNODE_H_SEEN */
54 
55 /*
56   Local Variables:
57   mode:c++
58   c-file-style:"stroustrup"
59   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
60   indent-tabs-mode:nil
61   fill-column:99
62   End:
63 */
64 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
65