Flutter Engine
The Flutter Engine
Classes | Static Public Member Functions | List of all members
skottie::internal::MotionBlurEffect Class Referencefinal

#include <MotionBlurEffect.h>

Inheritance diagram for skottie::internal::MotionBlurEffect:
sksg::CustomRenderNode sksg::RenderNode sksg::Node SkRefCnt SkRefCntBase

Classes

class  AutoInvalBlocker
 

Static Public Member Functions

static sk_sp< MotionBlurEffectMake (sk_sp< Animator > animator, sk_sp< sksg::RenderNode > child, size_t samples_per_frame, float shutter_angle, float shutter_phase)
 

Additional Inherited Members

- Public Member Functions inherited from sksg::RenderNode
void render (SkCanvas *, const RenderContext *=nullptr) const
 
const RenderNodenodeAt (const SkPoint &point) const
 
bool isVisible () const
 
void setVisible (bool)
 
- Public Member Functions inherited from sksg::Node
const SkRectrevalidate (InvalidationController *, const SkMatrix &)
 
void invalidate (bool damage=true)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
- Protected Types inherited from sksg::Node
enum  InvalTraits { kBubbleDamage_Trait = 1 << 0 , kOverrideDamage_Trait = 1 << 1 }
 
- Protected Member Functions inherited from sksg::CustomRenderNode
 CustomRenderNode (std::vector< sk_sp< RenderNode > > &&children)
 
 ~CustomRenderNode () override
 
const std::vector< sk_sp< RenderNode > > & children () const
 
bool hasChildrenInval () const
 
- Protected Member Functions inherited from sksg::RenderNode
 RenderNode (uint32_t inval_traits=0)
 
virtual void onRender (SkCanvas *, const RenderContext *) const =0
 
virtual const RenderNodeonNodeAt (const SkPoint &p) const =0
 
- Protected Member Functions inherited from sksg::Node
 Node (uint32_t invalTraits)
 
 ~Node () override
 
const SkRectbounds () const
 
bool hasInval () const
 
virtual SkRect onRevalidate (InvalidationController *, const SkMatrix &ctm)=0
 
void observeInval (const sk_sp< Node > &)
 
void unobserveInval (const sk_sp< Node > &)
 

Detailed Description

Definition at line 18 of file MotionBlurEffect.h.

Member Function Documentation

◆ Make()

sk_sp< MotionBlurEffect > skottie::internal::MotionBlurEffect::Make ( sk_sp< Animator animator,
sk_sp< sksg::RenderNode child,
size_t  samples_per_frame,
float  shutter_angle,
float  shutter_phase 
)
static

Definition at line 37 of file MotionBlurEffect.cpp.

40 {
41 if (!samples_per_frame || shutter_angle <= 0) {
42 return nullptr;
43 }
44
45 // shutter_angle is [ 0 .. 720], mapped to [ 0 .. 2] (frame space)
46 // shutter_phase is [-360 .. 360], mapped to [-1 .. 1] (frame space)
47 const auto samples_duration = shutter_angle / 360,
48 phase = shutter_phase / 360,
49 dt = samples_duration / (samples_per_frame - 1);
50
51 return sk_sp<MotionBlurEffect>(new MotionBlurEffect(std::move(animator),
52 std::move(child),
53 samples_per_frame,
54 phase, dt));
55}

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