Record Class MeshImage.Awt

java.lang.Object
java.lang.Record
io.github.toxicity188.javamesh.MeshImage.Awt
Record Components:
image - wrapped source image
All Implemented Interfaces:
MeshImage
Enclosing interface:
MeshImage

public static record MeshImage.Awt(@NotNull BufferedImage image) extends Record implements MeshImage
BufferedImage-backed MeshImage implementation.
Since:
0.0.1
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.github.toxicity188.javamesh.MeshImage

    MeshImage.Awt
  • Field Summary

    Fields inherited from interface io.github.toxicity188.javamesh.MeshImage

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Awt(@NotNull BufferedImage image)
    Creates an instance of a Awt record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the image height in pixels.
    @NotNull BufferedImage
    Returns the value of the image record component.
    int
    rgb(int x, int z)
    Returns the ARGB color of a texture pixel.
    final String
    Returns a string representation of this record class.
    int
    Returns the image width in pixels.

    Methods inherited from class java.lang.Object

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

    • Awt

      public Awt(@NotNull @NotNull BufferedImage image)
      Creates an instance of a Awt record class.
      Parameters:
      image - the value for the image record component
  • Method Details

    • height

      public int height()
      Description copied from interface: MeshImage
      Returns the image height in pixels.
      Specified by:
      height in interface MeshImage
      Returns:
      texture height in pixels
    • width

      public int width()
      Description copied from interface: MeshImage
      Returns the image width in pixels.
      Specified by:
      width in interface MeshImage
      Returns:
      texture width in pixels
    • rgb

      public int rgb(int x, int z)
      Description copied from interface: MeshImage
      Returns the ARGB color of a texture pixel.
      Specified by:
      rgb in interface MeshImage
      Parameters:
      x - horizontal pixel coordinate
      z - vertical pixel coordinate
      Returns:
      the packed ARGB color value
    • 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 Objects::equals(Object,Object).
      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.
    • image

      @NotNull public @NotNull BufferedImage image()
      Returns the value of the image record component.
      Returns:
      the value of the image record component