- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanViewport
-
- All Implemented Interfaces:
VulkanViewportType
public final class VulkanViewport extends java.lang.Object implements VulkanViewportType
Structure specifying a viewport.- See Also:
- "VkViewport"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanViewport.Builder
Builds instances of typeVulkanViewport
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanViewport.Builder
builder()
Creates a builder forVulkanViewport
.static VulkanViewport
copyOf(VulkanViewportType instance)
Creates an immutable copy of aVulkanViewportType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanViewport
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:x
,y
,width
,height
,minDepth
,maxDepth
.float
height()
float
maxDepth()
float
minDepth()
static VulkanViewport
of(float x, float y, float width, float height, float minDepth, float maxDepth)
Construct a new immutableVulkanViewport
instance.java.lang.String
toString()
Prints the immutable valueVulkanViewport
with attribute values.float
width()
VulkanViewport
withHeight(float value)
Copy the current immutable object by setting a value for theheight
attribute.VulkanViewport
withMaxDepth(float value)
Copy the current immutable object by setting a value for themaxDepth
attribute.VulkanViewport
withMinDepth(float value)
Copy the current immutable object by setting a value for theminDepth
attribute.VulkanViewport
withWidth(float value)
Copy the current immutable object by setting a value for thewidth
attribute.VulkanViewport
withX(float value)
Copy the current immutable object by setting a value for thex
attribute.VulkanViewport
withY(float value)
Copy the current immutable object by setting a value for they
attribute.float
x()
float
y()
-
-
-
Method Detail
-
x
public float x()
- Specified by:
x
in interfaceVulkanViewportType
- Returns:
- the viewport’s upper left corner
-
y
public float y()
- Specified by:
y
in interfaceVulkanViewportType
- Returns:
- the viewport’s upper left corner
-
width
public float width()
- Specified by:
width
in interfaceVulkanViewportType
- Returns:
- the viewport’s width
-
height
public float height()
- Specified by:
height
in interfaceVulkanViewportType
- Returns:
- the viewport’s height
-
minDepth
public float minDepth()
- Specified by:
minDepth
in interfaceVulkanViewportType
- Returns:
- the viewport’s depth range (minimum)
-
maxDepth
public float maxDepth()
- Specified by:
maxDepth
in interfaceVulkanViewportType
- Returns:
- the viewport’s depth range (maximum)
-
withX
public final VulkanViewport withX(float value)
Copy the current immutable object by setting a value for thex
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for x- Returns:
- A modified copy of the
this
object
-
withY
public final VulkanViewport withY(float value)
Copy the current immutable object by setting a value for they
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for y- Returns:
- A modified copy of the
this
object
-
withWidth
public final VulkanViewport withWidth(float value)
Copy the current immutable object by setting a value for thewidth
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for width- Returns:
- A modified copy of the
this
object
-
withHeight
public final VulkanViewport withHeight(float value)
Copy the current immutable object by setting a value for theheight
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for height- Returns:
- A modified copy of the
this
object
-
withMinDepth
public final VulkanViewport withMinDepth(float value)
Copy the current immutable object by setting a value for theminDepth
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for minDepth- Returns:
- A modified copy of the
this
object
-
withMaxDepth
public final VulkanViewport withMaxDepth(float value)
Copy the current immutable object by setting a value for themaxDepth
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maxDepth- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofVulkanViewport
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:x
,y
,width
,height
,minDepth
,maxDepth
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanViewport
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanViewport of(float x, float y, float width, float height, float minDepth, float maxDepth)
Construct a new immutableVulkanViewport
instance.- Parameters:
x
- The value for thex
attributey
- The value for they
attributewidth
- The value for thewidth
attributeheight
- The value for theheight
attributeminDepth
- The value for theminDepth
attributemaxDepth
- The value for themaxDepth
attribute- Returns:
- An immutable VulkanViewport instance
-
copyOf
public static VulkanViewport copyOf(VulkanViewportType instance)
Creates an immutable copy of aVulkanViewportType
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 forVulkanViewport
.- Returns:
- A new VulkanViewport builder
-
-