GifDecoder

fun GifDecoder(path: Path, cacheFrameInterval: Int = DEFAULT_GIF_CACHE_FRAME_INTERVAL): GifDecoder(source)

Constructs a GifDecoder, reading GIF data from a file.

Parameters

path

The path of the file containing the GIF data.

cacheFrameInterval

The interval at which frames are cached. Setting this to a higher value can improve random access speed with get, but increases memory usage.

Set to 1 to cache every frame, making random access speed similar to that of Array. Warning: this can cause the decoder to use a large amount of memory.

Set to 0 to disable caching, which will decrease the initial load time and minimize memory usage. Disable caching if you only need to read frames sequentially using asSequence or get in increasing order of their index or timestamp.

Throws

If the GIF data is invalid and cannot be decoded.

If an I/O error occurs.

fun GifDecoder(buffer: ArrayBuffer, cacheFrameInterval: Int = DEFAULT_GIF_CACHE_FRAME_INTERVAL): GifDecoder(source)

Constructs a GifDecoder, reading GIF data from a ArrayBuffer.

Parameters

buffer

The ArrayBuffer containing the GIF data.

cacheFrameInterval

The interval at which frames are cached. Setting this to a higher value can improve random access speed with get, but increases memory usage.

Set to 1 to cache every frame, making random access speed similar to that of Array. Warning: this can cause the decoder to use a large amount of memory.

Set to 0 to disable caching, which will decrease the initial load time and minimize memory usage. Disable caching if you only need to read frames sequentially using asSequence or get in increasing order of their index or timestamp.

Throws

If the GIF data is invalid and cannot be decoded.

If an I/O error occurs.


fun GifDecoder(bytes: Int8Array, cacheFrameInterval: Int = DEFAULT_GIF_CACHE_FRAME_INTERVAL): GifDecoder(source)

Constructs a GifDecoder, reading GIF data from an Int8Array.

Parameters

bytes

The Int8Array containing the GIF data.

cacheFrameInterval

The interval at which frames are cached. Setting this to a higher value can improve random access speed with get, but increases memory usage.

Set to 1 to cache every frame, making random access speed similar to that of Array. Warning: this can cause the decoder to use a large amount of memory.

Set to 0 to disable caching, which will decrease the initial load time and minimize memory usage. Disable caching if you only need to read frames sequentially using asSequence or get in increasing order of their index or timestamp.

Throws

If the GIF data is invalid and cannot be decoded.

If an I/O error occurs.