FESpecularLighting.cpp [plain text]
#include "config.h"
#include "FESpecularLighting.h"
#include "LightSource.h"
#include <wtf/text/TextStream.h>
namespace WebCore {
FESpecularLighting::FESpecularLighting(Filter& filter, const Color& lightingColor, float surfaceScale, float specularConstant, float specularExponent, float kernelUnitLengthX, float kernelUnitLengthY, Ref<LightSource>&& lightSource)
: FELighting(filter, SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource))
{
}
Ref<FESpecularLighting> FESpecularLighting::create(Filter& filter, const Color& lightingColor, float surfaceScale, float specularConstant, float specularExponent, float kernelUnitLengthX, float kernelUnitLengthY, Ref<LightSource>&& lightSource)
{
return adoptRef(*new FESpecularLighting(filter, lightingColor, surfaceScale, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource)));
}
FESpecularLighting::~FESpecularLighting() = default;
bool FESpecularLighting::setSpecularConstant(float specularConstant)
{
if (m_specularConstant == specularConstant)
return false;
m_specularConstant = specularConstant;
return true;
}
bool FESpecularLighting::setSpecularExponent(float specularExponent)
{
if (m_specularExponent == specularExponent)
return false;
m_specularExponent = specularExponent;
return true;
}
TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, RepresentationType representation) const
{
ts << indent << "[feSpecularLighting";
FilterEffect::externalRepresentation(ts, representation);
ts << " surfaceScale=\"" << m_surfaceScale << "\" "
<< "specualConstant=\"" << m_specularConstant << "\" "
<< "specularExponent=\"" << m_specularExponent << "\"]\n";
TextStream::IndentScope indentScope(ts);
inputEffect(0)->externalRepresentation(ts, representation);
return ts;
}
}