2 Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org>
4 2005 Eric Seidel <eric@webkit.org>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 aint with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
24 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
25 #include "SVGFETurbulence.h"
26 #include "TextStream.h"
30 SVGFETurbulence::SVGFETurbulence(SVGResourceFilter
* filter
)
31 : SVGFilterEffect(filter
)
32 , m_baseFrequencyX(0.0f
)
33 , m_baseFrequencyY(0.0f
)
36 , m_stitchTiles(false)
37 , m_type(SVG_TURBULENCE_TYPE_UNKNOWN
)
41 SVGTurbulanceType
SVGFETurbulence::type() const
46 void SVGFETurbulence::setType(SVGTurbulanceType type
)
51 float SVGFETurbulence::baseFrequencyY() const
53 return m_baseFrequencyY
;
56 void SVGFETurbulence::setBaseFrequencyY(float baseFrequencyY
)
58 m_baseFrequencyY
= baseFrequencyY
;
61 float SVGFETurbulence::baseFrequencyX() const
63 return m_baseFrequencyX
;
66 void SVGFETurbulence::setBaseFrequencyX(float baseFrequencyX
)
68 m_baseFrequencyX
= baseFrequencyX
;
71 float SVGFETurbulence::seed() const
76 void SVGFETurbulence::setSeed(float seed
)
81 int SVGFETurbulence::numOctaves() const
86 void SVGFETurbulence::setNumOctaves(bool numOctaves
)
88 m_numOctaves
= numOctaves
;
91 bool SVGFETurbulence::stitchTiles() const
96 void SVGFETurbulence::setStitchTiles(bool stitch
)
98 m_stitchTiles
= stitch
;
101 static TextStream
& operator<<(TextStream
& ts
, SVGTurbulanceType t
)
105 case SVG_TURBULENCE_TYPE_UNKNOWN
:
106 ts
<< "UNKNOWN"; break;
107 case SVG_TURBULENCE_TYPE_TURBULENCE
:
108 ts
<< "TURBULANCE"; break;
109 case SVG_TURBULENCE_TYPE_FRACTALNOISE
:
110 ts
<< "NOISE"; break;
115 TextStream
& SVGFETurbulence::externalRepresentation(TextStream
& ts
) const
117 ts
<< "[type=TURBULENCE] ";
118 SVGFilterEffect::externalRepresentation(ts
);
119 ts
<< " [turbulence type=" << type() << "]"
120 << " [base frequency x=" << baseFrequencyX() << " y=" << baseFrequencyY() << "]"
121 << " [seed=" << seed() << "]"
122 << " [num octaves=" << numOctaves() << "]"
123 << " [stitch tiles=" << stitchTiles() << "]";
128 } // namespace WebCore
130 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)