Record Class Image.State

java.lang.Object
java.lang.Record
org.inspirenxe.strata.api.control.display.Image.State
Record Components:
sprite - the sprite, or null while something else is shown
visual - the visual, or null while something else is shown
tint - the tint
imageWidth - the image width
imageHeight - the image height
scaling - the scaling; never null
pixels - the pixel buffer, or null while something else is shown
Enclosing interface:
Image

public static record Image.State(SpriteId sprite, Visual visual, int tint, float imageWidth, float imageHeight, Image.Scaling scaling, PixelBuffer pixels) extends Record
An image's own state in a ComponentSnapshot.
  • Constructor Details

    • State

      public State(SpriteId sprite, Visual visual, int tint, float imageWidth, float imageHeight, Image.Scaling scaling, PixelBuffer pixels)
      Checks that at most one of the sprite, the visual and the pixels is set, and the scaling.
      Throws:
      IllegalArgumentException - if more than one of the sprite, the visual and the pixels is set
    • State

      public State(SpriteId sprite, Visual visual, int tint, float imageWidth, float imageHeight, Image.Scaling scaling)
      Creates the state of an image that shows no pixel buffer.
      Parameters:
      sprite - the sprite, or null
      visual - the visual, or null
      tint - the tint
      imageWidth - the image width
      imageHeight - the image height
      scaling - the scaling
      Throws:
      IllegalArgumentException - if both the sprite and the visual are set
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • sprite

      public SpriteId sprite()
      Returns the value of the sprite record component.
      Returns:
      the value of the sprite record component
    • visual

      public Visual visual()
      Returns the value of the visual record component.
      Returns:
      the value of the visual record component
    • tint

      public int tint()
      Returns the value of the tint record component.
      Returns:
      the value of the tint record component
    • imageWidth

      public float imageWidth()
      Returns the value of the imageWidth record component.
      Returns:
      the value of the imageWidth record component
    • imageHeight

      public float imageHeight()
      Returns the value of the imageHeight record component.
      Returns:
      the value of the imageHeight record component
    • scaling

      public Image.Scaling scaling()
      Returns the value of the scaling record component.
      Returns:
      the value of the scaling record component
    • pixels

      public PixelBuffer pixels()
      Returns the value of the pixels record component.
      Returns:
      the value of the pixels record component