KHTML
SVGFESpotLightElement.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "config.h"
00021
00022 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
00023 #include "SVGFESpotLightElement.h"
00024 #include "SVGSpotLightSource.h"
00025
00026 namespace WebCore {
00027
00028 SVGFESpotLightElement::SVGFESpotLightElement(const QualifiedName& tagName, Document* doc)
00029 : SVGFELightElement(tagName, doc)
00030 {
00031 }
00032
00033 SVGFESpotLightElement::~SVGFESpotLightElement()
00034 {
00035 }
00036
00037 SVGLightSource* SVGFESpotLightElement::lightSource() const
00038 {
00039 FloatPoint3D pos(x(), y(), z());
00040
00041
00042 FloatPoint3D direction(pointsAtX() - pos.x(),
00043 pointsAtY() - pos.y(),
00044 pointsAtZ() - pos.z());
00045
00046 direction.normalize();
00047 return new SVGSpotLightSource(pos, direction, specularExponent(), limitingConeAngle());
00048 }
00049
00050 }
00051
00052 #endif // ENABLE(SVG)
00053
00054