2 * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com>
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 SVGFEDisplacementMapElement_h
21 #define SVGFEDisplacementMapElement_h
23 #include "core/svg/SVGAnimatedEnumeration.h"
24 #include "core/svg/SVGAnimatedNumber.h"
25 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
26 #include "platform/graphics/filters/FEDisplacementMap.h"
27 #include "platform/heap/Handle.h"
31 template<> const SVGEnumerationStringEntries
& getStaticStringEntries
<ChannelSelectorType
>();
33 class SVGFEDisplacementMapElement final
: public SVGFilterPrimitiveStandardAttributes
{
34 DEFINE_WRAPPERTYPEINFO();
36 DECLARE_NODE_FACTORY(SVGFEDisplacementMapElement
);
38 static ChannelSelectorType
stringToChannel(const String
&);
40 SVGAnimatedNumber
* scale() { return m_scale
.get(); }
41 SVGAnimatedString
* in1() { return m_in1
.get(); }
42 SVGAnimatedString
* in2() { return m_in2
.get(); }
43 SVGAnimatedEnumeration
<ChannelSelectorType
>* xChannelSelector() { return m_xChannelSelector
.get(); }
44 SVGAnimatedEnumeration
<ChannelSelectorType
>* yChannelSelector() { return m_yChannelSelector
.get(); }
46 DECLARE_VIRTUAL_TRACE();
49 explicit SVGFEDisplacementMapElement(Document
&);
51 bool setFilterEffectAttribute(FilterEffect
*, const QualifiedName
& attrName
) override
;
52 void svgAttributeChanged(const QualifiedName
&) override
;
53 PassRefPtrWillBeRawPtr
<FilterEffect
> build(SVGFilterBuilder
*, Filter
*) override
;
55 RefPtrWillBeMember
<SVGAnimatedNumber
> m_scale
;
56 RefPtrWillBeMember
<SVGAnimatedString
> m_in1
;
57 RefPtrWillBeMember
<SVGAnimatedString
> m_in2
;
58 RefPtrWillBeMember
<SVGAnimatedEnumeration
<ChannelSelectorType
>> m_xChannelSelector
;
59 RefPtrWillBeMember
<SVGAnimatedEnumeration
<ChannelSelectorType
>> m_yChannelSelector
;
64 #endif // SVGFEDisplacementMapElement_h