Class VulkanViewport

java.lang.Object
com.io7m.jcoronado.api.VulkanViewport
All Implemented Interfaces:
VulkanViewportType

public final class VulkanViewport extends Object implements VulkanViewportType
Structure specifying a viewport.
See Also:
  • "VkViewport"
  • Method Details

    • x

      public float x()
      Specified by:
      x in interface VulkanViewportType
      Returns:
      the viewport’s upper left corner
    • y

      public float y()
      Specified by:
      y in interface VulkanViewportType
      Returns:
      the viewport’s upper left corner
    • width

      public float width()
      Specified by:
      width in interface VulkanViewportType
      Returns:
      the viewport’s width
    • height

      public float height()
      Specified by:
      height in interface VulkanViewportType
      Returns:
      the viewport’s height
    • minDepth

      public float minDepth()
      Specified by:
      minDepth in interface VulkanViewportType
      Returns:
      the viewport’s depth range (minimum)
    • maxDepth

      public float maxDepth()
      Specified by:
      maxDepth in interface VulkanViewportType
      Returns:
      the viewport’s depth range (maximum)
    • withX

      public final VulkanViewport withX(float value)
      Copy the current immutable object by setting a value for the x attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for x
      Returns:
      A modified copy or the this object
    • withY

      public final VulkanViewport withY(float value)
      Copy the current immutable object by setting a value for the y attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for y
      Returns:
      A modified copy or the this object
    • withWidth

      public final VulkanViewport withWidth(float value)
      Copy the current immutable object by setting a value for the width attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for width
      Returns:
      A modified copy or the this object
    • withHeight

      public final VulkanViewport withHeight(float value)
      Copy the current immutable object by setting a value for the height attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for height
      Returns:
      A modified copy or the this object
    • withMinDepth

      public final VulkanViewport withMinDepth(float value)
      Copy the current immutable object by setting a value for the minDepth attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for minDepth
      Returns:
      A modified copy or the this object
    • withMaxDepth

      public final VulkanViewport withMaxDepth(float value)
      Copy the current immutable object by setting a value for the maxDepth attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maxDepth
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of VulkanViewport 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: x, y, width, height, minDepth, maxDepth.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static VulkanViewport copyOf(VulkanViewportType instance)
      Creates an immutable copy of a VulkanViewportType 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 VulkanViewport instance
    • builder

      public static VulkanViewport.Builder builder()
      Creates a builder for VulkanViewport.
      VulkanViewport.builder()
         .setX(float) // optional x
         .setY(float) // optional y
         .setWidth(float) // optional width
         .setHeight(float) // optional height
         .setMinDepth(float) // optional minDepth
         .setMaxDepth(float) // optional maxDepth
         .build();
      
      Returns:
      A new VulkanViewport builder