KiteAnimation

class KiteAnimation(val width: Int, val height: Int, val frames: List<KiteFrame>, val loopCount: Int)

A decoded animation: GIF, APNG and animated WebP all arrive in this shape. Static images decode as a single frame, so KiteImage.decodeAnimation is total over every supported format.

loopCount means the same thing in all three formats: 0 = loop forever, n > 0 = play the sequence n times. A file that carries no loop count at all gets 1 (play once), which is what its absence has always meant in practice.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, frames: List<KiteFrame>, loopCount: Int)

Properties

Link copied to clipboard

Sum of frame delays for one loop, in milliseconds.

Link copied to clipboard
Link copied to clipboard
val height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
fun KiteAnimation.cropped(x: Int, y: Int, width: Int, height: Int): KiteAnimation

cropped applied to every frame, preserving delays and loop count.

Link copied to clipboard

oriented applied to every frame, preserving delays and loop count.

Link copied to clipboard

rotated180 applied to every frame.

Link copied to clipboard

rotated270 applied to every frame.

Link copied to clipboard

rotated90 applied to every frame.

Link copied to clipboard
fun KiteAnimation.scaled(maxWidth: Int, maxHeight: Int): KiteAnimation

Downscale every frame of an animation to fit inside maxWidth×maxHeight (same box filter and aspect handling as KiteBitmap.scaled), preserving delays and the loop count. This is where animated memory goes: a full-screen GIF shown as an avatar keeps W×H×4 bytes per frame unless scaled down.