# Class VulkanSubresourceLayout

java.lang.Object
com.io7m.jcoronado.api.VulkanSubresourceLayout

All Implemented Interfaces:
  `VulkanSubresourceLayoutType`

public final class VulkanSubresourceLayout extends Object implements VulkanSubresourceLayoutType
Structure specifying subresource layout.

See Also:
  - "VkSubresourceLayout"

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `VulkanSubresourceLayout.Builder`
  Builds instances of type `VulkanSubresourceLayout`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `arrayPitch()`
  `static VulkanSubresourceLayout.Builder`
  `builder()`
  Creates a builder for `VulkanSubresourceLayout`.
  `static VulkanSubresourceLayout`
  `copyOf(VulkanSubresourceLayoutType instance)`
  Creates an immutable copy of a `VulkanSubresourceLayoutType` value.
  `long`
  `depthPitch()`
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanSubresourceLayout` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `offset`, `size`, `rowPitch`, `arrayPitch`, `depthPitch`.
  `long`
  `offset()`
  `long`
  `rowPitch()`
  `long`
  `size()`
  `String`
  `toString()`
  Prints the immutable value `VulkanSubresourceLayout` with attribute values.
  `final VulkanSubresourceLayout`
  `withArrayPitch(long value)`
  Copy the current immutable object by setting a value for the `arrayPitch` attribute.
  `final VulkanSubresourceLayout`
  `withDepthPitch(long value)`
  Copy the current immutable object by setting a value for the `depthPitch` attribute.
  `final VulkanSubresourceLayout`
  `withOffset(long value)`
  Copy the current immutable object by setting a value for the `offset` attribute.
  `final VulkanSubresourceLayout`
  `withRowPitch(long value)`
  Copy the current immutable object by setting a value for the `rowPitch` attribute.
  `final VulkanSubresourceLayout`
  `withSize(long value)`
  Copy the current immutable object by setting a value for the `size` attribute.

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### offset

    public long offset()
    Specified by:
      `offset` in interface `VulkanSubresourceLayoutType`
    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 interface `VulkanSubresourceLayoutType`
    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 interface `VulkanSubresourceLayoutType`
    Returns:
      The number of bytes between each row of texels in an image.

  - ### arrayPitch

    public long arrayPitch()
    Specified by:
      `arrayPitch` in interface `VulkanSubresourceLayoutType`
    Returns:
      The number of bytes between each array layer of an image.

  - ### depthPitch

    public long depthPitch()
    Specified by:
      `depthPitch` in interface `VulkanSubresourceLayoutType`
    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 the `offset` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for offset
    Returns:
      A modified copy or the `this` object

  - ### withSize

    public final VulkanSubresourceLayout withSize(long value)
    Copy the current immutable object by setting a value for the `size` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for size
    Returns:
      A modified copy or the `this` object

  - ### withRowPitch

    public final VulkanSubresourceLayout withRowPitch(long value)
    Copy the current immutable object by setting a value for the `rowPitch` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for rowPitch
    Returns:
      A modified copy or the `this` object

  - ### withArrayPitch

    public final VulkanSubresourceLayout withArrayPitch(long value)
    Copy the current immutable object by setting a value for the `arrayPitch` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for arrayPitch
    Returns:
      A modified copy or the `this` object

  - ### withDepthPitch

    public final VulkanSubresourceLayout withDepthPitch(long value)
    Copy the current immutable object by setting a value for the `depthPitch` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for depthPitch
    Returns:
      A modified copy or the `this` object

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `VulkanSubresourceLayout` that have equal attribute values.
    Overrides:
      `equals` in class `Object`
    Returns:
      `true` if `this` is equal to `another` instance

  - ### hashCode

    public int hashCode()
    Computes a hash code from attributes: `offset`, `size`, `rowPitch`, `arrayPitch`, `depthPitch`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

    public String toString()
    Prints the immutable value `VulkanSubresourceLayout` with attribute values.
    Overrides:
      `toString` in class `Object`
    Returns:
      A string representation of the value

  - ### copyOf

    public static VulkanSubresourceLayout copyOf(VulkanSubresourceLayoutType instance)
    Creates an immutable copy of a `VulkanSubresourceLayoutType` 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 for `VulkanSubresourceLayout`.

        VulkanSubresourceLayout.builder()
           .setOffset(long) // optional offset
           .setSize(long) // optional size
           .setRowPitch(long) // optional rowPitch
           .setArrayPitch(long) // optional arrayPitch
           .setDepthPitch(long) // optional depthPitch
           .build();

    Returns:
      A new VulkanSubresourceLayout builder