|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gzz.gfx.gl.MipzipLoader
A loader for Mipzip files: files of zipped, compressed mipmap levels.
RESPONSIBILITIES: Manage the combination of a single texture and a mipzip file, creating a "virtualized" texture of which better-quality versions can be loaded and discarded at will.
Field Summary | |
static boolean |
dbg
|
Constructor Summary | |
MipzipLoader(java.io.File mipzipFile)
Create a new MipzipLoader for the given mipzip file. |
Method Summary | |
int |
getLevelForBytes(int memory)
Get the level that uses at most given amount of memory. |
int |
getLevelForQuality(float quality)
Get the level that needs to be used to obtain the given quality. |
java.awt.Dimension |
getLevelSize(int level)
Get the size, in texels, of a texture level. |
int |
getMemory()
Get the amount of memory currently used. |
int |
getMemory(int level)
Get the amount of memory used if given level is loaded. |
int |
getNLevels()
Get the number of mipmap levels in this mipzip. |
float |
getQuality()
|
float |
getQuality(int level)
|
GL.Texture |
getTexture()
Get the OpenGL texture for this MipzipLoader. |
void |
loadToBaseLevelSynch(int level)
Load to the base level synchronously: no discards. |
void |
setGoalBaseLevel(int level,
Background bg,
float priority)
Set the base level goal for asynchronous loading. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static boolean dbg
Constructor Detail |
public MipzipLoader(java.io.File mipzipFile) throws java.io.IOException
Method Detail |
public void loadToBaseLevelSynch(int level) throws java.io.IOException
level
- The base level: the lowest-detail level to be loaded
java.io.IOException
public void setGoalBaseLevel(int level, Background bg, float priority)
level
- The base level to move towardsbg
- The background thread in which to run the part of loading
which does not need to be in the OpenGL thread.priority
- The priority to pass to the background thread and UpdateManagerpublic GL.Texture getTexture()
public int getMemory()
public int getMemory(int level)
public int getLevelForBytes(int memory)
public int getLevelForQuality(float quality)
public float getQuality()
public float getQuality(int level)
public int getNLevels()
public java.awt.Dimension getLevelSize(int level)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |