Documentation ¶
Index ¶
- Variables
- type Animation
- func (a Animation) Destroy()
- func (a Animation) GetDuration() float64
- func (a Animation) GetFrameAtPos(pos float64) uint
- func (a Animation) GetFrameRate() float64
- func (a Animation) GetMarkerList() (r []LOTMarker)
- func (a Animation) GetSize() (d Dimension)
- func (a Animation) GetTotalFrame() uint
- func (a Animation) PropertyOverride(ptype int, keypath string, props ...float64)
- func (a Animation) Render(buf []uint32, frameNum, width, height, bytesPerLine uint) (rcast []uint8)
- func (a Animation) RenderAsync(buf []uint32, frameNum, width, height, bytesPerLine uint) (rcast []uint8)
- func (a Animation) RenderFlush() *C.uint
- func (a Animation) RenderTree(frameNum, width, height uint) (r *LOTLayerNode)
- type Color
- type Dimension
- type Gradient
- type ImageInfo
- type LOTLayerNode
- func (lln *LOTLayerNode) Alpha() uint8
- func (lln *LOTLayerNode) ClipPath() (r Path)
- func (lln *LOTLayerNode) KeyPath() string
- func (lln *LOTLayerNode) LayerList() (r []LOTLayerNode)
- func (lln *LOTLayerNode) Mask() (r []LOTMask)
- func (lln *LOTLayerNode) Matte() int
- func (lln *LOTLayerNode) NodeList() (r []LOTNode)
- func (lln *LOTLayerNode) Visible() int
- type LOTMarker
- type LOTMask
- type LOTNode
- func (ln *LOTNode) BrushType() int
- func (ln *LOTNode) Color() *Color
- func (ln *LOTNode) FillRule() int
- func (ln *LOTNode) Flag() int
- func (ln *LOTNode) Gradient() (r *Gradient)
- func (ln *LOTNode) ImageInfo() (r *ImageInfo)
- func (ln *LOTNode) KeyPath() string
- func (ln *LOTNode) Path() (r Path)
- func (ln *LOTNode) Stroke() (r *Stroke)
- type Lottie_Animation_Property
- type Lottie_Animation_S
- type Matrix
- type Path
- type Point
- type Stroke
Constants ¶
This section is empty.
Variables ¶
var (
ErrLottieLoadFailed = errors.New("lottie load failed")
)
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
func AnimationFromData ¶
AnimationFromData constructs an animation object from JSON string data. data, the JSON string data. key, the string that will be used to cache the JSON string data. resourcePath, the path that will be used to load external resource needed by the JSON data.
returns Animation object that can build the contents of the Lottie resource represented by JSON string data.
func AnimationFromFile ¶
AnimationFromFile constructs an animation object from file path. path, Lottie resource file path
returns Animation object that can build the contents of the Lottie resource represented by file path.
func (Animation) GetDuration ¶
GetDuration returns total animation duration of Lottie resource in second. it uses totalFrame() and frameRate() to calculate the duration. duration = totalFrame() / frameRate()
func (Animation) GetFrameAtPos ¶
GetFrameAtPos maps position to frame number and returns it. pos, position in the range [ 0.0 .. 1.0 ]
func (Animation) GetFrameRate ¶
GetFrameRate returns default framerate of the Lottie resource.
func (Animation) GetMarkerList ¶
GetMarkerList returns list of markers in the Lottie resource LOTMarkerList has a `LOTMarker` list and size of list LOTMarker has the marker's name, start frame, and end frame.
func (Animation) GetTotalFrame ¶
GetTotalFrame returns total number of frames present in the Lottie resource.
func (Animation) PropertyOverride ¶
PropertyOverride request to change properties of this animation object. type, property type. (Lottie_Animation_Property) keypath, specific content of target. props, ... property values.
func (Animation) Render ¶
Render the content of the frame `frameNum` to `buf` frameNum, the frame number needs to be rendered. width, width of the surface height, height of the surface bytesPerLine, stride of the surface in bytes.
func (Animation) RenderAsync ¶
func (a Animation) RenderAsync(buf []uint32, frameNum, width, height, bytesPerLine uint) (rcast []uint8)
RenderAsync render the content of the frame `frameNum` to `buf` asynchronously. frameNum, frame number needs to be rendered. width, width of the surface height, height of the surface bytesPerLine, stride of the surface in bytes.
func (Animation) RenderFlush ¶
RenderFlush request to finish the current async renderer job for this animation object. If render is finished the this call returns immediately. If not, it waits till render job finish and then return.
warning: User must call `lottie_animation_render_async()` and `lottie_animation_render_flush()` in pair to get the benefit of async rendering.
returns pixel buffer it finished rendering.
func (Animation) RenderTree ¶
func (a Animation) RenderTree(frameNum, width, height uint) (r *LOTLayerNode)
RenderTree get the render tree which contains the snapshot of the animation object at `frameNum`, the content of the animation in that frame number.
type LOTLayerNode ¶
type LOTLayerNode struct {
// contains filtered or unexported fields
}
func (*LOTLayerNode) Alpha ¶
func (lln *LOTLayerNode) Alpha() uint8
func (*LOTLayerNode) ClipPath ¶
func (lln *LOTLayerNode) ClipPath() (r Path)
func (*LOTLayerNode) KeyPath ¶
func (lln *LOTLayerNode) KeyPath() string
func (*LOTLayerNode) LayerList ¶
func (lln *LOTLayerNode) LayerList() (r []LOTLayerNode)
func (*LOTLayerNode) Matte ¶
func (lln *LOTLayerNode) Matte() int
func (*LOTLayerNode) NodeList ¶
func (lln *LOTLayerNode) NodeList() (r []LOTNode)
func (*LOTLayerNode) Visible ¶
func (lln *LOTLayerNode) Visible() int
type LOTMarker ¶
type LOTMarker struct {
// contains filtered or unexported fields
}
func (*LOTMarker) StartFrame ¶
type Lottie_Animation_Property ¶
type Lottie_Animation_Property = C.Lottie_Animation_Property
type Lottie_Animation_S ¶
type Lottie_Animation_S = C.struct_Lottie_Animation_S