public class TextureLoader extends BinaryLoader<Texture,TexturableData>
TextureLoader uses
ImageIO to load the image and then converts it into
a usable ByteBuffer for the Texture.
When null is given as Dimension the dimensions
of the read image are used!| Modifier and Type | Field and Description |
|---|---|
protected Dimension |
dimension
Supplied dimensions (can be null)
|
protected BufferedImage |
image
Image read from the InputStream
|
| Constructor and Description |
|---|
TextureLoader(Dimension dimension)
Construct with dimension.
|
| Modifier and Type | Method and Description |
|---|---|
Texture |
fromCache(TexturableData value)
This method should construct the
TexturableData from a cached
value provided by the ResourceLoader |
Texture |
get()
This should used the information, generated during
loading and construct an Object.
|
Class<TexturableData> |
getCacheType()
Returns the Type of the Cache data.
|
void |
load(String name,
InputStream input)
This performs any type of loading and parsing.
|
cache, getCacheprotected BufferedImage image
protected Dimension dimension
public TextureLoader(Dimension dimension)
dimension - Dimension|nullpublic void load(String name, InputStream input) throws LoadingException
name - The name of the original fileinput - The input fileLoadingException - when the loading failspublic Texture get() throws Exception
Exceptionpublic Texture fromCache(TexturableData value) throws Exception
TexturableData from a cached
value provided by the ResourceLoaderfromCache in class BinaryLoader<Texture,TexturableData>value - CacheTexturableDataExceptionpublic Class<TexturableData> getCacheType()
getCacheType in class BinaryLoader<Texture,TexturableData>Copyright © 2014. All rights reserved.