|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.util.TextureManager
public final class TextureManager
TextureManager
provides static methods for building a
Texture
object. Typically, the information supplied is the
filename and the texture properties.
Field Summary | |
---|---|
static boolean |
COMPRESS_BY_DEFAULT
|
Method Summary | |
---|---|
static void |
addToCache(Texture t)
|
static void |
clearCache()
|
static void |
deleteTextureFromCard(Texture tex)
|
static void |
doTextureCleanup()
|
static Texture |
findCachedTexture(TextureKey textureKey)
|
static boolean |
hasAlpha(java.awt.Image image)
hasAlpha returns true if the specified image has
transparent pixels |
static boolean |
isCreateOnHeap()
|
static boolean |
isGreyscale(java.awt.Image image)
isGreyscale returns true if the specified image is greyscale. |
static Image |
loadImage(java.awt.Image image,
boolean flipImage)
loadImage sets the image data. |
static Image |
loadImage(java.lang.String fileName,
boolean flipped)
|
static Image |
loadImage(java.lang.String fileExt,
java.io.InputStream stream,
boolean flipped)
|
static Image |
loadImage(TextureKey key)
|
static Image |
loadImage(java.net.URL file,
boolean flipped)
|
static Texture |
loadTexture(java.awt.Image image,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter,
boolean flipped)
|
static Texture |
loadTexture(java.awt.Image image,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter,
float anisoLevel,
boolean flipped)
|
static Texture |
loadTexture(java.awt.Image image,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter,
float anisoLevel,
Image.Format imageFormat,
boolean flipped)
|
static Texture |
loadTexture(java.lang.String file,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter)
loadTexture loads a new texture defined by the parameter
string. |
static Texture |
loadTexture(java.lang.String file,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter,
float anisoLevel,
boolean flipped)
loadTexture loads a new texture defined by the parameter
string. |
static Texture |
loadTexture(java.lang.String file,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter,
Image.Format imageType,
float anisoLevel,
boolean flipped)
loadTexture loads a new texture defined by the parameter
string. |
static Texture |
loadTexture(TextureKey tkey)
|
static Texture |
loadTexture(Texture texture,
TextureKey tkey)
|
static Texture |
loadTexture(Texture texture,
TextureKey tkey,
Image imageData,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter,
float anisoLevel)
|
static Texture |
loadTexture(java.net.URL file)
loadTexture loads a new texture defined by the parameter
url. |
static Texture |
loadTexture(java.net.URL file,
boolean flipped)
loadTexture loads a new texture defined by the parameter
url. |
static Texture |
loadTexture(java.net.URL file,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter)
loadTexture loads a new texture defined by the parameter
url. |
static Texture |
loadTexture(java.net.URL file,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter,
float anisoLevel,
boolean flipped)
|
static Texture |
loadTexture(java.net.URL file,
Texture.MinificationFilter minFilter,
Texture.MagnificationFilter magFilter,
Image.Format imageType,
float anisoLevel,
boolean flipped)
loadTexture loads a new texture defined by the parameter
url. |
static void |
preloadCache(Renderer r)
|
static void |
registerForCleanup(TextureKey textureKey,
int textureId)
|
static void |
registerHandler(java.lang.String format,
ImageLoader handler)
Register an ImageLoader to handle all files with a specific extention. |
static boolean |
releaseTexture(Texture texture)
|
static boolean |
releaseTexture(TextureKey tKey)
|
static void |
setCreateOnHeap(boolean createOnHeap)
|
static void |
unregisterHandler(java.lang.String format)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean COMPRESS_BY_DEFAULT
Method Detail |
---|
public static Texture loadTexture(java.lang.String file, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter)
loadTexture
loads a new texture defined by the parameter
string. Filter parameters are used to define the filtering of the
texture. If there is an error loading the file, null is returned.
file
- the filename of the texture image.minFilter
- the filter for the near values.magFilter
- the filter for the far values.
public static Texture loadTexture(java.lang.String file, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter, float anisoLevel, boolean flipped)
loadTexture
loads a new texture defined by the parameter
string. Filter parameters are used to define the filtering of the
texture. If there is an error loading the file, null is returned.
file
- the filename of the texture image.minFilter
- the filter for the near values.magFilter
- the filter for the far values.anisoLevel
- the aniso level for this textureflipped
- If true, the images Y values are flipped.
public static Texture loadTexture(java.lang.String file, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter, Image.Format imageType, float anisoLevel, boolean flipped)
loadTexture
loads a new texture defined by the parameter
string. Filter parameters are used to define the filtering of the
texture. If there is an error loading the file, null is returned.
file
- the filename of the texture image.minFilter
- the filter for the near values.magFilter
- the filter for the far values.imageType
- the type to use for image dataanisoLevel
- the aniso level for this textureflipped
- If true, the images Y values are flipped.
public static Texture loadTexture(java.net.URL file)
loadTexture
loads a new texture defined by the parameter
url. If there is an error loading the file, null is returned.
file
- the url of the texture image.flipped
- If true, the images Y values are flipped.
public static Texture loadTexture(java.net.URL file, boolean flipped)
loadTexture
loads a new texture defined by the parameter
url. If there is an error loading the file, null is returned.
file
- the url of the texture image.flipped
- If true, the images Y values are flipped.
public static Texture loadTexture(java.net.URL file, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter)
loadTexture
loads a new texture defined by the parameter
url. Filter parameters are used to define the filtering of the texture.
If there is an error loading the file, null is returned.
file
- the url of the texture image.minFilter
- the filter for the near values.magFilter
- the filter for the far values.
public static Texture loadTexture(java.net.URL file, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter, float anisoLevel, boolean flipped)
public static Texture loadTexture(java.net.URL file, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter, Image.Format imageType, float anisoLevel, boolean flipped)
loadTexture
loads a new texture defined by the parameter
url. Filter parameters are used to define the filtering of the texture.
If there is an error loading the file, null is returned.
file
- the url of the texture image.minFilter
- the filter for the near values.magFilter
- the filter for the far values.imageType
- the image type to use. if Image.Format.Guess, the type is
determined by jME. If S3TC/DXT is available we use that. if
Image.Format.GuessNoCompression, the type is determined by jME
without using S3TC, even if available. See
com.jme.image.Image.Format for possible types.flipped
- If true, the images Y values are flipped.
Image.Format
public static Texture loadTexture(TextureKey tkey)
public static Texture loadTexture(Texture texture, TextureKey tkey)
public static Texture loadTexture(Texture texture, TextureKey tkey, Image imageData, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter, float anisoLevel)
public static void addToCache(Texture t)
public static Texture loadTexture(java.awt.Image image, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter, boolean flipped)
public static Texture loadTexture(java.awt.Image image, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter, float anisoLevel, boolean flipped)
public static Texture loadTexture(java.awt.Image image, Texture.MinificationFilter minFilter, Texture.MagnificationFilter magFilter, float anisoLevel, Image.Format imageFormat, boolean flipped)
public static Image loadImage(TextureKey key)
public static Image loadImage(java.net.URL file, boolean flipped)
public static Image loadImage(java.lang.String fileName, boolean flipped)
public static Image loadImage(java.lang.String fileExt, java.io.InputStream stream, boolean flipped)
public static Image loadImage(java.awt.Image image, boolean flipImage)
loadImage
sets the image data. It will set the jme Image's
format to RGB8 or RGBA8 or Alpha8 depending on the incoming java Image.
(greyscale will be sent back as Alpha8)
image
- The image data.flipImage
- if true will flip the image's y values.
public static boolean hasAlpha(java.awt.Image image)
hasAlpha
returns true if the specified image has
transparent pixels
image
- Image to check
public static boolean isGreyscale(java.awt.Image image)
isGreyscale
returns true if the specified image is greyscale.
image
- Image to check
public static boolean releaseTexture(Texture texture)
public static boolean releaseTexture(TextureKey tKey)
public static void clearCache()
public static void registerHandler(java.lang.String format, ImageLoader handler)
format
- The file extention for the format this ImageLoader will
handle. Make sure to include the dot (eg. ".BMP"). This value
is case insensitive (".Bmp" will register for ".BMP", ".bmp",
etc.)handler
- public static void unregisterHandler(java.lang.String format)
public static void registerForCleanup(TextureKey textureKey, int textureId)
public static void doTextureCleanup()
public static void deleteTextureFromCard(Texture tex)
public static Texture findCachedTexture(TextureKey textureKey)
public static void preloadCache(Renderer r)
public static void setCreateOnHeap(boolean createOnHeap)
public static boolean isCreateOnHeap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |