BrushFamilyDecodeCallback


@ExperimentalInkCustomBrushApi
public fun interface BrushFamilyDecodeCallback


A callback to use with decode to manage texture image assets.

Summary

Public methods

abstract @NonNull String
onDecodeTexture(@NonNull String clientTextureId, Bitmap bitmap)

Called for each texture used by a BrushFamily when that BrushFamily is decoded.

Public methods

onDecodeTexture

Added in 1.0.0-alpha05
abstract @NonNull String onDecodeTexture(@NonNull String clientTextureId, Bitmap bitmap)

Called for each texture used by a BrushFamily when that BrushFamily is decoded. In the implementation of this method, the returned String should be mapped to bitmap (or a client- provided replacement) in the supporting TextureBitmapStore.

Parameters
@NonNull String clientTextureId

the ID for this texture in the serialized form of the BrushFamily.

Bitmap bitmap

the bitmap corresponding to clientTextureId in the serialized form of the BrushFamily. Null indicates that the serialized form did not store a bitmap for clientTextureId.

Returns
@NonNull String

The client texture ID for this texture in the in-memory format of the BrushFamily. This will typically match clientTextureId, but can be different, for example when there are naming collisions in the TextureBitmapStore and one texture needs to be renamed.