2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
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.
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.
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.
20 #ifndef SVGFEConvolveMatrixElement_h
21 #define SVGFEConvolveMatrixElement_h
23 #include "core/svg/SVGAnimatedBoolean.h"
24 #include "core/svg/SVGAnimatedEnumeration.h"
25 #include "core/svg/SVGAnimatedInteger.h"
26 #include "core/svg/SVGAnimatedIntegerOptionalInteger.h"
27 #include "core/svg/SVGAnimatedNumber.h"
28 #include "core/svg/SVGAnimatedNumberList.h"
29 #include "core/svg/SVGAnimatedNumberOptionalNumber.h"
30 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
31 #include "platform/graphics/filters/FEConvolveMatrix.h"
32 #include "platform/heap/Handle.h"
36 template<> const SVGEnumerationStringEntries
& getStaticStringEntries
<EdgeModeType
>();
38 class SVGFEConvolveMatrixElement final
: public SVGFilterPrimitiveStandardAttributes
{
39 DEFINE_WRAPPERTYPEINFO();
41 DECLARE_NODE_FACTORY(SVGFEConvolveMatrixElement
);
43 SVGAnimatedBoolean
* preserveAlpha() { return m_preserveAlpha
.get(); }
44 SVGAnimatedNumber
* divisor() { return m_divisor
.get(); }
45 SVGAnimatedNumber
* bias() { return m_bias
.get(); }
46 SVGAnimatedNumber
* kernelUnitLengthX() { return m_kernelUnitLength
->firstNumber(); }
47 SVGAnimatedNumber
* kernelUnitLengthY() { return m_kernelUnitLength
->secondNumber(); }
48 SVGAnimatedNumberList
* kernelMatrix() { return m_kernelMatrix
.get(); }
49 SVGAnimatedString
* in1() { return m_in1
.get(); }
50 SVGAnimatedEnumeration
<EdgeModeType
>* edgeMode() { return m_edgeMode
.get(); }
51 SVGAnimatedInteger
* orderX() { return m_order
->firstInteger(); }
52 SVGAnimatedInteger
* orderY() { return m_order
->secondInteger(); }
53 SVGAnimatedInteger
* targetX() { return m_targetX
.get(); }
54 SVGAnimatedInteger
* targetY() { return m_targetY
.get(); }
56 DECLARE_VIRTUAL_TRACE();
59 explicit SVGFEConvolveMatrixElement(Document
&);
61 bool setFilterEffectAttribute(FilterEffect
*, const QualifiedName
&) override
;
62 void svgAttributeChanged(const QualifiedName
&) override
;
63 PassRefPtrWillBeRawPtr
<FilterEffect
> build(SVGFilterBuilder
*, Filter
*) override
;
65 RefPtrWillBeMember
<SVGAnimatedNumber
> m_bias
;
66 RefPtrWillBeMember
<SVGAnimatedNumber
> m_divisor
;
67 RefPtrWillBeMember
<SVGAnimatedString
> m_in1
;
68 RefPtrWillBeMember
<SVGAnimatedEnumeration
<EdgeModeType
>> m_edgeMode
;
69 RefPtrWillBeMember
<SVGAnimatedNumberList
> m_kernelMatrix
;
70 RefPtrWillBeMember
<SVGAnimatedNumberOptionalNumber
> m_kernelUnitLength
;
71 RefPtrWillBeMember
<SVGAnimatedIntegerOptionalInteger
> m_order
;
72 RefPtrWillBeMember
<SVGAnimatedBoolean
> m_preserveAlpha
;
73 RefPtrWillBeMember
<SVGAnimatedInteger
> m_targetX
;
74 RefPtrWillBeMember
<SVGAnimatedInteger
> m_targetY
;
79 #endif // SVGFEConvolveMatrixElement_h