Package dev.turboism.sdk.cubism.model
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
ConstructorsConstructorDescriptionTexturePixels(int width, int height, int[] argb) Compatibility constructor for callers that predateuvToPixel(): 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 aTexturePixelsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionint[]argb()Returns the value of theargbrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.final StringtoString()Returns a string representation of this record class.double[]Returns the value of theuvToPixelrecord component.voiduvToPixel(double u, double v, double[] out) Maps one normalized mesh uv to raster pixel coordinates.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
TexturePixels
public TexturePixels(int width, int height, int[] argb) Compatibility constructor for callers that predateuvToPixel(): 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 aTexturePixelsrecord class.- Parameters:
width- the value for thewidthrecord componentheight- the value for theheightrecord componentargb- the value for theargbrecord componentuvToPixel- the value for theuvToPixelrecord component
-
-
Method Details
-
uvToPixel
public void uvToPixel(double u, double v, double[] out) Maps one normalized mesh uv to raster pixel coordinates.outreceives(px, py); callers clamp to[0, width) x [0, height)— uv coordinates in the cached-image padding legitimately land outside the raster. -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
argb
public int[] argb()Returns the value of theargbrecord component.- Returns:
- the value of the
argbrecord component
-
uvToPixel
public double[] uvToPixel()Returns the value of theuvToPixelrecord component.- Returns:
- the value of the
uvToPixelrecord component
-