SVGLightSource.cpp [plain text]
#include "config.h"
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGPointLightSource.h"
#include "SVGRenderTreeAsText.h"
#include "SVGSpotLightSource.h"
#include "SVGDistantLightSource.h"
namespace WebCore {
static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)
{
ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();
return ts;
}
TextStream& PointLightSource::externalRepresentation(TextStream& ts) const
{
ts << "[type=POINT-LIGHT] ";
ts << "[position=\"" << position() << "\"]";
return ts;
}
TextStream& SpotLightSource::externalRepresentation(TextStream& ts) const
{
ts << "[type=SPOT-LIGHT] ";
ts << "[position=\"" << position() << "\"]";
ts << "[direction=\"" << direction() << "\"]";
ts << "[specularExponent=\"" << specularExponent() << "\"]";
ts << "[limitingConeAngle=\"" << limitingConeAngle() << "\"]";
return ts;
}
TextStream& DistantLightSource::externalRepresentation(TextStream& ts) const
{
ts << "[type=DISTANT-LIGHT] ";
ts << "[azimuth=\"" << azimuth() << "\"]";
ts << "[elevation=\"" << elevation() << "\"]";
return ts;
}
}
#endif // ENABLE(SVG) && ENABLE(FILTERS)