@Environment(value=CLIENT) public class TextureStitcher extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
TextureStitcher.Holder |
static class |
TextureStitcher.Slot |
static interface |
TextureStitcher.SpriteConsumer |
Modifier and Type | Field and Description |
---|---|
private static Comparator<TextureStitcher.Holder> |
COMPARATOR |
private int |
height |
private Set<TextureStitcher.Holder> |
holders |
private int |
maxHeight |
private int |
maxWidth |
private int |
mipLevel |
private List<TextureStitcher.Slot> |
slots |
private int |
width |
Constructor and Description |
---|
TextureStitcher(int maxWidth,
int maxHeight,
int mipLevel) |
Modifier and Type | Method and Description |
---|---|
void |
add(Sprite.Info info) |
private static int |
applyMipLevel(int size,
int mipLevel) |
private boolean |
fit(TextureStitcher.Holder holder) |
int |
getHeight() |
void |
getStitchedSprites(TextureStitcher.SpriteConsumer spriteConsumer) |
int |
getWidth() |
private boolean |
growAndFit(TextureStitcher.Holder holder) |
void |
stitch() |
private static final Comparator<TextureStitcher.Holder> COMPARATOR
private final int mipLevel
private final Set<TextureStitcher.Holder> holders
private final List<TextureStitcher.Slot> slots
private int width
private int height
private final int maxWidth
private final int maxHeight
public TextureStitcher(int maxWidth, int maxHeight, int mipLevel)
public int getWidth()
public int getHeight()
public void add(Sprite.Info info)
public void stitch()
public void getStitchedSprites(TextureStitcher.SpriteConsumer spriteConsumer)
private static int applyMipLevel(int size, int mipLevel)
private boolean fit(TextureStitcher.Holder holder)
private boolean growAndFit(TextureStitcher.Holder holder)