Record Class Tex2d

java.lang.Object
java.lang.Record
dev.pfaff.altargui.types.Tex2d

public record Tex2d(float u1, float v1, float u2, float v2) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Tex2d
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tex2d(float u1, float v1, float u2, float v2)
    Creates an instance of a Tex2d record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    static Tex2d
    fromPixelCoords(int u1_i, int v1_i, int u2_i, int v2_i, int textureWidth, int textureHeight)
     
    static Tex2d
    fromPixelExtent(int u, int v, int uExtent, int vExtent, int textureWidth, int textureHeight)
     
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.
    float
    u1()
    Returns the value of the u1 record component.
    float
    u2()
    Returns the value of the u2 record component.
    float
    v1()
    Returns the value of the v1 record component.
    float
    v2()
    Returns the value of the v2 record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • WHOLE

      public static final Tex2d WHOLE
  • Constructor Details

    • Tex2d

      public Tex2d(float u1, float v1, float u2, float v2)
      Creates an instance of a Tex2d record class.
      Parameters:
      u1 - the value for the u1 record component
      v1 - the value for the v1 record component
      u2 - the value for the u2 record component
      v2 - the value for the v2 record component
  • Method Details

    • fromPixelCoords

      public static Tex2d fromPixelCoords(int u1_i, int v1_i, int u2_i, int v2_i, int textureWidth, int textureHeight)
    • fromPixelExtent

      public static Tex2d fromPixelExtent(int u, int v, int uExtent, int vExtent, int textureWidth, int textureHeight)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • u1

      public float u1()
      Returns the value of the u1 record component.
      Returns:
      the value of the u1 record component
    • v1

      public float v1()
      Returns the value of the v1 record component.
      Returns:
      the value of the v1 record component
    • u2

      public float u2()
      Returns the value of the u2 record component.
      Returns:
      the value of the u2 record component
    • v2

      public float v2()
      Returns the value of the v2 record component.
      Returns:
      the value of the v2 record component