24#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
26#include "TextStream.h"
30SVGFESpecularLighting::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)
42SVGFESpecularLighting::~SVGFESpecularLighting()
47Color SVGFESpecularLighting::lightingColor()
const
49 return m_lightingColor;
52void SVGFESpecularLighting::setLightingColor(
const Color& lightingColor)
54 m_lightingColor = lightingColor;
57float SVGFESpecularLighting::surfaceScale()
const
59 return m_surfaceScale;
62void SVGFESpecularLighting::setSurfaceScale(
float surfaceScale)
64 m_surfaceScale = surfaceScale;
67float SVGFESpecularLighting::specularConstant()
const
69 return m_specularConstant;
72void SVGFESpecularLighting::setSpecularConstant(
float specularConstant)
74 m_specularConstant = specularConstant;
77float SVGFESpecularLighting::specularExponent()
const
79 return m_specularExponent;
82void SVGFESpecularLighting::setSpecularExponent(
float specularExponent)
84 m_specularExponent = specularExponent;
87float SVGFESpecularLighting::kernelUnitLengthX()
const
89 return m_kernelUnitLengthX;
92void SVGFESpecularLighting::setKernelUnitLengthX(
float kernelUnitLengthX)
94 m_kernelUnitLengthX = kernelUnitLengthX;
97float SVGFESpecularLighting::kernelUnitLengthY()
const
99 return m_kernelUnitLengthY;
102void SVGFESpecularLighting::setKernelUnitLengthY(
float kernelUnitLengthY)
104 m_kernelUnitLengthY = kernelUnitLengthY;
107const SVGLightSource* SVGFESpecularLighting::lightSource()
const
109 return m_lightSource;
112void SVGFESpecularLighting::setLightSource(SVGLightSource* lightSource)
114 if (m_lightSource != lightSource) {
115 delete m_lightSource;
116 m_lightSource = lightSource;
120TextStream& 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 <<
"]";