TextureBitmapStore


@ExperimentalInkCustomBrushApi
public 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 methods

abstract Bitmap
get(@NonNull String clientTextureId)

Retrieve a Bitmap for the given texture id.

Public methods

get

Added in 1.0.0-alpha04
abstract Bitmap get(@NonNull String clientTextureId)

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.