# TextureImageStore

Artifact: [androidx.ink:ink-brush](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/brush/TextureImageStore.ios.kt+class:androidx.ink.brush.TextureImageStore) Common/AllAndroid/JVMNative/C/iOS
- N

  ```
  fun interface TextureImageStore
  ```

*** ** * ** ***

Interface for a callback to allow the caller to provide a particular corresponding to a client-provided texture ID.

## Summary

| ### Public functions |
|---|---|---|
| `operator platform.UIKit.UIImage?` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore#get(kotlin.String)(clientTextureId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Retrieve a for the given texture ID. | N |

## Public functions

### get

N

```
operator fun get(clientTextureId: String): platform.UIKit.UIImage?
```

Retrieve a for the given texture ID. This may be called synchronously during drawing, so loading of texture files from disk and decoding them into objects should be done on initialization. The result is expected to be cached by consumers, so this should return a deterministic result for a given input.

Since this will be read during the draw, this ideally should return instances wrapping `CGImage`, that is, ones where the underlying bitmap is pre-loaded. Otherwise, the first draw may be slower as texture images are rendered from `CIImage` to `CGImage`.

Textures can be disabled by having this function 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 |
|---|---|
| `platform.UIKit.UIImage?` | The texture image, if any, associated with the given ID. |