KHTML
SVGFESpecularLighting.cpp
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 00003 2004, 2005 Rob Buis <buis@kde.org> 00004 2005 Eric Seidel <eric@webkit.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 aint with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #include "config.h" 00023 00024 #if ENABLE(SVG) && ENABLE(SVG_FILTERS) 00025 #include "SVGFESpecularLighting.h" 00026 #include "TextStream.h" 00027 00028 namespace WebCore { 00029 00030 SVGFESpecularLighting::SVGFESpecularLighting(SVGResourceFilter* filter) 00031 : SVGFilterEffect(filter) 00032 , m_lightingColor() 00033 , m_surfaceScale(0.0f) 00034 , m_specularConstant(0.0f) 00035 , m_specularExponent(0.0f) 00036 , m_kernelUnitLengthX(0.0f) 00037 , m_kernelUnitLengthY(0.0f) 00038 , m_lightSource(0) 00039 { 00040 } 00041 00042 SVGFESpecularLighting::~SVGFESpecularLighting() 00043 { 00044 delete m_lightSource; 00045 } 00046 00047 Color SVGFESpecularLighting::lightingColor() const 00048 { 00049 return m_lightingColor; 00050 } 00051 00052 void SVGFESpecularLighting::setLightingColor(const Color& lightingColor) 00053 { 00054 m_lightingColor = lightingColor; 00055 } 00056 00057 float SVGFESpecularLighting::surfaceScale() const 00058 { 00059 return m_surfaceScale; 00060 } 00061 00062 void SVGFESpecularLighting::setSurfaceScale(float surfaceScale) 00063 { 00064 m_surfaceScale = surfaceScale; 00065 } 00066 00067 float SVGFESpecularLighting::specularConstant() const 00068 { 00069 return m_specularConstant; 00070 } 00071 00072 void SVGFESpecularLighting::setSpecularConstant(float specularConstant) 00073 { 00074 m_specularConstant = specularConstant; 00075 } 00076 00077 float SVGFESpecularLighting::specularExponent() const 00078 { 00079 return m_specularExponent; 00080 } 00081 00082 void SVGFESpecularLighting::setSpecularExponent(float specularExponent) 00083 { 00084 m_specularExponent = specularExponent; 00085 } 00086 00087 float SVGFESpecularLighting::kernelUnitLengthX() const 00088 { 00089 return m_kernelUnitLengthX; 00090 } 00091 00092 void SVGFESpecularLighting::setKernelUnitLengthX(float kernelUnitLengthX) 00093 { 00094 m_kernelUnitLengthX = kernelUnitLengthX; 00095 } 00096 00097 float SVGFESpecularLighting::kernelUnitLengthY() const 00098 { 00099 return m_kernelUnitLengthY; 00100 } 00101 00102 void SVGFESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY) 00103 { 00104 m_kernelUnitLengthY = kernelUnitLengthY; 00105 } 00106 00107 const SVGLightSource* SVGFESpecularLighting::lightSource() const 00108 { 00109 return m_lightSource; 00110 } 00111 00112 void SVGFESpecularLighting::setLightSource(SVGLightSource* lightSource) 00113 { 00114 if (m_lightSource != lightSource) { 00115 delete m_lightSource; 00116 m_lightSource = lightSource; 00117 } 00118 } 00119 00120 TextStream& SVGFESpecularLighting::externalRepresentation(TextStream& ts) const 00121 { 00122 ts << "[type=SPECULAR-LIGHTING] "; 00123 SVGFilterEffect::externalRepresentation(ts); 00124 ts << " [surface scale=" << m_surfaceScale << "]" 00125 << " [specual constant=" << m_specularConstant << "]" 00126 << " [specular exponent=" << m_specularExponent << "]"; 00127 return ts; 00128 } 00129 00130 } // namespace WebCore 00131 00132 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
KDE 4.6 API Reference