|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsk.upjs.fontmapper.BinaryPacker
class BinaryPacker
Binary tree based texture packer. Subdivides 2D space to a binary tree of rectangles.
| Nested Class Summary | |
|---|---|
private class |
BinaryPacker.Node
Node of the binary tree that can specify space taken by a texture or contain more nodes. |
| Field Summary | |
|---|---|
private BinaryPacker.Node |
root_
Root node of the binary tree. |
private int |
spacing_
Spacing between textures in pixels. |
| Constructor Summary | |
|---|---|
BinaryPacker(java.awt.Dimension size,
int spacing)
Construct a BinaryPacker managing texture space with given size. |
|
| Method Summary | |
|---|---|
java.awt.Rectangle |
allocateSpace(java.awt.Dimension size)
Attempts to allocate space of specified size on the texture. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private BinaryPacker.Node root_
private int spacing_
| Constructor Detail |
|---|
public BinaryPacker(java.awt.Dimension size,
int spacing)
size - Size of texture space to manage.spacing - Spacing between textures in pixels.| Method Detail |
|---|
public java.awt.Rectangle allocateSpace(java.awt.Dimension size)
throws TextureAllocationException
TexturePacker
allocateSpace in interface TexturePackersize - Size of the space to allocate.
TextureAllocationException - if space could not be allocated.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||