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 "display/nr-filter-units.h"
18 #include <vector>
20 namespace NR {
22 enum FilterComponentTransferType {
23 COMPONENTTRANSFER_TYPE_IDENTITY,
24 COMPONENTTRANSFER_TYPE_TABLE,
25 COMPONENTTRANSFER_TYPE_DISCRETE,
26 COMPONENTTRANSFER_TYPE_LINEAR,
27 COMPONENTTRANSFER_TYPE_GAMMA,
28 COMPONENTTRANSFER_TYPE_ERROR
29 };
31 class FilterComponentTransfer : public FilterPrimitive {
32 public:
33 FilterComponentTransfer();
34 static FilterPrimitive *create();
35 virtual ~FilterComponentTransfer();
37 virtual int render(FilterSlot &slot, FilterUnits const &units);
38 virtual void area_enlarge(NRRectL &area, Matrix const &trans);
40 FilterComponentTransferType type[4];
41 std::vector<gdouble> tableValues[4];
42 double slope[4];
43 double intercept[4];
44 double amplitude[4];
45 double exponent[4];
46 double offset[4];
47 };
49 } /* namespace NR */
51 #endif /* __NR_FILTER_COMPONENT_TRANSFER_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 :