TextureBitmapStore


@ExperimentalInkCustomBrushApi
fun interface TextureBitmapStore


Interface for a callback to allow the caller to provide a particular Bitmap corresponding to a client-provided texture ID.

Summary

Public functions

operator Bitmap?
get(clientTextureId: String)

Retrieve a Bitmap for the given texture id.

Public functions

get

Added in 1.0.0-alpha04
operator fun get(clientTextureId: String): Bitmap?

Retrieve a Bitmap for the given texture id. This may be called synchronously during onDraw, so loading of texture files from disk and decoding them into Bitmap objects should be done on init. The result may be cached by consumers, so this should return a deterministic result for a given input.

Textures can be disabled by having load always return null. null should also be returned when a texture can not be loaded. If null is returned, the texture layer in question should be ignored, allowing for graceful fallback. It's recommended that implementations log when a texture can not be loaded.

Returns
Bitmap?

The texture bitmap, if any, associated with the given id.