# LazyTextureCache<TKey> class

Namespace: [Grasshopper2.Imaging](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.imaging.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public abstract class LazyTextureCache<TKey>
```

Abstract base class for multi-resolution lazy texture evaluations and caching. This cache is designed to generate a family of related textures that can be indexed by key, such as slices through colour spaces, or animation frames.

**Type parameters:**

- `TKey`: Lookup key to use to identify specific textures. For colour spaces this is usually some sort of transformation or slice parameter, for animations it is usually the timestamp or frame index.

**Derived types:** [CmyCubeCache](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.models.cmycubecache.md), [HspSphereCache](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.models.hspspherecache.md), [HsvCubeCache](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.models.hsvcubecache.md), [LabCubeCache](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.models.labcubecache.md), [LimitDiscCache](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.models.limitdisccache.md), [RgbCubeCache](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.models.rgbcubecache.md), [YxyDiagramCache](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.models.yxydiagramcache.md)

## Constructors

- [LazyTextureCache<TKey>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/ctor.md): (2 overloads) Create a new instance of the lazy texture cache.

## Fields

- [DefaultCacheLimit](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/defaultcachelimit.md): (static) The global default cache limit.

## Properties

- [AutoCancelRendering](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/autocancelrendering.md): Gets or sets whether high quality texture rendering will be cancelled automatically if a new texture is requested.
- [CacheLimit](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/cachelimit.md): Gets or sets the cache size limit. If the number of cached textures exceeds this limit the cache will be emptied entirely. Note that changes to the cache limit won't be taken into consideration until the next texture is scheduled for caching.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/count.md): Gets the total number of cached textures. This includes textures of all quality levels.
- [Filter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/filter.md): Gets or sets the rounding table to use when making textures.
- [Padding](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/padding.md): Gets the padding (in pixels) for all textures.
- [PrettySize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/prettysize.md): Gets the resolution for high quality, fine textures.
- [QuickSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/quicksize.md): Gets the resolution for low quality, coarse textures.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/item.md): Gets the texture associated with the given key. If the requested texture hasn't been created yet, it will be rendered in low resolution in the caller thread and a high resolution rendering will commence in a background thread.

## Methods

- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/clear.md): Clear all cached textures.
- [CreateTexture](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/createtexture.md): Implement this method to generate custom textures.
- [ProcessKey](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.lazytexturecache-1/processkey.md): Override this method if you wish to perform some operation to key values such as rounding or limiting. The base implementation returns the input key. A common operation would be rounding or clipping.
