19 const float sinAzimuth = sinf(azimuthRad), cosAzimuth = cosf(azimuthRad);
20 const float sinElevation = sinf(elevationRad), cosElevation = cosf(elevationRad);
21 return SkPoint3::Make(cosAzimuth * cosElevation, sinAzimuth * cosElevation, sinElevation);
24bool SkSVGFeDistantLight::parseAndSetAttribute(
const char* n,
const char* v) {
26 this->setAzimuth(SkSVGAttributeParser::parse<SkSVGNumberType>(
"azimuth", n, v)) ||
27 this->setElevation(SkSVGAttributeParser::parse<SkSVGNumberType>(
"elevation", n, v));
30bool SkSVGFePointLight::parseAndSetAttribute(
const char* n,
const char* v) {
32 this->setX(SkSVGAttributeParser::parse<SkSVGNumberType>(
"x", n, v)) ||
33 this->setY(SkSVGAttributeParser::parse<SkSVGNumberType>(
"y", n, v)) ||
34 this->setZ(SkSVGAttributeParser::parse<SkSVGNumberType>(
"z", n, v));
37bool SkSVGFeSpotLight::parseAndSetAttribute(
const char* n,
const char* v) {
39 this->setX(SkSVGAttributeParser::parse<SkSVGNumberType>(
"x", n, v)) ||
40 this->setY(SkSVGAttributeParser::parse<SkSVGNumberType>(
"y", n, v)) ||
41 this->setZ(SkSVGAttributeParser::parse<SkSVGNumberType>(
"z", n, v)) ||
42 this->setPointsAtX(SkSVGAttributeParser::parse<SkSVGNumberType>(
"pointsAtX", n, v)) ||
43 this->setPointsAtY(SkSVGAttributeParser::parse<SkSVGNumberType>(
"pointsAtY", n, v)) ||
44 this->setPointsAtZ(SkSVGAttributeParser::parse<SkSVGNumberType>(
"pointsAtZ", n, v)) ||
45 this->setSpecularExponent(
46 SkSVGAttributeParser::parse<SkSVGNumberType>(
"specularExponent", n, v)) ||
47 this->setLimitingConeAngle(
48 SkSVGAttributeParser::parse<SkSVGNumberType>(
"limitingConeAngle", n, v));
#define SkDegreesToRadians(degrees)
SkPoint3 computeDirection() const
virtual bool parseAndSetAttribute(const char *name, const char *value)
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)