24 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
26 #include "TextStream.h"
30 SVGFESpecularLighting::SVGFESpecularLighting(SVGResourceFilter* filter)
31 : SVGFilterEffect(filter)
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)
42 SVGFESpecularLighting::~SVGFESpecularLighting()
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 <<
"]";
132 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)