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:113
bytesAvailable
getbytesAvailable():number
The number of bytes that the store can still take.
Returns
number
Defined in
packages/core/src/cache/volumeTextureStore.ts:127
bytesUsed
getbytesUsed():number
The number of bytes that every texture of every volume takes.
Returns
number
Defined in
packages/core/src/cache/volumeTextureStore.ts:102
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:332
claimedVolumeIds()
claimedVolumeIds():
Set<string>
The volumes whose texture sets a viewport holds: the display sets.
Returns
Set<string>
Defined in
packages/core/src/cache/volumeTextureStore.ts:180
clear()
clear():
void
Removes every set of every volume.
Returns
void
Defined in
packages/core/src/cache/volumeTextureStore.ts:394
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 format that vtk.js uploads, as the strategy does (see
gpuTextureBytesPerVoxel). The CPU buffer of a 16-bit volume is
Float32Array, but its texture holds 2 bytes per value with norm16 or
half float.
Parameters
• grid: VoxelGrid
• dataType?: PixelDataTypedArrayString
• numberOfComponents?: number = 1
Returns
number
Defined in
packages/core/src/cache/volumeTextureStore.ts:168
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:361
evictUnheld()
evictUnheld():
void
Removes every set that no consumer holds. A backstop set goes too: it leaves last only when a budget must choose, and a set that no viewport draws holds GPU memory for nothing.
Returns
void
Defined in
packages/core/src/cache/volumeTextureStore.ts:405
evictVolume()
evictVolume(
volumeId):void
Removes every set of one volume.
Parameters
• volumeId: string
Returns
void
Defined in
packages/core/src/cache/volumeTextureStore.ts:385
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:149
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:236
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:347
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:122
setsOfVolume()
setsOfVolume<
TextureType>(volumeId):VolumeTextureSet<TextureType>[]
Every named set of one volume.
Type Parameters
• TextureType
Parameters
• volumeId: string
Returns
VolumeTextureSet<TextureType>[]