pub struct DivoomAnimationBuilder { /* private fields */ }
Expand description

Animation builder

This class holds a series of tiny_skia::Pixmap inside with the same size to provide an interface for building animations.

Implementations

Create a new animation builder with canvas size and speed.

For Divoom devices, only 16, 32 and 64 pixels canvas are allowed. When other value is specified, we will return failure.

Return canvas size

Return a builder for the specified frame.

If the frame is not created or any previous frame is not created for the specified index, we will create all of them and return the builder for the last frame.

Draw a series of frames to the canvas.

  • Frames doesn’t need to be having the same size, as they will be drawn separately one by one.
  • If we have more frames than what we have internally, the new frames will be automatically created.

Draw a series of frames to the canvas with DivoomDrawFitMode option and other options. With DivoomDrawFitMode option, we provided a few ways to calculate the position and size of each frame to simplify the usage.

Draw a series of frames to the canvas with specified position and size.

Draw a series of frames to the canvas with specified position and scale on X and Y axis.

Create the final animation that is used for being sent to the device, and one animation builder can be reused to create multiple animations.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more