|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.opengl.util.packrect.RectanglePacker
public class RectanglePacker
Packs rectangles supplied by the user (typically representing image regions) into a larger backing store rectangle (typically representing a large texture). Supports automatic compaction of the space on the backing store, and automatic expansion of the backing store, when necessary.
Constructor Summary | |
---|---|
RectanglePacker(BackingStoreManager manager,
int initialWidth,
int initialHeight)
|
Method Summary | |
---|---|
void |
add(Rect rect)
Decides upon an (x, y) position for the given rectangle (leaving its width and height unchanged) and places it on the backing store. |
void |
clear()
Clears all Rects contained in this RectanglePacker. |
void |
compact()
Forces a compaction cycle, which typically results in allocating a new backing store and copying all entries to it. |
void |
dispose()
Disposes the backing store allocated by the BackingStoreManager. |
Object |
getBackingStore()
|
void |
remove(Rect rect)
Removes the given rectangle from this RectanglePacker. |
void |
setMaxSize(int maxWidth,
int maxHeight)
Sets up a maximum width and height for the backing store. |
float |
verticalFragmentationRatio()
Returns the vertical fragmentation ratio of this RectanglePacker. |
void |
visit(RectVisitor visitor)
Visits all Rects contained in this RectanglePacker. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RectanglePacker(BackingStoreManager manager, int initialWidth, int initialHeight)
Method Detail |
---|
public Object getBackingStore()
public void setMaxSize(int maxWidth, int maxHeight)
public void add(Rect rect) throws RuntimeException
BackingStoreManager.preExpand
does not clear enough space for the incoming rectangle, then
this method will throw a RuntimeException.
RuntimeException
public void remove(Rect rect)
public void visit(RectVisitor visitor)
public float verticalFragmentationRatio()
public void compact()
public void clear()
public void dispose()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |