KHTML
SVGFESpecularLighting.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 }
00131
00132 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)