Click or drag to resize
Ab4d.SharpEngine logo

GpuImageCopyWithNewImageView Method

Creates a copy of the current GPU image with a new ImageView of the specified type and array layer range. When this GpuImage is disposed, only the newly created ImageView will be disposed, while the other GpuImage resources will not be disposed.

Namespace: Ab4d.SharpEngine.Core
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.0.9584+ba1aaa26d4181dd3fa8ed7b6398391d1affa36c8
Syntax
C#
public GpuImage CopyWithNewImageView(
	ImageViewType viewType,
	int baseArrayLayer = 0,
	int layerCount = 1,
	string? name = null
)

Parameters

viewType  ImageViewType
The type of ImageView to create for the new GPU image. Determines how the image data is interpreted and accessed.
baseArrayLayer  Int32  (Optional)
The zero-based index of the first array layer to include in the new ImageView. Must be non-negative.
layerCount  Int32  (Optional)
The number of array layers to include in the new ImageView. Must be at least 1.
name  String  (Optional)
An optional name to assign to the new GPU image. If null, the name is inherited from the original image.

Return Value

GpuImage
A new GpuImage instance that shares the underlying image but uses a new ImageView with the specified parameters.
Remarks
The returned GpuImage instance manages its own ImageView and should be disposed independently. The underlying image memory is shared between the original and the new instance.
See Also