bec40dc70f043ac32c9a3d7cd18ea1072ea93b68
[WebKit-https.git] / WebCore / svg / SVGFEConvolveMatrixElement.h
1 /*
2  * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef SVGFEConvolveMatrixElement_h
21 #define SVGFEConvolveMatrixElement_h
22
23 #if ENABLE(SVG) && ENABLE(FILTERS)
24 #include "FEConvolveMatrix.h"
25 #include "SVGAnimatedNumberList.h"
26 #include "SVGFilterPrimitiveStandardAttributes.h"
27
28 namespace WebCore {
29
30 class SVGFEConvolveMatrixElement : public SVGFilterPrimitiveStandardAttributes {
31 public:
32     static PassRefPtr<SVGFEConvolveMatrixElement> create(const QualifiedName&, Document*);
33
34     void setOrder(float orderX, float orderY);
35     void setKernelUnitLength(float kernelUnitLengthX, float kernelUnitLengthY);
36
37 private:
38     SVGFEConvolveMatrixElement(const QualifiedName&, Document*);
39
40     virtual void parseMappedAttribute(Attribute*);
41     virtual void svgAttributeChanged(const QualifiedName&);
42     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
43     static const AtomicString& orderXIdentifier();
44     static const AtomicString& orderYIdentifier();
45
46     static const AtomicString& kernelUnitLengthXIdentifier();
47     static const AtomicString& kernelUnitLengthYIdentifier();
48
49     // Animated property declarations
50     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::inAttr, String, In1, in1)
51     DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEConvolveMatrixElement, SVGNames::orderAttr, orderXIdentifier(), long, OrderX, orderX)
52     DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEConvolveMatrixElement, SVGNames::orderAttr, orderYIdentifier(), long, OrderY, orderY)
53     DECLARE_ANIMATED_NUMBER_LIST(KernelMatrix, kernelMatrix)
54     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::divisorAttr, float, Divisor, divisor)
55     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::biasAttr, float, Bias, bias)
56     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::targetXAttr, long, TargetX, targetX)
57     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::targetYAttr, long, TargetY, targetY)
58     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::operatorAttr, int, EdgeMode, edgeMode)
59     DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
60     DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
61     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, bool, PreserveAlpha, preserveAlpha)
62 };
63
64 } // namespace WebCore
65
66 #endif // ENABLE(SVG)
67 #endif