8 #ifndef Skottie_DEFINED
9 #define Skottie_DEFINED
19 #include "modules/skresources/include/SkResources.h"
28 namespace skjson {
class ObjectValue; }
39 namespace internal {
class Animator; }
54 virtual void log(
Level,
const char message[],
const char* json =
nullptr);
71 const char expression[]) = 0;
74 const char expression[]) = 0;
77 const char expression[]) = 0;
86 virtual void onMarker(
const char name[],
float t0,
float t1) = 0;
94 kDeferImageLoading = 0x01,
97 kPreferEmbeddedFonts = 0x02,
105 float fTotalLoadTimeMS = 0,
106 fJsonParseTimeMS = 0,
107 fSceneParseTimeMS = 0;
108 size_t fJsonSize = 0,
172 const uint32_t fFlags;
200 kSkipTopLevelIsolation = 0x01,
204 kDisableTopLevelClipping = 0x02,
231 this->seekFrameTime(t * this->duration(), ic);
259 double fps()
const {
return fFPS; }
275 enum Flags : uint32_t {
276 kRequiresTopLevelIsolation = 1 << 0,
282 double inPoint,
double outPoint,
double duration,
double fps, uint32_t flags);
285 const std::vector<sk_sp<internal::Animator>> fAnimators;
288 const double fInPoint,
292 const uint32_t fFlags;
float SkScalar
Definition: SkScalar.h:14
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
Definition: SkRefCnt.h:160
Definition: SkRefCnt.h:119
SkStream – abstraction for a source of bytes.
Definition: SkStream.h:29
Light weight class for managing strings.
Definition: SkString.h:118
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:220
sk_sp< Animation > make(SkStream *)
Animation factories.
const Stats & getStats() const
Returns various animation build stats.
Definition: Skottie.h:117
Builder(uint32_t flags=0)
sk_sp< Animation > make(const char *data, size_t length)
Builder & setMarkerObserver(sk_sp< MarkerObserver >)
Register a MarkerObserver with this builder.
Flags
Definition: Skottie.h:93
Builder & setFontManager(sk_sp< SkFontMgr >)
Specify a font manager for loading animation fonts.
Builder & setPrecompInterceptor(sk_sp< PrecompInterceptor >)
Register a precomp layer interceptor.
Builder & setResourceProvider(sk_sp< ResourceProvider >)
Specify a loader for external resources (images, etc.).
Builder & setLogger(sk_sp< Logger >)
Register a Logger with this builder.
sk_sp< Animation > makeFromFile(const char path[])
Builder & setExpressionManager(sk_sp< ExpressionManager >)
Registers an ExpressionManager to evaluate AE expressions.
Builder & setPropertyObserver(sk_sp< PropertyObserver >)
Specify a PropertyObserver to receive callbacks during parsing.
const sk_sp< SlotManager > & getSlotManager() const
Get handle for SlotManager after animation is built.
Definition: Skottie.h:169
const SkSize & size() const
Definition: Skottie.h:272
RenderFlag
Definition: Skottie.h:196
void seekFrame(double t, sksg::InvalidationController *ic=nullptr)
Update the animation state to match |t|, specified as a frame index i.e.
const SkString & version() const
Definition: Skottie.h:271
double inPoint() const
Animation in point, in frame index units.
Definition: Skottie.h:264
double fps() const
Returns the animation frame rate (frames / second).
Definition: Skottie.h:259
static sk_sp< Animation > MakeFromFile(const char path[])
static sk_sp< Animation > Make(const char *data, size_t length)
Animation factories.
void render(SkCanvas *canvas, const SkRect *dst, RenderFlags) const
void seekFrameTime(double t, sksg::InvalidationController *=nullptr)
Update the animation state to match t, specifed in frame time i.e.
double outPoint() const
Animation out point, in frame index units.
Definition: Skottie.h:269
double duration() const
Returns the animation duration in seconds.
Definition: Skottie.h:254
void render(SkCanvas *canvas, const SkRect *dst=nullptr) const
Draws the current animation frame.
void seek(SkScalar t, sksg::InvalidationController *ic=nullptr)
[Deprecated: use one of the other versions.
Definition: Skottie.h:230
uint32_t RenderFlags
Definition: Skottie.h:206
static sk_sp< Animation > Make(SkStream *)
virtual T evaluate(float t)=0
Creates ExpressionEvaluators to evaluate AE expressions and return the results.
Definition: Skottie.h:68
virtual sk_sp< ExpressionEvaluator< float > > createNumberExpressionEvaluator(const char expression[])=0
virtual sk_sp< ExpressionEvaluator< std::vector< float > > > createArrayExpressionEvaluator(const char expression[])=0
virtual sk_sp< ExpressionEvaluator< SkString > > createStringExpressionEvaluator(const char expression[])=0
A Logger subclass can be used to receive Animation::Builder parsing errors and warnings.
Definition: Skottie.h:47
virtual void log(Level, const char message[], const char *json=nullptr)
Level
Definition: Skottie.h:49
Interface for receiving AE composition markers at Animation build time.
Definition: Skottie.h:83
virtual void onMarker(const char name[], float t0, float t1)=0
Receiver for invalidation events.
Definition: SkSGInvalidationController.h:25
Base class for nodes which can render to a canvas.
Definition: SkSGRenderNode.h:27
Definition: ExternalLayer.h:16
skresources::ResourceProvider ResourceProvider
Definition: Skottie.h:42
skresources::ImageAsset ImageAsset
Definition: Skottie.h:41
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582
Definition: Skottie.h:104