- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanSubresourceLayout
-
- All Implemented Interfaces:
VulkanSubresourceLayoutType
public final class VulkanSubresourceLayout extends java.lang.Object implements VulkanSubresourceLayoutType
Structure specifying subresource layout.- See Also:
- "VkSubresourceLayout"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanSubresourceLayout.Builder
Builds instances of typeVulkanSubresourceLayout
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
arrayPitch()
static VulkanSubresourceLayout.Builder
builder()
Creates a builder forVulkanSubresourceLayout
.static VulkanSubresourceLayout
copyOf(VulkanSubresourceLayoutType instance)
Creates an immutable copy of aVulkanSubresourceLayoutType
value.long
depthPitch()
boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanSubresourceLayout
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:offset
,size
,rowPitch
,arrayPitch
,depthPitch
.static VulkanSubresourceLayout
of(long offset, long size, long rowPitch, long arrayPitch, long depthPitch)
Construct a new immutableVulkanSubresourceLayout
instance.long
offset()
long
rowPitch()
long
size()
java.lang.String
toString()
Prints the immutable valueVulkanSubresourceLayout
with attribute values.VulkanSubresourceLayout
withArrayPitch(long value)
Copy the current immutable object by setting a value for thearrayPitch
attribute.VulkanSubresourceLayout
withDepthPitch(long value)
Copy the current immutable object by setting a value for thedepthPitch
attribute.VulkanSubresourceLayout
withOffset(long value)
Copy the current immutable object by setting a value for theoffset
attribute.VulkanSubresourceLayout
withRowPitch(long value)
Copy the current immutable object by setting a value for therowPitch
attribute.VulkanSubresourceLayout
withSize(long value)
Copy the current immutable object by setting a value for thesize
attribute.
-
-
-
Method Detail
-
offset
public long offset()
- Specified by:
offset
in interfaceVulkanSubresourceLayoutType
- Returns:
- The byte offset from the start of the image or the plane where the image subresource begins.
-
size
public long size()
- Specified by:
size
in interfaceVulkanSubresourceLayoutType
- Returns:
- The size in bytes of the image subresource. size includes any extra memory that is required based on rowPitch.
-
rowPitch
public long rowPitch()
- Specified by:
rowPitch
in interfaceVulkanSubresourceLayoutType
- Returns:
- The number of bytes between each row of texels in an image.
-
arrayPitch
public long arrayPitch()
- Specified by:
arrayPitch
in interfaceVulkanSubresourceLayoutType
- Returns:
- The number of bytes between each array layer of an image.
-
depthPitch
public long depthPitch()
- Specified by:
depthPitch
in interfaceVulkanSubresourceLayoutType
- Returns:
- The number of bytes between each slice of 3D image.
-
withOffset
public final VulkanSubresourceLayout withOffset(long value)
Copy the current immutable object by setting a value for theoffset
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for offset- Returns:
- A modified copy of the
this
object
-
withSize
public final VulkanSubresourceLayout withSize(long value)
Copy the current immutable object by setting a value for thesize
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for size- Returns:
- A modified copy of the
this
object
-
withRowPitch
public final VulkanSubresourceLayout withRowPitch(long value)
Copy the current immutable object by setting a value for therowPitch
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for rowPitch- Returns:
- A modified copy of the
this
object
-
withArrayPitch
public final VulkanSubresourceLayout withArrayPitch(long value)
Copy the current immutable object by setting a value for thearrayPitch
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for arrayPitch- Returns:
- A modified copy of the
this
object
-
withDepthPitch
public final VulkanSubresourceLayout withDepthPitch(long value)
Copy the current immutable object by setting a value for thedepthPitch
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for depthPitch- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofVulkanSubresourceLayout
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()
Computes a hash code from attributes:offset
,size
,rowPitch
,arrayPitch
,depthPitch
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanSubresourceLayout
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanSubresourceLayout of(long offset, long size, long rowPitch, long arrayPitch, long depthPitch)
Construct a new immutableVulkanSubresourceLayout
instance.- Parameters:
offset
- The value for theoffset
attributesize
- The value for thesize
attributerowPitch
- The value for therowPitch
attributearrayPitch
- The value for thearrayPitch
attributedepthPitch
- The value for thedepthPitch
attribute- Returns:
- An immutable VulkanSubresourceLayout instance
-
copyOf
public static VulkanSubresourceLayout copyOf(VulkanSubresourceLayoutType instance)
Creates an immutable copy of aVulkanSubresourceLayoutType
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable VulkanSubresourceLayout instance
-
builder
public static VulkanSubresourceLayout.Builder builder()
Creates a builder forVulkanSubresourceLayout
.- Returns:
- A new VulkanSubresourceLayout builder
-
-