24 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
27 #include "TextStream.h"
31 SVGFEDiffuseLighting::SVGFEDiffuseLighting(SVGResourceFilter* filter)
32 : SVGFilterEffect(filter)
34 , m_surfaceScale(0.0f)
35 , m_diffuseConstant(0.0f)
36 , m_kernelUnitLengthX(0.0f)
37 , m_kernelUnitLengthY(0.0f)
42 SVGFEDiffuseLighting::~SVGFEDiffuseLighting()
47 Color SVGFEDiffuseLighting::lightingColor()
const
49 return m_lightingColor;
52 void SVGFEDiffuseLighting::setLightingColor(
const Color& lightingColor)
54 m_lightingColor = lightingColor;
57 float SVGFEDiffuseLighting::surfaceScale()
const
59 return m_surfaceScale;
62 void SVGFEDiffuseLighting::setSurfaceScale(
float surfaceScale)
64 m_surfaceScale = surfaceScale;
67 float SVGFEDiffuseLighting::diffuseConstant()
const
69 return m_diffuseConstant;
72 void SVGFEDiffuseLighting::setDiffuseConstant(
float diffuseConstant)
74 m_diffuseConstant = diffuseConstant;
77 float SVGFEDiffuseLighting::kernelUnitLengthX()
const
79 return m_kernelUnitLengthX;
82 void SVGFEDiffuseLighting::setKernelUnitLengthX(
float kernelUnitLengthX)
84 m_kernelUnitLengthX = kernelUnitLengthX;
87 float SVGFEDiffuseLighting::kernelUnitLengthY()
const
89 return m_kernelUnitLengthY;
92 void SVGFEDiffuseLighting::setKernelUnitLengthY(
float kernelUnitLengthY)
94 m_kernelUnitLengthY = kernelUnitLengthY;
97 const SVGLightSource* SVGFEDiffuseLighting::lightSource()
const
102 void SVGFEDiffuseLighting::setLightSource(SVGLightSource* lightSource)
104 if (m_lightSource != lightSource) {
105 delete m_lightSource;
106 m_lightSource = lightSource;
110 TextStream& SVGFEDiffuseLighting::externalRepresentation(TextStream& ts)
const
112 ts <<
"[type=DIFFUSE-LIGHTING] ";
113 SVGFilterEffect::externalRepresentation(ts);
114 ts <<
" [surface scale=" << m_surfaceScale <<
"]"
115 <<
" [diffuse constant=" << m_diffuseConstant <<
"]"
116 <<
" [kernel unit length " << m_kernelUnitLengthX <<
", " << m_kernelUnitLengthY <<
"]";
122 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)