TextureManager
Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkWebGPUTextureManager characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IWebGPUTextureManagerInitialValues | No | (default: {}) |
getDevice
Get the device the textures are created on.
getTexture
Get the texture matching the request from the device cache, creating and caching it when it is missing. A request without a hash always creates a new texture.
| Argument | Type | Required | Description |
|---|---|---|---|
req | IWebGPUTextureRequest | Yes | The texture request. |
getTextureForImageData
Get the texture holding the point scalars of the given image data. The cache key covers both the image data and its scalar array modified times.
| Argument | Type | Required | Description |
|---|---|---|---|
imgData | Yes | The image data to upload. |
getTextureForVTKTexture
Get the texture holding the contents of a vtkTexture, whichever of its image data, image, ImageData, ImageBitmap or canvas source is set.
| Argument | Type | Required | Description |
|---|---|---|---|
srcTexture | Yes | The texture to upload. | |
label | String | No | The WGSL name given to the created texture. |
newInstance
Method used to create a new instance of vtkWebGPUTextureManager.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPUTextureManagerInitialValues | No | for pre-setting some of its content |
releaseTexture
Release the texture binding held by this owner. The texture is destroyed after the next submission when no owners still use it.
setDevice
Set the device the textures are created on.