FilmstripFrames

The frames of a timeline strip, held for a window around what is on screen.

Built by rememberFilmstripFrames. Draw the strip with a LazyRow of count items, read each item's frame from get, and call onVisibleRange as the row scrolls. Frames are fetched for the visible items plus an overscan either side, and everything outside that window is closed.

A frame read from get is only valid while its index is inside the window that was last reported. Some platforms hand out the decoded frame itself rather than a copy, so an item drawn from a bitmap it kept after scrolling away draws from pixels that have been released.

Properties

Link copied to clipboard
val count: Int

How many positions the strip covers.

Link copied to clipboard

How many bytes of decoded frames are held right now, against the cap the strip was built with.

Functions

Link copied to clipboard
operator fun get(index: Int): ImageBitmap?

The frame at index, or null while it has not arrived.

Link copied to clipboard
fun onVisibleRange(first: Int, last: Int)

Says which items the strip is showing, as item indices.