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.NativeResource
Structure specifying an image copy operation.Description
For
IMAGE_TYPE_3D
images, copies are performed slice by slice starting with thez
member of thesrcOffset
ordstOffset
, and copyingdepth
slices. For images with multiple layers, copies are performed layer by layer starting with thebaseArrayLayer
member of thesrcSubresource
ordstSubresource
and copyinglayerCount
layers. Image data can be copied between images with different image types. If one image isIMAGE_TYPE_3D
and the other image isIMAGE_TYPE_2D
with 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 thewidth
of the parent image, and that copies accessing the R/B planes of "_420
" format images must fit the copied region within half thewidth
andheight
of the parent image.Valid Usage
- If neither the calling command’s
srcImage
nor the calling command’sdstImage
has a multi-planar image format then theaspectMask
member ofsrcSubresource
anddstSubresource
must match - If the calling command’s
srcImage
has aVkFormat
with two planes then thesrcSubresource
aspectMask
must beIMAGE_ASPECT_PLANE_0_BIT
orIMAGE_ASPECT_PLANE_1_BIT
- If the calling command’s
srcImage
has aVkFormat
with three planes then thesrcSubresource
aspectMask
must beIMAGE_ASPECT_PLANE_0_BIT
,IMAGE_ASPECT_PLANE_1_BIT
, orIMAGE_ASPECT_PLANE_2_BIT
- If the calling command’s
dstImage
has aVkFormat
with two planes then thedstSubresource
aspectMask
must beIMAGE_ASPECT_PLANE_0_BIT
orIMAGE_ASPECT_PLANE_1_BIT
- If the calling command’s
dstImage
has aVkFormat
with three planes then thedstSubresource
aspectMask
must beIMAGE_ASPECT_PLANE_0_BIT
,IMAGE_ASPECT_PLANE_1_BIT
, orIMAGE_ASPECT_PLANE_2_BIT
- If the calling command’s
srcImage
has a multi-planar image format and thedstImage
does not have a multi-planar image format, thedstSubresource
aspectMask
must beIMAGE_ASPECT_COLOR_BIT
- If the calling command’s
dstImage
has a multi-planar image format and thesrcImage
does not have a multi-planar image format, thesrcSubresource
aspectMask
must 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
srcImage
ordstImage
parameters are ofVkImageType
IMAGE_TYPE_3D
, thebaseArrayLayer
andlayerCount
members of the corresponding subresource must be 0 and 1, respectively - The
aspectMask
member ofsrcSubresource
must specify aspects present in the calling command’ssrcImage
- The
aspectMask
member ofdstSubresource
must specify aspects present in the calling command’sdstImage
srcOffset.x
and(extent.width srcOffset.x)
must both be greater than or equal to 0 and less than or equal to the source image subresource widthsrcOffset.y
and(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
srcImage
is of typeIMAGE_TYPE_1D
, thensrcOffset.y
must be 0 andextent.height
must be 1. srcOffset.z
and(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
srcImage
is of typeIMAGE_TYPE_1D
, thensrcOffset.z
must be 0 andextent.depth
must be 1. - If the calling command’s
dstImage
is of typeIMAGE_TYPE_1D
, thendstOffset.z
must be 0 andextent.depth
must be 1. - If the calling command’s
srcImage
is of typeIMAGE_TYPE_2D
, thensrcOffset.z
must be 0. - If the calling command’s
dstImage
is of typeIMAGE_TYPE_2D
, thendstOffset.z
must be 0. - If both
srcImage
anddstImage
are of typeIMAGE_TYPE_2D
thenextent.depth
must be 1. - If the calling command’s
srcImage
is of typeIMAGE_TYPE_2D
, and thedstImage
is of typeIMAGE_TYPE_3D
, thenextent.depth
must equal to thelayerCount
member ofsrcSubresource
. - If the calling command’s
dstImage
is of typeIMAGE_TYPE_2D
, and thesrcImage
is of typeIMAGE_TYPE_3D
, thenextent.depth
must equal to thelayerCount
member ofdstSubresource
. dstOffset.x
and(extent.width dstOffset.x)
must both be greater than or equal to 0 and less than or equal to the destination image subresource widthdstOffset.y
and(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
dstImage
is of typeIMAGE_TYPE_1D
, thendstOffset.y
must be 0 andextent.height
must be 1. dstOffset.z
and(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
srcImage
is a compressed image, or a single-plane, “_422
” image format, all members ofsrcOffset
must be a multiple of the corresponding dimensions of the compressed texel block - If the calling command’s
srcImage
is a compressed image, or a single-plane, “_422
” image format,extent.width
must 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
srcImage
is a compressed image, or a single-plane, “_422
” image format,extent.height
must 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
srcImage
is a compressed image, or a single-plane, “_422
” image format,extent.depth
must 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
dstImage
is a compressed format image, or a single-plane, “_422
” image format, all members ofdstOffset
must be a multiple of the corresponding dimensions of the compressed texel block - If the calling command’s
dstImage
is a compressed format image, or a single-plane, “_422
” image format,extent.width
must 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
dstImage
is a compressed format image, or a single-plane, “_422
” image format,extent.height
must 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
dstImage
is a compressed format image, or a single-plane, “_422
” image format,extent.depth
must be a multiple of the compressed texel block depth or(extent.depth + dstOffset.z)
must equal the destination image subresource depth
Valid Usage (Implicit)
srcSubresource
must be a validVkImageSubresourceLayers
structuredstSubresource
must be a validVkImageSubresourceLayers
structure
See Also
VkExtent3D
,VkImageSubresourceLayers
,VkOffset3D
,CmdCopyImage
Member documentation
srcSubresource
–srcSubresource
anddstSubresource
areVkImageSubresourceLayers
structures specifying the image subresources of the images used for the source and destination image data, respectively.srcOffset
–srcOffset
anddstOffset
select the initialx
,y
, andz
offsets in texels of the sub-regions of the source and destination image data.dstSubresource
– seesrcSubresource
dstOffset
– seesrcOffset
extent
– the size in texels of the image to copy inwidth
,height
anddepth
.
Layout
struct VkImageCopy {
VkImageSubresourceLayers
srcSubresource;VkOffset3D
srcOffset;VkImageSubresourceLayers
dstSubresource;VkOffset3D
dstOffset;VkExtent3D
extent; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkImageCopy.Buffer
An array ofVkImageCopy
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
DSTOFFSET
DSTSUBRESOURCE
EXTENTThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
SRCOFFSET
SRCSUBRESOURCEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkImageCopy(java.nio.ByteBuffer container)
Creates aVkImageCopy
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkImageCopy
calloc()
Returns a newVkImageCopy
instance allocated withmemCalloc
.static VkImageCopy.Buffer
calloc(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated withmemCalloc
.static VkImageCopy
callocStack()
Returns a newVkImageCopy
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkImageCopy.Buffer
callocStack(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkImageCopy.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopy.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkImageCopy
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopy
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkImageCopy
create()
Returns a newVkImageCopy
instance allocated withBufferUtils
.static VkImageCopy.Buffer
create(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated withBufferUtils
.static VkImageCopy
create(long address)
Returns a newVkImageCopy
instance for the specified memory address.static VkImageCopy.Buffer
create(long address, int capacity)
Create aVkImageCopy.Buffer
instance at the specified memory.static VkImageCopy
createSafe(long address)
static VkImageCopy.Buffer
createSafe(long address, int capacity)
VkOffset3D
dstOffset()
Returns aVkOffset3D
view of thedstOffset
field.VkImageCopy
dstOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes thedstOffset
field to the specifiedConsumer
.VkImageCopy
dstOffset(VkOffset3D value)
Copies the specifiedVkOffset3D
to thedstOffset
field.VkImageSubresourceLayers
dstSubresource()
Returns aVkImageSubresourceLayers
view of thedstSubresource
field.VkImageCopy
dstSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes thedstSubresource
field to the specifiedConsumer
.VkImageCopy
dstSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayers
to thedstSubresource
field.VkExtent3D
extent()
Returns aVkExtent3D
view of theextent
field.VkImageCopy
extent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theextent
field to the specifiedConsumer
.VkImageCopy
extent(VkExtent3D value)
Copies the specifiedVkExtent3D
to theextent
field.static VkImageCopy
malloc()
Returns a newVkImageCopy
instance allocated withmemAlloc
.static VkImageCopy.Buffer
malloc(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated withmemAlloc
.static VkImageCopy
mallocStack()
Returns a newVkImageCopy
instance allocated on the thread-localMemoryStack
.static VkImageCopy.Buffer
mallocStack(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated on the thread-localMemoryStack
.static VkImageCopy.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopy.Buffer
instance allocated on the specifiedMemoryStack
.static VkImageCopy
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopy
instance allocated on the specifiedMemoryStack
.static VkOffset3D
ndstOffset(long struct)
Unsafe version ofdstOffset()
.static void
ndstOffset(long struct, VkOffset3D value)
Unsafe version ofdstOffset
.static VkImageSubresourceLayers
ndstSubresource(long struct)
Unsafe version ofdstSubresource()
.static void
ndstSubresource(long struct, VkImageSubresourceLayers value)
Unsafe version ofdstSubresource
.static VkExtent3D
nextent(long struct)
Unsafe version ofextent()
.static void
nextent(long struct, VkExtent3D value)
Unsafe version ofextent
.static VkOffset3D
nsrcOffset(long struct)
Unsafe version ofsrcOffset()
.static void
nsrcOffset(long struct, VkOffset3D value)
Unsafe version ofsrcOffset
.static VkImageSubresourceLayers
nsrcSubresource(long struct)
Unsafe version ofsrcSubresource()
.static void
nsrcSubresource(long struct, VkImageSubresourceLayers value)
Unsafe version ofsrcSubresource
.VkImageCopy
set(VkImageCopy src)
Copies the specified struct data to this struct.VkImageCopy
set(VkImageSubresourceLayers srcSubresource, VkOffset3D srcOffset, VkImageSubresourceLayers dstSubresource, VkOffset3D dstOffset, VkExtent3D extent)
Initializes this struct with the specified values.int
sizeof()
VkOffset3D
srcOffset()
Returns aVkOffset3D
view of thesrcOffset
field.VkImageCopy
srcOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes thesrcOffset
field to the specifiedConsumer
.VkImageCopy
srcOffset(VkOffset3D value)
Copies the specifiedVkOffset3D
to thesrcOffset
field.VkImageSubresourceLayers
srcSubresource()
Returns aVkImageSubresourceLayers
view of thesrcSubresource
field.VkImageCopy
srcSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes thesrcSubresource
field to the specifiedConsumer
.VkImageCopy
srcSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayers
to thesrcSubresource
field.
-
-
-
Constructor Detail
-
VkImageCopy
public VkImageCopy(java.nio.ByteBuffer container)
Creates aVkImageCopy
instance at the current position of the specifiedByteBuffer
container. 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:
sizeof
in classorg.lwjgl.system.Struct
-
srcSubresource
public VkImageSubresourceLayers srcSubresource()
Returns aVkImageSubresourceLayers
view of thesrcSubresource
field.
-
srcOffset
public VkOffset3D srcOffset()
Returns aVkOffset3D
view of thesrcOffset
field.
-
dstSubresource
public VkImageSubresourceLayers dstSubresource()
Returns aVkImageSubresourceLayers
view of thedstSubresource
field.
-
dstOffset
public VkOffset3D dstOffset()
Returns aVkOffset3D
view of thedstOffset
field.
-
extent
public VkExtent3D extent()
Returns aVkExtent3D
view of theextent
field.
-
srcSubresource
public VkImageCopy srcSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayers
to thesrcSubresource
field.
-
srcSubresource
public VkImageCopy srcSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes thesrcSubresource
field to the specifiedConsumer
.
-
srcOffset
public VkImageCopy srcOffset(VkOffset3D value)
Copies the specifiedVkOffset3D
to thesrcOffset
field.
-
srcOffset
public VkImageCopy srcOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes thesrcOffset
field to the specifiedConsumer
.
-
dstSubresource
public VkImageCopy dstSubresource(VkImageSubresourceLayers value)
Copies the specifiedVkImageSubresourceLayers
to thedstSubresource
field.
-
dstSubresource
public VkImageCopy dstSubresource(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
Passes thedstSubresource
field to the specifiedConsumer
.
-
dstOffset
public VkImageCopy dstOffset(VkOffset3D value)
Copies the specifiedVkOffset3D
to thedstOffset
field.
-
dstOffset
public VkImageCopy dstOffset(java.util.function.Consumer<VkOffset3D> consumer)
Passes thedstOffset
field to the specifiedConsumer
.
-
extent
public VkImageCopy extent(VkExtent3D value)
Copies the specifiedVkExtent3D
to theextent
field.
-
extent
public VkImageCopy extent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theextent
field 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 newVkImageCopy
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkImageCopy calloc()
Returns a newVkImageCopy
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkImageCopy create()
Returns a newVkImageCopy
instance allocated withBufferUtils
.
-
create
public static VkImageCopy create(long address)
Returns a newVkImageCopy
instance for the specified memory address.
-
createSafe
@Nullable public static VkImageCopy createSafe(long address)
-
malloc
public static VkImageCopy.Buffer malloc(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkImageCopy.Buffer calloc(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkImageCopy.Buffer create(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkImageCopy.Buffer create(long address, int capacity)
Create aVkImageCopy.Buffer
instance 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 newVkImageCopy
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkImageCopy callocStack()
Returns a newVkImageCopy
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkImageCopy mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopy
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkImageCopy callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkImageCopy
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkImageCopy.Buffer callocStack(int capacity)
Returns a newVkImageCopy.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-