don't discard iframe children.
[kdelibs.git] / khtml / svg / graphics / filters / SVGFESpecularLighting.cpp
blobba45dae0c8c356671586672e74418ed57c356c69
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 "SVGFESpecularLighting.h"
26 #include "TextStream.h"
28 namespace WebCore {
30 SVGFESpecularLighting::SVGFESpecularLighting(SVGResourceFilter* filter)
31 : SVGFilterEffect(filter)
32 , m_lightingColor()
33 , m_surfaceScale(0.0f)
34 , m_specularConstant(0.0f)
35 , m_specularExponent(0.0f)
36 , m_kernelUnitLengthX(0.0f)
37 , m_kernelUnitLengthY(0.0f)
38 , m_lightSource(0)
42 SVGFESpecularLighting::~SVGFESpecularLighting()
44 delete m_lightSource;
47 Color SVGFESpecularLighting::lightingColor() const
49 return m_lightingColor;
52 void SVGFESpecularLighting::setLightingColor(const Color& lightingColor)
54 m_lightingColor = lightingColor;
57 float SVGFESpecularLighting::surfaceScale() const
59 return m_surfaceScale;
62 void SVGFESpecularLighting::setSurfaceScale(float surfaceScale)
64 m_surfaceScale = surfaceScale;
67 float SVGFESpecularLighting::specularConstant() const
69 return m_specularConstant;
72 void SVGFESpecularLighting::setSpecularConstant(float specularConstant)
74 m_specularConstant = specularConstant;
77 float SVGFESpecularLighting::specularExponent() const
79 return m_specularExponent;
82 void SVGFESpecularLighting::setSpecularExponent(float specularExponent)
84 m_specularExponent = specularExponent;
87 float SVGFESpecularLighting::kernelUnitLengthX() const
89 return m_kernelUnitLengthX;
92 void SVGFESpecularLighting::setKernelUnitLengthX(float kernelUnitLengthX)
94 m_kernelUnitLengthX = kernelUnitLengthX;
97 float SVGFESpecularLighting::kernelUnitLengthY() const
99 return m_kernelUnitLengthY;
102 void SVGFESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY)
104 m_kernelUnitLengthY = kernelUnitLengthY;
107 const SVGLightSource* SVGFESpecularLighting::lightSource() const
109 return m_lightSource;
112 void SVGFESpecularLighting::setLightSource(SVGLightSource* lightSource)
114 if (m_lightSource != lightSource) {
115 delete m_lightSource;
116 m_lightSource = lightSource;
120 TextStream& SVGFESpecularLighting::externalRepresentation(TextStream& ts) const
122 ts << "[type=SPECULAR-LIGHTING] ";
123 SVGFilterEffect::externalRepresentation(ts);
124 ts << " [surface scale=" << m_surfaceScale << "]"
125 << " [specual constant=" << m_specularConstant << "]"
126 << " [specular exponent=" << m_specularExponent << "]";
127 return ts;
130 } // namespace WebCore
132 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)