# OnDecodeTextureUiImage

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/IosBrushFamilyExtensions.ios.kt+class:androidx.ink.storage.OnDecodeTextureUiImage) Common/AllAndroid/JVMNative/C/iOS
- N

  ```
  fun interface OnDecodeTextureUiImage
  ```

*** ** * ** ***

A callback to use with `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTextureUiImage)` 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/OnDecodeTextureUiImage#onDecodeTexture(kotlin.String,platform.UIKit.UIImage)(clientTextureId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, uiImage: platform.UIKit.UIImage?)` Called for each texture used by a BrushFamily when that BrushFamily is decoded. | N |

## Public functions

### onDecodeTexture

N

```
fun onDecodeTexture(clientTextureId: String, uiImage: platform.UIKit.UIImage?): 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/OnDecodeTextureUiImage#onDecodeTexture(kotlin.String,platform.UIKit.UIImage)` (or a client- provided replacement) in the supporting `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore`.

| 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. |
| `uiImage: platform.UIKit.UIImage?` | the image corresponding to `https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTextureUiImage#onDecodeTexture(kotlin.String,platform.UIKit.UIImage)` in the serialized form of the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`. `null` indicates that the serialized form did not store a bitmap for `https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTextureUiImage#onDecodeTexture(kotlin.String,platform.UIKit.UIImage)`. Note that the passed to this callback by the functions in this module will wrap a `CGImage`, so the underlying bitmap will be pre-loaded. |

| 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/OnDecodeTextureUiImage#onDecodeTexture(kotlin.String,platform.UIKit.UIImage)`, in particular when there are naming collisions in the `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore` or when the texture store uses its own scheme for ensuring unique names. |