# BrushFamilyDecodeCallback

Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/AndroidBrushFamilyExtensions.android.kt+class:androidx.ink.storage.BrushFamilyDecodeCallback) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
public fun interface BrushFamilyDecodeCallback
```

<br />

*** ** * ** ***

A callback to use with `https://developer.android.com/reference/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.BrushFamilyDecodeCallback)` to manage texture image assets.

## Summary

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/ink/storage/BrushFamilyDecodeCallback#onDecodeTexture(kotlin.String,android.graphics.Bitmap)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html clientTextureId, https://developer.android.com/reference/android/graphics/Bitmap.html bitmap)` Called for each texture used by a BrushFamily when that BrushFamily is decoded. |

## Public methods

### onDecodeTexture

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
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 `https://developer.android.com/reference/androidx/ink/storage/BrushFamilyDecodeCallback#onDecodeTexture(kotlin.String,android.graphics.Bitmap)` (or a client- provided replacement) in the supporting `https://developer.android.com/reference/androidx/ink/brush/TextureBitmapStore`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html clientTextureId` | the ID for this texture in the serialized form of the BrushFamily. |
| `https://developer.android.com/reference/android/graphics/Bitmap.html 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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | The client texture ID for this texture in the in-memory format of the `https://developer.android.com/reference/androidx/ink/brush/BrushFamily`. This can be different from `https://developer.android.com/reference/androidx/ink/storage/BrushFamilyDecodeCallback#onDecodeTexture(kotlin.String,android.graphics.Bitmap)`, in particular when there are naming collisions in the `https://developer.android.com/reference/androidx/ink/brush/TextureBitmapStore` or when the texture store uses its own scheme for ensuring unique names. |