Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
SkSVGFeDistantLight Class Referencefinal

#include <SkSVGFeLightSource.h>

Inheritance diagram for SkSVGFeDistantLight:
SkSVGFeLightSource SkSVGHiddenContainer SkSVGContainer SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase

Public Member Functions

SkPoint3 computeDirection () const
 
- Public Member Functions inherited from SkSVGFeLightSource
void appendChild (sk_sp< SkSVGNode >) final
 
- Public Member Functions inherited from SkSVGTransformableNode
void setTransform (const SkSVGTransformType &t)
 
- Public Member Functions inherited from SkSVGNode
 ~SkSVGNode () override
 
SkSVGTag tag () const
 
void render (const SkSVGRenderContext &) const
 
bool asPaint (const SkSVGRenderContext &, SkPaint *) const
 
SkPath asPath (const SkSVGRenderContext &) const
 
SkRect objectBoundingBox (const SkSVGRenderContext &) const
 
void setAttribute (SkSVGAttribute, const SkSVGValue &)
 
bool setAttribute (const char *attributeName, const char *attributeValue)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< SkSVGFeDistantLightMake ()
 

Private Member Functions

bool parseAndSetAttribute (const char *, const char *) override
 

Additional Inherited Members

- Protected Member Functions inherited from SkSVGFeLightSource
 SkSVGFeLightSource (SkSVGTag tag)
 
- Protected Member Functions inherited from SkSVGHiddenContainer
 SkSVGHiddenContainer (SkSVGTag t)
 
void onRender (const SkSVGRenderContext &) const final
 
- Protected Member Functions inherited from SkSVGContainer
 SkSVGContainer (SkSVGTag)
 
SkPath onAsPath (const SkSVGRenderContext &) const override
 
SkRect onObjectBoundingBox (const SkSVGRenderContext &) const override
 
bool hasChildren () const final
 
- Protected Member Functions inherited from SkSVGTransformableNode
 SkSVGTransformableNode (SkSVGTag)
 
bool onPrepareToRender (SkSVGRenderContext *) const override
 
void onSetAttribute (SkSVGAttribute, const SkSVGValue &) override
 
void mapToParent (SkPath *) const
 
void mapToParent (SkRect *) const
 
- Protected Member Functions inherited from SkSVGNode
 SkSVGNode (SkSVGTag)
 
virtual bool onAsPaint (const SkSVGRenderContext &, SkPaint *) const
 
- Static Protected Member Functions inherited from SkSVGNode
static SkMatrix ComputeViewboxMatrix (const SkRect &, const SkRect &, SkSVGPreserveAspectRatio)
 
- Protected Attributes inherited from SkSVGContainer
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
 

Detailed Description

Definition at line 28 of file SkSVGFeLightSource.h.

Member Function Documentation

◆ computeDirection()

SkPoint3 SkSVGFeDistantLight::computeDirection ( ) const

Definition at line 12 of file SkSVGFeLightSource.cpp.

12 {
13 // Computing direction from azimuth+elevation is two 3D rotations:
14 // - Rotate [1,0,0] about y axis first (elevation)
15 // - Rotate result about z axis (azimuth)
16 // Which is just the first column vector in the 3x3 matrix Rz*Ry.
17 const float azimuthRad = SkDegreesToRadians(fAzimuth);
18 const float elevationRad = SkDegreesToRadians(fElevation);
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);
22}
#define SkDegreesToRadians(degrees)
Definition SkScalar.h:77
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)
Definition SkPoint3.h:18

◆ Make()

static sk_sp< SkSVGFeDistantLight > SkSVGFeDistantLight::Make ( )
inlinestatic

◆ parseAndSetAttribute()

bool SkSVGFeDistantLight::parseAndSetAttribute ( const char *  n,
const char *  v 
)
overrideprivatevirtual

Reimplemented from SkSVGNode.

Definition at line 24 of file SkSVGFeLightSource.cpp.

24 {
26 this->setAzimuth(SkSVGAttributeParser::parse<SkSVGNumberType>("azimuth", n, v)) ||
27 this->setElevation(SkSVGAttributeParser::parse<SkSVGNumberType>("elevation", n, v));
28}
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition SkSVGNode.cpp:90

The documentation for this class was generated from the following files: