Interface TextureAtlasLayoutPlanner
- All Known Subinterfaces:
TextureAtlasPolygonLayoutPlanner
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Framework contract for a texture-atlas layout algorithm.
Algorithms registered through TextureAtlasLayoutAlgorithmRegistry become
selectable in the native automatic-layout dialog and receive the user's parallel
search flag through plan(List, TextureAtlasLayoutConstraints, boolean).
Implementations that do not support parallel search simply inherit the two-argument
fallback and ignore the flag.
-
Method Summary
Modifier and TypeMethodDescriptionplan(List<TextureAtlasLayoutItem> items, TextureAtlasLayoutConstraints constraints) Computes a layout plan foritemsunderconstraints.default TextureAtlasLayoutPlanplan(List<TextureAtlasLayoutItem> items, TextureAtlasLayoutConstraints constraints, boolean parallel) Parallel variant.default booleanWhether this planner accepts complete-atlas rectangle requests without current-page options.
-
Method Details
-
plan
TextureAtlasLayoutPlan plan(List<TextureAtlasLayoutItem> items, TextureAtlasLayoutConstraints constraints) Computes a layout plan foritemsunderconstraints.- Parameters:
items- the images to placeconstraints- the atlas size, padding, and rotation/scaling limits- Returns:
- a layout plan accepted by
TextureAtlasLayoutService.apply(dev.turboism.sdk.cubism.textureatlas.TextureAtlasLayoutTarget, dev.turboism.sdk.cubism.textureatlas.TextureAtlasLayoutPlan) - Throws:
TextureAtlasPackingException- when the issued page cannot fit the inputs; complete-atlas clients can try larger pages or divide folders for recoverable reasons
-
supportsCompleteAtlas
default boolean supportsCompleteAtlas()Whether this planner accepts complete-atlas rectangle requests without current-page options. Current-page-only implementations return false so independent authoring tools can disable them. -
plan
default TextureAtlasLayoutPlan plan(List<TextureAtlasLayoutItem> items, TextureAtlasLayoutConstraints constraints, boolean parallel) Parallel variant. The default ignoresparalleland delegates to the serialplan(List, TextureAtlasLayoutConstraints); algorithms that can parallelize their search should override this and preserve result determinism.
-