| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.graphics.opengl.GLTextureLoader
public class GLTextureLoader
A class for loading image data for GLTexture objects.
| Field Summary | |
|---|---|
private static String | 
currentFileName
 | 
static String | 
DEFAULT_TEXTURE_RESOURCE_DIR
 | 
private static ResourcePool | 
pool
 | 
(package private) static ComponentColorModel | 
rgbaModel
 | 
(package private) static ComponentColorModel | 
rgbModel
 | 
| Constructor Summary | |
|---|---|
GLTextureLoader()
 | 
|
| Method Summary | |
|---|---|
static void | 
addTextureDirectory(String dir)
Adds the specified directory as one of the resource directories for GLTextures  | 
private static GLTexture | 
convertBufferedImage(BufferedImage image,
                     boolean rescale,
                     boolean flip,
                     String imageFile)
Converts a BufferedImage into a TextureImageData object with type/format and size that suits OpenGL  | 
static void | 
flipImageVertically(BufferedImage image)
Flips the supplied BufferedImage vertically.  | 
static GLTexture | 
getGLTexture(int texUnit,
             String resourceName)
Tries to get a GLTexture with the specified resource name, either from the cache or else from loading (and caching) an image from one of the texture directories.  | 
static GLTexture | 
getGLTexture(int texUnit,
             String resourceName,
             boolean flip,
             boolean rescale)
Tries to get a GLTexture with the specified resource name.  | 
static GLTexture | 
getGLTexture(String resourceName)
Tries to get a GLTexture with the specified resource name, either from the cache or else from loading (and caching) an image from one of the texture directories.  | 
private static int | 
getPowerOfTwo(int size)
 | 
static GLTexture | 
readFromFile(File file,
             boolean rescale,
             boolean flip)
Like readFromStream, where the InputStream is obtained from the specified file.  | 
static GLTexture | 
readFromFile(String fileName,
             boolean rescale,
             boolean flip)
Like readFromStream, where the InputStream is obtained from the specified resource file name (a OS path).  | 
static GLTexture | 
readFromResourceFile(Resources resources,
                     String resourceName,
                     boolean rescale,
                     boolean flip)
Like readFromStream, where the InputStream is obtained from the specified resource file.  | 
static GLTexture | 
readFromStream(InputStream is,
               boolean rescale,
               boolean flip,
               String imageFile)
Creates a new GLTexture by reading image data from the specified InputStream.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
private static ResourcePool pool
public static final String DEFAULT_TEXTURE_RESOURCE_DIR
private static String currentFileName
static ComponentColorModel rgbaModel
static ComponentColorModel rgbModel
| Constructor Detail | 
|---|
public GLTextureLoader()
| Method Detail | 
|---|
public static void addTextureDirectory(String dir)
public static GLTexture getGLTexture(String resourceName)
public static GLTexture getGLTexture(int texUnit,
                                     String resourceName)
public static GLTexture getGLTexture(int texUnit,
                                     String resourceName,
                                     boolean flip,
                                     boolean rescale)
public static GLTexture readFromFile(String fileName,
                                     boolean rescale,
                                     boolean flip)
                              throws IOException
IOException
public static GLTexture readFromFile(File file,
                                     boolean rescale,
                                     boolean flip)
                              throws IOException
IOException
public static GLTexture readFromResourceFile(Resources resources,
                                             String resourceName,
                                             boolean rescale,
                                             boolean flip)
                                      throws IOException
IOException
public static GLTexture readFromStream(InputStream is,
                                       boolean rescale,
                                       boolean flip,
                                       String imageFile)
                                throws IOException
IOExceptionpublic static void flipImageVertically(BufferedImage image)
private static GLTexture convertBufferedImage(BufferedImage image,
                                              boolean rescale,
                                              boolean flip,
                                              String imageFile)
private static int getPowerOfTwo(int size)
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||