Class VkImageCopy
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkImageCopy
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkImageCopy extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying an image copy operation.Description
For
IMAGE_TYPE_3Dimages, copies are performed slice by slice starting with thezmember of thesrcOffsetordstOffset, and copyingdepthslices. For images with multiple layers, copies are performed layer by layer starting with thebaseArrayLayermember of thesrcSubresourceordstSubresourceand copyinglayerCountlayers. Image data can be copied between images with different image types. If one image isIMAGE_TYPE_3Dand the other image isIMAGE_TYPE_2Dwith multiple layers, then each slice is copied to or from a different layer.Copies involving a multi-planar image format specify the region to be copied in terms of the plane to be copied, not the coordinates of the multi-planar image. This means that copies accessing the R/B planes of "
_422" format images must fit the copied region within half thewidthof the parent image, and that copies accessing the R/B planes of "_420" format images must fit the copied region within half thewidthandheightof the parent image.Valid Usage
- If neither the calling command’s
srcImagenor the calling command’sdstImagehas a multi-planar image format then theaspectMaskmember ofsrcSubresourceanddstSubresourcemust match - If the calling command’s
srcImagehas aVkFormatwith two planes then thesrcSubresourceaspectMaskmust beIMAGE_ASPECT_PLANE_0_BITorIMAGE_ASPECT_PLANE_1_BIT - If the calling command’s
srcImagehas aVkFormatwith three planes then thesrcSubresourceaspectMaskmust beIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BIT, orIMAGE_ASPECT_PLANE_2_BIT - If the calling command’s
dstImagehas aVkFormatwith two planes then thedstSubresourceaspectMaskmust beIMAGE_ASPECT_PLANE_0_BITorIMAGE_ASPECT_PLANE_1_BIT - If the calling command’s
dstImagehas aVkFormatwith three planes then thedstSubresourceaspectMaskmust beIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BIT, orIMAGE_ASPECT_PLANE_2_BIT - If the calling command’s
srcImagehas a multi-planar image format and thedstImagedoes not have a multi-planar image format, thedstSubresourceaspectMaskmust beIMAGE_ASPECT_COLOR_BIT - If the calling command’s
dstImagehas a multi-planar image format and thesrcImagedoes not have a multi-planar image format, thesrcSubresourceaspectMaskmust beIMAGE_ASPECT_COLOR_BIT - The number of slices of the
extent(for 3D) or layers of thesrcSubresource(for non-3D) must match the number of slices of theextent(for 3D) or layers of thedstSubresource(for non-3D) - If either of the calling command’s
srcImageordstImageparameters are ofVkImageTypeIMAGE_TYPE_3D, thebaseArrayLayerandlayerCountmembers of the corresponding subresource must be 0 and 1, respectively - The
aspectMaskmember ofsrcSubresourcemust specify aspects present in the calling command’ssrcImage - The
aspectMaskmember ofdstSubresourcemust specify aspects present in the calling command’sdstImage srcOffset.xand(extent.width srcOffset.x)must both be greater than or equal to 0 and less than or equal to the source image subresource widthsrcOffset.yand(extent.height srcOffset.y)must both be greater than or equal to 0 and less than or equal to the source image subresource height- If the calling command’s
srcImageis of typeIMAGE_TYPE_1D, thensrcOffset.ymust be 0 andextent.heightmust be 1. srcOffset.zand(extent.depth srcOffset.z)must both be greater than or equal to 0 and less than or equal to the source image subresource depth- If the calling command’s
srcImageis of typeIMAGE_TYPE_1D, thensrcOffset.zmust be 0 andextent.depthmust be 1. - If the calling command’s
dstImageis of typeIMAGE_TYPE_1D, thendstOffset.zmust be 0 andextent.depthmust be 1. - If the calling command’s
srcImageis of typeIMAGE_TYPE_2D, thensrcOffset.zmust be 0. - If the calling command’s
dstImageis of typeIMAGE_TYPE_2D, thendstOffset.zmust be 0. - If both
srcImageanddstImageare of typeIMAGE_TYPE_2Dthenextent.depthmust be 1. - If the calling command’s
srcImageis of typeIMAGE_TYPE_2D, and thedstImageis of typeIMAGE_TYPE_3D, thenextent.depthmust equal to thelayerCountmember ofsrcSubresource. - If the calling command’s
dstImageis of typeIMAGE_TYPE_2D, and thesrcImageis of typeIMAGE_TYPE_3D, thenextent.depthmust equal to thelayerCountmember ofdstSubresource. dstOffset.xand(extent.width dstOffset.x)must both be greater than or equal to 0 and less than or equal to the destination image subresource widthdstOffset.yand(extent.height dstOffset.y)must both be greater than or equal to 0 and less than or equal to the destination image subresource height- If the calling command’s
dstImageis of typeIMAGE_TYPE_1D, thendstOffset.ymust be 0 andextent.heightmust be 1. dstOffset.zand(extent.depth dstOffset.z)must both be greater than or equal to 0 and less than or equal to the destination image subresource depth- If the calling command’s
srcImageis a compressed image, or a single-plane, “_422” image format, all members ofsrcOffsetmust be a multiple of the corresponding dimensions of the compressed texel block - If the calling command’s
srcImageis a compressed image, or a single-plane, “_422” image format,extent.widthmust be a multiple of the compressed texel block width or(extent.width + srcOffset.x)must equal the source image subresource width - If the calling command’s
srcImageis a compressed image, or a single-plane, “_422” image format,extent.heightmust be a multiple of the compressed texel block height or(extent.height + srcOffset.y)must equal the source image subresource height - If the calling command’s
srcImageis a compressed image, or a single-plane, “_422” image format,extent.depthmust be a multiple of the compressed texel block depth or(extent.depth + srcOffset.z)must equal the source image subresource depth - If the calling command’s
dstImageis a compressed format image, or a single-plane, “_422” image format, all members ofdstOffsetmust be a multiple of the corresponding dimensions of the compressed texel block - If the calling command’s
dstImageis a compressed format image, or a single-plane, “_422” image format,extent.widthmust be a multiple of the compressed texel block width or(extent.width + dstOffset.x)must equal the destination image subresource width - If the calling command’s
dstImageis a compressed format image, or a single-plane, “_422” image format,extent.heightmust be a multiple of the compressed texel block height or(extent.height + dstOffset.y)must equal the destination image subresource height - If the calling command’s
dstImageis a compressed format image, or a single-plane, “_422” image format,extent.depthmust be a multiple of the compressed texel block depth or(extent.depth + dstOffset.z)must equal the destination image subresource depth
Valid Usage (Implicit)
srcSubresourcemust be a validVkImageSubresourceLayersstructuredstSubresourcemust be a validVkImageSubresourceLayersstructure
See Also
VkExtent3D,VkImageSubresourceLayers,VkOffset3D,CmdCopyImageMember documentation
srcSubresource–srcSubresourceanddstSubresourceareVkImageSubresourceLayersstructures specifying the image subresources of the images used for the source and destination image data, respectively.srcOffset–srcOffsetanddstOffsetselect the initialx,y, andzoffsets in texels of the sub-regions of the source and destination image data.dstSubresource– seesrcSubresourcedstOffset– seesrcOffsetextent– the size in texels of the image to copy inwidth,heightanddepth.
Layout
struct VkImageCopy {VkImageSubresourceLayerssrcSubresource;VkOffset3DsrcOffset;VkImageSubresourceLayersdstSubresource;VkOffset3DdstOffset;VkExtent3Dextent; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkImageCopy.BufferAn array ofVkImageCopystructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intDSTOFFSET
DSTSUBRESOURCE
EXTENTThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSRCOFFSET
SRCSUBRESOURCEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkImageCopy(java.nio.ByteBuffer container)Creates aVkImageCopyinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkImageCopycalloc()Returns a newVkImageCopyinstance allocated withmemCalloc.static VkImageCopy.Buffercalloc(int capacity)Returns a newVkImageCopy.Bufferinstance allocated withmemCalloc.static VkImageCopycallocStack()Returns a newVkImageCopyinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkImageCopy.BuffercallocStack(int capacity)Returns a newVkImageCopy.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkImageCopy.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkImageCopy.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkImageCopycallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkImageCopyinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkImageCopycreate()Returns a newVkImageCopyinstance allocated withBufferUtils.static VkImageCopy.Buffercreate(int capacity)Returns a newVkImageCopy.Bufferinstance allocated withBufferUtils.static VkImageCopycreate(long address)Returns a newVkImageCopyinstance for the specified memory address.static VkImageCopy.Buffercreate(long address, int capacity)Create aVkImageCopy.Bufferinstance at the specified memory.static VkImageCopycreateSafe(long address)static VkImageCopy.BuffercreateSafe(long address, int capacity)VkOffset3DdstOffset()Returns aVkOffset3Dview of thedstOffsetfield.VkImageCopydstOffset(java.util.function.Consumer<VkOffset3D> consumer)Passes thedstOffsetfield to the specifiedConsumer.VkImageCopydstOffset(VkOffset3D value)Copies the specifiedVkOffset3Dto thedstOffsetfield.VkImageSubresourceLayersdstSubresource()Returns aVkImageSubresourceLayersview of thedstSubresourcefield.VkImageCopydstSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)Passes thedstSubresourcefield to the specifiedConsumer.VkImageCopydstSubresource(VkImageSubresourceLayers value)Copies the specifiedVkImageSubresourceLayersto thedstSubresourcefield.VkExtent3Dextent()Returns aVkExtent3Dview of theextentfield.VkImageCopyextent(java.util.function.Consumer<VkExtent3D> consumer)Passes theextentfield to the specifiedConsumer.VkImageCopyextent(VkExtent3D value)Copies the specifiedVkExtent3Dto theextentfield.static VkImageCopymalloc()Returns a newVkImageCopyinstance allocated withmemAlloc.static VkImageCopy.Buffermalloc(int capacity)Returns a newVkImageCopy.Bufferinstance allocated withmemAlloc.static VkImageCopymallocStack()Returns a newVkImageCopyinstance allocated on the thread-localMemoryStack.static VkImageCopy.BuffermallocStack(int capacity)Returns a newVkImageCopy.Bufferinstance allocated on the thread-localMemoryStack.static VkImageCopy.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkImageCopy.Bufferinstance allocated on the specifiedMemoryStack.static VkImageCopymallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkImageCopyinstance allocated on the specifiedMemoryStack.static VkOffset3DndstOffset(long struct)Unsafe version ofdstOffset().static voidndstOffset(long struct, VkOffset3D value)Unsafe version ofdstOffset.static VkImageSubresourceLayersndstSubresource(long struct)Unsafe version ofdstSubresource().static voidndstSubresource(long struct, VkImageSubresourceLayers value)Unsafe version ofdstSubresource.static VkExtent3Dnextent(long struct)Unsafe version ofextent().static voidnextent(long struct, VkExtent3D value)Unsafe version ofextent.static VkOffset3DnsrcOffset(long struct)Unsafe version ofsrcOffset().static voidnsrcOffset(long struct, VkOffset3D value)Unsafe version ofsrcOffset.static VkImageSubresourceLayersnsrcSubresource(long struct)Unsafe version ofsrcSubresource().static voidnsrcSubresource(long struct, VkImageSubresourceLayers value)Unsafe version ofsrcSubresource.VkImageCopyset(VkImageCopy src)Copies the specified struct data to this struct.VkImageCopyset(VkImageSubresourceLayers srcSubresource, VkOffset3D srcOffset, VkImageSubresourceLayers dstSubresource, VkOffset3D dstOffset, VkExtent3D extent)Initializes this struct with the specified values.intsizeof()VkOffset3DsrcOffset()Returns aVkOffset3Dview of thesrcOffsetfield.VkImageCopysrcOffset(java.util.function.Consumer<VkOffset3D> consumer)Passes thesrcOffsetfield to the specifiedConsumer.VkImageCopysrcOffset(VkOffset3D value)Copies the specifiedVkOffset3Dto thesrcOffsetfield.VkImageSubresourceLayerssrcSubresource()Returns aVkImageSubresourceLayersview of thesrcSubresourcefield.VkImageCopysrcSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)Passes thesrcSubresourcefield to the specifiedConsumer.VkImageCopysrcSubresource(VkImageSubresourceLayers value)Copies the specifiedVkImageSubresourceLayersto thesrcSubresourcefield.
-
-
-
Constructor Detail
-
VkImageCopy
public VkImageCopy(java.nio.ByteBuffer container)
Creates aVkImageCopyinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
srcSubresource
public VkImageSubresourceLayers srcSubresource()
Returns aVkImageSubresourceLayersview of thesrcSubresourcefield.
-
srcOffset
public VkOffset3D srcOffset()
Returns aVkOffset3Dview of thesrcOffsetfield.
-
dstSubresource
public VkImageSubresourceLayers dstSubresource()
Returns aVkImageSubresourceLayersview of thedstSubresourcefield.
-
dstOffset
public VkOffset3D dstOffset()
Returns aVkOffset3Dview of thedstOffsetfield.
-
extent
public VkExtent3D extent()
Returns aVkExtent3Dview of theextentfield.
-
srcSubresource
public VkImageCopy srcSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayersto thesrcSubresourcefield.
-
srcSubresource
public VkImageCopy srcSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes thesrcSubresourcefield to the specifiedConsumer.
-
srcOffset
public VkImageCopy srcOffset(VkOffset3D value)
Copies the specifiedVkOffset3Dto thesrcOffsetfield.
-
srcOffset
public VkImageCopy srcOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes thesrcOffsetfield to the specifiedConsumer.
-
dstSubresource
public VkImageCopy dstSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayersto thedstSubresourcefield.
-
dstSubresource
public VkImageCopy dstSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes thedstSubresourcefield to the specifiedConsumer.
-
dstOffset
public VkImageCopy dstOffset(VkOffset3D value)
Copies the specifiedVkOffset3Dto thedstOffsetfield.
-
dstOffset
public VkImageCopy dstOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes thedstOffsetfield to the specifiedConsumer.
-
extent
public VkImageCopy extent(VkExtent3D value)
Copies the specifiedVkExtent3Dto theextentfield.
-
extent
public VkImageCopy extent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theextentfield to the specifiedConsumer.
-
set
public VkImageCopy set(VkImageSubresourceLayers srcSubresource, VkOffset3D srcOffset, VkImageSubresourceLayers dstSubresource, VkOffset3D dstOffset, VkExtent3D extent)
Initializes this struct with the specified values.
-
set
public VkImageCopy set(VkImageCopy src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkImageCopy malloc()
Returns a newVkImageCopyinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkImageCopy calloc()
Returns a newVkImageCopyinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkImageCopy create()
Returns a newVkImageCopyinstance allocated withBufferUtils.
-
create
public static VkImageCopy create(long address)
Returns a newVkImageCopyinstance for the specified memory address.
-
createSafe
@Nullable public static VkImageCopy createSafe(long address)
-
malloc
public static VkImageCopy.Buffer malloc(int capacity)
Returns a newVkImageCopy.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkImageCopy.Buffer calloc(int capacity)
Returns a newVkImageCopy.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkImageCopy.Buffer create(int capacity)
Returns a newVkImageCopy.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkImageCopy.Buffer create(long address, int capacity)
Create aVkImageCopy.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkImageCopy.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkImageCopy mallocStack()
Returns a newVkImageCopyinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkImageCopy callocStack()
Returns a newVkImageCopyinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkImageCopy mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopyinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkImageCopy callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopyinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static VkImageCopy.Buffer mallocStack(int capacity)
Returns a newVkImageCopy.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkImageCopy.Buffer callocStack(int capacity)
Returns a newVkImageCopy.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkImageCopy.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopy.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static VkImageCopy.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopy.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nsrcSubresource
public static VkImageSubresourceLayers nsrcSubresource(long struct)
Unsafe version ofsrcSubresource().
-
nsrcOffset
public static VkOffset3D nsrcOffset(long struct)
Unsafe version ofsrcOffset().
-
ndstSubresource
public static VkImageSubresourceLayers ndstSubresource(long struct)
Unsafe version ofdstSubresource().
-
ndstOffset
public static VkOffset3D ndstOffset(long struct)
Unsafe version ofdstOffset().
-
nextent
public static VkExtent3D nextent(long struct)
Unsafe version ofextent().
-
nsrcSubresource
public static void nsrcSubresource(long struct, VkImageSubresourceLayers value)Unsafe version ofsrcSubresource.
-
nsrcOffset
public static void nsrcOffset(long struct, VkOffset3D value)Unsafe version ofsrcOffset.
-
ndstSubresource
public static void ndstSubresource(long struct, VkImageSubresourceLayers value)Unsafe version ofdstSubresource.
-
ndstOffset
public static void ndstOffset(long struct, VkOffset3D value)Unsafe version ofdstOffset.
-
nextent
public static void nextent(long struct, VkExtent3D value)Unsafe version ofextent.
-
-