Class: ZarrChunkCache
Defined in: nvimage/zarr/ZarrChunkCache.ts:10
Constructors
Constructor
new ZarrChunkCache(maxChunks: number): ZarrChunkCache;
Defined in: nvimage/zarr/ZarrChunkCache.ts:15
Parameters
| Parameter | Type | Default value |
|---|---|---|
maxChunks | number | 500 |
Returns
ZarrChunkCache
Accessors
loadingCount
Get Signature
get loadingCount(): number;
Defined in: nvimage/zarr/ZarrChunkCache.ts:107
Get the number of chunks currently loading
Returns
number
size
Get Signature
get size(): number;
Defined in: nvimage/zarr/ZarrChunkCache.ts:100
Get the number of cached chunks
Returns
number
Methods
clear()
clear(): void;
Defined in: nvimage/zarr/ZarrChunkCache.ts:114
Clear the entire cache
Returns
void
delete()
delete(key: string): boolean;
Defined in: nvimage/zarr/ZarrChunkCache.ts:122
Delete a specific chunk from cache
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
boolean
doneLoading()
doneLoading(key: string): void;
Defined in: nvimage/zarr/ZarrChunkCache.ts:93
Mark a chunk as done loading
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
void
get()
get(key: string): TypedArray;
Defined in: nvimage/zarr/ZarrChunkCache.ts:43
Get a chunk from the cache. Also moves the entry to the end (most recently used).
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
TypedArray
has()
has(key: string): boolean;
Defined in: nvimage/zarr/ZarrChunkCache.ts:35
Check if a chunk is in the cache
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
boolean
isLoading()
isLoading(key: string): boolean;
Defined in: nvimage/zarr/ZarrChunkCache.ts:79
Check if a chunk is currently being loaded
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
boolean
keys()
keys(): IterableIterator<string>;
Defined in: nvimage/zarr/ZarrChunkCache.ts:130
Get all cached keys
Returns
IterableIterator<string>
set()
set(key: string, chunk: TypedArray): void;
Defined in: nvimage/zarr/ZarrChunkCache.ts:57
Store a chunk in the cache. Evicts oldest entries if capacity is exceeded.
Parameters
| Parameter | Type |
|---|---|
key | string |
chunk | TypedArray |
Returns
void
startLoading()
startLoading(key: string): void;
Defined in: nvimage/zarr/ZarrChunkCache.ts:86
Mark a chunk as loading (to prevent duplicate requests)
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
void
getKey()
static getKey(
name: string,
level: number,
x: number,
y: number,
z?: number): string;
Defined in: nvimage/zarr/ZarrChunkCache.ts:25
Generate a unique key for a chunk. Format: "name:level/x/y" for 2D or "name:level/x/y/z" for 3D
Parameters
| Parameter | Type |
|---|---|
name | string |
level | number |
x | number |
y | number |
z? | number |
Returns
string