# TextureBitmapStore

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/TextureBitmapStore.android.kt+class:androidx.ink.brush.TextureBitmapStore) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOS
- android

  ```
  fun interface TextureBitmapStore
  ```

*** ** * ** ***

Interface for a callback to allow the caller to provide a particular `https://developer.android.com/reference/android/graphics/Bitmap.html` corresponding to a client-provided texture ID.

## Summary

| ### Public functions |
|---|---|---|
| `operator https://developer.android.com/reference/android/graphics/Bitmap.html?` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureBitmapStore#get(kotlin.String)(clientTextureId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Retrieve a `https://developer.android.com/reference/android/graphics/Bitmap.html` for the given texture id. | android |

## Public functions

### get

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

```
operator fun get(clientTextureId: String): Bitmap?
```

Retrieve a `https://developer.android.com/reference/android/graphics/Bitmap.html` for the given texture id. This may be called synchronously during `onDraw`, so loading of texture files from disk and decoding them into `https://developer.android.com/reference/android/graphics/Bitmap.html` objects should be done on init. The result may be cached by consumers, so this should return a deterministic result for a given input.

Textures can be disabled by having load 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 |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html?` | The texture bitmap, if any, associated with the given id. |