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: {}) |
getCubeTextureForVTKTexture
Get the cube map texture of the six input ports of a vtkTexture. The texture has six 2D layers, and its createView() gives a 'cube' view. The result is null if a face is missing, a face is not square, or the faces do not have the same size and format.
| Argument | Type | Required | Description |
|---|---|---|---|
srcTexture | Yes | The texture with the six faces +X, -X, +Y, -Y, +Z, -Z. | |
label | String | No | The WGSL name given to the created texture. |
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. If the texture is a cube map (see vtkTexture.useCubeMap) and options.allowCubeMap is true, the result is a cube map texture.
| Argument | Type | Required | Description |
|---|---|---|---|
srcTexture | Yes | The texture to upload. | |
label | String | No | The WGSL name given to the created texture. |
options | No |
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.