Record Class Cover

java.lang.Object
java.lang.Record
lol.trq.orpheus.cover.Cover
Record Components:
key - identifies the image; the same key always means the same pixels
width - width in pixels
height - height in pixels
rgba - four bytes per pixel in R, G, B, A order, rows top to bottom, alpha not premultiplied. This is the cached array: do not modify it
average - the average colour as 0xRRGGBB
palette - up to five dominant colours as 0xRRGGBB, most common first. Do not modify

public record Cover(String key, int width, int height, byte[] rgba, int average, int[] palette) extends Record
A decoded cover image.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Cover(String key, int width, int height, byte[] rgba, int average, int[] palette)
    Creates an instance of a Cover record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the average record component.
    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 value of the height record component.
    key()
    Returns the value of the key record component.
    int[]
    Returns the value of the palette record component.
    byte[]
    Returns the value of the rgba record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the width record component.

    Methods inherited from class Object

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

    • Cover

      public Cover(String key, int width, int height, byte[] rgba, int average, int[] palette)
      Creates an instance of a Cover record class.
      Parameters:
      key - the value for the key record component
      width - the value for the width record component
      height - the value for the height record component
      rgba - the value for the rgba record component
      average - the value for the average record component
      palette - the value for the palette record component
  • 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.
    • key

      public String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • rgba

      public byte[] rgba()
      Returns the value of the rgba record component.
      Returns:
      the value of the rgba record component
    • average

      public int average()
      Returns the value of the average record component.
      Returns:
      the value of the average record component
    • palette

      public int[] palette()
      Returns the value of the palette record component.
      Returns:
      the value of the palette record component