org.newdawn.slick.util
Class BufferedImageUtil

java.lang.Object
  extended by org.newdawn.slick.util.BufferedImageUtil

public class BufferedImageUtil
extends java.lang.Object

This is a utility class that allows you to convert a BufferedImage into a texture.

Author:
James Chambers (Jimmy), Jeremy Adams (elias_naur), Kevin Glass (kevglass)

Constructor Summary
BufferedImageUtil()
           
 
Method Summary
static Texture getTexture(java.lang.String resourceName, java.awt.image.BufferedImage resourceImage)
          Load a texture
static Texture getTexture(java.lang.String resourceName, java.awt.image.BufferedImage resourceImage, int filter)
          Load a texture
static Texture getTexture(java.lang.String resourceName, java.awt.image.BufferedImage resourceimage, int target, int dstPixelFormat, int minFilter, int magFilter)
          Load a texture into OpenGL from a BufferedImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedImageUtil

public BufferedImageUtil()
Method Detail

getTexture

public static Texture getTexture(java.lang.String resourceName,
                                 java.awt.image.BufferedImage resourceImage)
                          throws java.io.IOException
Load a texture

Parameters:
resourceName - The location of the resource to load
resourceImage - The BufferedImage we are converting
Returns:
The loaded texture
Throws:
java.io.IOException - Indicates a failure to access the resource

getTexture

public static Texture getTexture(java.lang.String resourceName,
                                 java.awt.image.BufferedImage resourceImage,
                                 int filter)
                          throws java.io.IOException
Load a texture

Parameters:
resourceName - The location of the resource to load
resourceImage - The BufferedImage we are converting
Returns:
The loaded texture
Throws:
java.io.IOException - Indicates a failure to access the resource

getTexture

public static Texture getTexture(java.lang.String resourceName,
                                 java.awt.image.BufferedImage resourceimage,
                                 int target,
                                 int dstPixelFormat,
                                 int minFilter,
                                 int magFilter)
                          throws java.io.IOException
Load a texture into OpenGL from a BufferedImage

Parameters:
resourceName - The location of the resource to load
resourceimage - The BufferedImage we are converting
target - The GL target to load the texture against
dstPixelFormat - The pixel format of the screen
minFilter - The minimising filter
magFilter - The magnification filter
Returns:
The loaded texture
Throws:
java.io.IOException - Indicates a failure to access the resource


Copyright © 2006 New Dawn Software. All Rights Reserved.