# 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)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOS
- android

  ```
  fun interface BrushFamilyDecodeCallback
  ```

*** ** * ** ***

A callback to use with `https://developer.android.com/reference/kotlin/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 functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/BrushFamilyDecodeCallback#onDecodeTexture(kotlin.String,android.graphics.Bitmap)(clientTextureId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, bitmap: https://developer.android.com/reference/android/graphics/Bitmap.html?)` Called for each texture used by a BrushFamily when that BrushFamily is decoded. | android |

## Public functions

### onDecodeTexture

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

```
fun onDecodeTexture(clientTextureId: String, bitmap: Bitmap?): String
```

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

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