don't discard iframe children.
[kdelibs.git] / khtml / svg / graphics / filters / SVGFETurbulence.cpp
blob0f9cbaf99a2a8e19fd8294cd0e3643d52c55da61
1 /*
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.
22 #include "config.h"
24 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
25 #include "SVGFETurbulence.h"
26 #include "TextStream.h"
28 namespace WebCore {
30 SVGFETurbulence::SVGFETurbulence(SVGResourceFilter* filter)
31 : SVGFilterEffect(filter)
32 , m_baseFrequencyX(0.0f)
33 , m_baseFrequencyY(0.0f)
34 , m_numOctaves(0)
35 , m_seed(0)
36 , m_stitchTiles(false)
37 , m_type(SVG_TURBULENCE_TYPE_UNKNOWN)
41 SVGTurbulanceType SVGFETurbulence::type() const
43 return m_type;
46 void SVGFETurbulence::setType(SVGTurbulanceType type)
48 m_type = 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
73 return m_seed;
76 void SVGFETurbulence::setSeed(float seed)
78 m_seed = seed;
81 int SVGFETurbulence::numOctaves() const
83 return m_numOctaves;
86 void SVGFETurbulence::setNumOctaves(bool numOctaves)
88 m_numOctaves = numOctaves;
91 bool SVGFETurbulence::stitchTiles() const
93 return m_stitchTiles;
96 void SVGFETurbulence::setStitchTiles(bool stitch)
98 m_stitchTiles = stitch;
101 static TextStream& operator<<(TextStream& ts, SVGTurbulanceType t)
103 switch (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;
112 return ts;
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() << "]";
124 return ts;
128 } // namespace WebCore
130 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)