Record Class TextureAtlasLayoutPlan

java.lang.Object
java.lang.Record
dev.turboism.sdk.cubism.textureatlas.TextureAtlasLayoutPlan
Record Components:
pageWidth - final page width in pixels
pageHeight - final page height in pixels
pageCount - number of pages; one for a current-page result
pageNames - optional complete-atlas page names; empty when no names are requested
placements - final content rectangles; omitted current-page input IDs become overflow
scale - positive finite absolute uniform scale from source coordinates to final pixels; one for complete-atlas authoring, not a multiplier of the previous atlas transform

@CubismEditor({"5.2.03","5.3.02","5.3.03"}) public record TextureAtlasLayoutPlan(int pageWidth, int pageHeight, int pageCount, List<String> pageNames, List<TextureAtlasPlacement> placements, double scale) extends Record
Immutable layout result. Complete-atlas targets require every input; native current-page targets interpret omitted input IDs as overflow. Coordinates and dimensions are final pixels. The target's issued constraints, not this factory or constructor, determine which contract applies. A plan cannot turn a complete-atlas target into a current-page target.
  • Constructor Details

    • TextureAtlasLayoutPlan

      public TextureAtlasLayoutPlan(int pageWidth, int pageHeight, int pageCount, List<String> pageNames, List<TextureAtlasPlacement> placements)
      Retains the original complete-atlas constructor and its unit scale.
    • TextureAtlasLayoutPlan

      public TextureAtlasLayoutPlan(int pageWidth, int pageHeight, int pageCount, List<TextureAtlasPlacement> placements)
    • TextureAtlasLayoutPlan

      public TextureAtlasLayoutPlan(int pageWidth, int pageHeight, int pageCount, List<String> pageNames, List<TextureAtlasPlacement> placements, double scale)
      Creates an instance of a TextureAtlasLayoutPlan record class.
      Parameters:
      pageWidth - the value for the pageWidth record component
      pageHeight - the value for the pageHeight record component
      pageCount - the value for the pageCount record component
      pageNames - the value for the pageNames record component
      placements - the value for the placements record component
      scale - the value for the scale record component
  • Method Details

    • currentPage

      public static TextureAtlasLayoutPlan currentPage(int width, int height, List<TextureAtlasPlacement> placements, double scale)
      Creates a current-page result with its final uniform scale.
    • 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.
    • pageWidth

      public int pageWidth()
      Returns the value of the pageWidth record component.
      Returns:
      the value of the pageWidth record component
    • pageHeight

      public int pageHeight()
      Returns the value of the pageHeight record component.
      Returns:
      the value of the pageHeight record component
    • pageCount

      public int pageCount()
      Returns the value of the pageCount record component.
      Returns:
      the value of the pageCount record component
    • pageNames

      public List<String> pageNames()
      Returns the value of the pageNames record component.
      Returns:
      the value of the pageNames record component
    • placements

      public List<TextureAtlasPlacement> placements()
      Returns the value of the placements record component.
      Returns:
      the value of the placements record component
    • scale

      public double scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component