Class: VolumeTextureStore
The global store of the texture sets.
The budget of the texture memory is global, because the device holds one
amount of it and a volume does not know what the other volumes take. The list
of sets of one volume is therefore a view of this store, which
ImageVolume.textureSets reads.
The set is the unit of eviction. A set holds the members that belong together, so a store that evicted one member would leave a set that covers part of the volume and that no selection can reason about.
Constructors
new VolumeTextureStore()
new VolumeTextureStore():
VolumeTextureStore
Returns
Accessors
budget
getbudget():number
The number of bytes that the store may take. Zero means no limit.
Returns
number
Defined in
packages/core/src/cache/volumeTextureStore.ts:121
bytesAvailable
getbytesAvailable():number
The number of bytes that the store can still take.
Returns
number
Defined in
packages/core/src/cache/volumeTextureStore.ts:135
bytesUsed
getbytesUsed():number
The number of bytes that every texture of every volume takes.
Returns
number
Defined in
packages/core/src/cache/volumeTextureStore.ts:110
Methods
claim()
claim(
volumeId,name):boolean
Adds one holder of a set, so an eviction cannot take it.
Parameters
• volumeId: string
• name: string
Returns
boolean
Defined in
packages/core/src/cache/volumeTextureStore.ts:322
clear()
clear():
void
Removes every set of every volume.
Returns
void
Defined in
packages/core/src/cache/volumeTextureStore.ts:395
costOf()
costOf(
grid,dataType?,numberOfComponents?):number
The cost of a texture for a grid, in bytes, counted before the store builds the texture. The code therefore knows in advance whether a texture can work.
The count uses the type of the buffer of a volume, which is the type that
the texture really holds. A Uint16Array volume renders through a
Float32Array buffer, so a count that read Uint16Array would state half
of the true cost.
Parameters
• grid: VoxelGrid
• dataType?: PixelDataTypedArrayString
• numberOfComponents?: number = 1
Returns
number
Defined in
packages/core/src/cache/volumeTextureStore.ts:176
evict()
evict(
volumeId,name):boolean
Removes one set, and releases every texture of that set.
Parameters
• volumeId: string
• name: string
Returns
boolean
Defined in
packages/core/src/cache/volumeTextureStore.ts:366
evictVolume()
evictVolume(
volumeId):void
Removes every set of one volume.
Parameters
• volumeId: string
Returns
void
Defined in
packages/core/src/cache/volumeTextureStore.ts:386
getSet()
getSet<
TextureType>(volumeId,name):VolumeTextureSet<TextureType>
One named set of one volume.
Type Parameters
• TextureType
Parameters
• volumeId: string
• name: string
Returns
VolumeTextureSet<TextureType>
Defined in
packages/core/src/cache/volumeTextureStore.ts:157
pin()
pin(
volumeId,name):boolean
Keeps a set until its volume leaves the cache. A budget never evicts a pinned set. A second pin changes nothing.
Parameters
• volumeId: string
• name: string
Returns
boolean
Defined in
packages/core/src/cache/volumeTextureStore.ts:339
provision()
provision<
TextureType>(options):VolumeTextureSet<TextureType>
Provisions a named set. This is the expensive step, and it never runs on the frame path: it counts the cost, evicts if it must, builds the textures and builds the area index.
A set of this name that already exists is returned as it is, so a caller may ask without a test of its own.
Type Parameters
• TextureType
Parameters
• options: ProvisionTextureSetOptions<TextureType>
Returns
VolumeTextureSet<TextureType>
the set, or undefined when the store refuses it because the
limits or the budget cannot hold it
Defined in
packages/core/src/cache/volumeTextureStore.ts:202
release()
release(
volumeId,name):boolean
Gives one holder of a set back.
Parameters
• volumeId: string
• name: string
Returns
boolean
Defined in
packages/core/src/cache/volumeTextureStore.ts:353
setBudget()
setBudget(
bytes):void
States the budget of the texture memory. An application states it from a capability profile, and a budget that nobody states is no limit, so the behaviour of a viewport does not change.
Parameters
• bytes: number
Returns
void
Defined in
packages/core/src/cache/volumeTextureStore.ts:130
setsOfVolume()
setsOfVolume<
TextureType>(volumeId):VolumeTextureSet<TextureType>[]
Every named set of one volume.
Type Parameters
• TextureType
Parameters
• volumeId: string
Returns
VolumeTextureSet<TextureType>[]