Record Class TexturePixels

java.lang.Object
java.lang.Record
dev.turboism.sdk.cubism.model.TexturePixels

@CubismEditor(from="5.0.00") public record TexturePixels(int width, int height, int[] argb, double[] uvToPixel) extends Record
The ARGB pixel raster of the texture input an ArtMesh samples: the model image (PSD-layer composite) when the project has no texture atlas, or the atlas tile otherwise, together with the uvToPixel() affine that converts a mesh uv into raster coordinates. The mesh's uvs() are normalized over the host's cached-image canvas — a mipmap-aligned extent that can differ from the raster's own width x height — so u * width is only correct when uvToPixel is the identity. Apply it as px = m00*u + m01*v + m02, py = m10*u + m11*v + m12 and clamp to the raster. argb is row-major width * height in 0xAARRGGBB format.

Empty when the host cannot resolve the drawable's texture input or decode its pixels.

Every reviewed Editor release carries the texture-input chain this type describes, so the availability floor is the oldest reviewed release rather than the versions the first consumer needed.

  • Constructor Summary

    Constructors
    Constructor
    Description
    TexturePixels(int width, int height, int[] argb)
    Compatibility constructor for callers that predate uvToPixel(): assumes uvs index this raster normalized, which holds only for unpadded cached images.
    TexturePixels(int width, int height, int[] argb, double[] uvToPixel)
    Creates an instance of a TexturePixels record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int[]
    Returns the value of the argb 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.
    final String
    Returns a string representation of this record class.
    double[]
    Returns the value of the uvToPixel record component.
    void
    uvToPixel(double u, double v, double[] out)
    Maps one normalized mesh uv to raster pixel coordinates.
    int
    Returns the value of the width record component.

    Methods inherited from class java.lang.Object

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

    • TexturePixels

      public TexturePixels(int width, int height, int[] argb)
      Compatibility constructor for callers that predate uvToPixel(): assumes uvs index this raster normalized, which holds only for unpadded cached images.
    • TexturePixels

      public TexturePixels(int width, int height, int[] argb, double[] uvToPixel)
      Creates an instance of a TexturePixels record class.
      Parameters:
      width - the value for the width record component
      height - the value for the height record component
      argb - the value for the argb record component
      uvToPixel - the value for the uvToPixel record component
  • Method Details

    • uvToPixel

      public void uvToPixel(double u, double v, double[] out)
      Maps one normalized mesh uv to raster pixel coordinates. out receives (px, py); callers clamp to [0, width) x [0, height) — uv coordinates in the cached-image padding legitimately land outside the raster.
    • 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 '=='.
      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.
    • 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
    • argb

      public int[] argb()
      Returns the value of the argb record component.
      Returns:
      the value of the argb record component
    • uvToPixel

      public double[] uvToPixel()
      Returns the value of the uvToPixel record component.
      Returns:
      the value of the uvToPixel record component