com.threerings.opengl.gui
Class Image

java.lang.Object
  extended by com.threerings.opengl.gui.Image

public class Image
extends Object

Contains a texture and its dimensions.


Constructor Summary
Image(BufferedImage image)
          Creates an image from the supplied source AWT image.
Image(Texture2D texture)
          Creates an image from an existing texture.
Image(Texture2D texture, int width, int height)
          Creates an image from an existing texture.
Image(URL image)
          Creates an image from the supplied source URL.
 
Method Summary
static void configureTexture(Texture2D texture)
          Configures a texture for use as an image.
 int getHeight()
          Returns the height of this image.
 Texture2D getTexture(Renderer renderer)
          Returns a reference to the image texture, loading it if necessary.
 int getWidth()
          Returns the width of this image.
 void load(Renderer renderer, int format)
          Loads the image into a texture (this is called automatically when first used and need only be called manually if a specific format is desired).
 void render(Renderer renderer, int tx, int ty, Color4f color, float alpha)
          Renders this image at the specified coordinates in the specified color.
 void render(Renderer renderer, int tx, int ty, float alpha)
          Renders this image at the specified coordinates.
 void render(Renderer renderer, int tx, int ty, int twidth, int theight, float alpha)
          Renders this image at the specified coordinates, scaled to the specified size.
 void render(Renderer renderer, int sx, int sy, int swidth, int sheight, int tx, int ty, float alpha)
          Renders a region of this image at the specified coordinates.
 void render(Renderer renderer, int sx, int sy, int swidth, int sheight, int tx, int ty, int twidth, int theight, Color4f color, float alpha)
          Renders a region of this image at the specified coordinates, scaled to the specified size, in the specified color.
 void render(Renderer renderer, int sx, int sy, int swidth, int sheight, int tx, int ty, int twidth, int theight, float alpha)
          Renders a region of this image at the specified coordinates, scaled to the specified size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Image

public Image(URL image)
      throws IOException
Creates an image from the supplied source URL.

Throws:
IOException

Image

public Image(BufferedImage image)
Creates an image from the supplied source AWT image.


Image

public Image(Texture2D texture)
Creates an image from an existing texture.


Image

public Image(Texture2D texture,
             int width,
             int height)
Creates an image from an existing texture.

Method Detail

configureTexture

public static void configureTexture(Texture2D texture)
Configures a texture for use as an image.


getWidth

public int getWidth()
Returns the width of this image.


getHeight

public int getHeight()
Returns the height of this image.


getTexture

public Texture2D getTexture(Renderer renderer)
Returns a reference to the image texture, loading it if necessary.


render

public void render(Renderer renderer,
                   int tx,
                   int ty,
                   float alpha)
Renders this image at the specified coordinates.


render

public void render(Renderer renderer,
                   int tx,
                   int ty,
                   Color4f color,
                   float alpha)
Renders this image at the specified coordinates in the specified color.


render

public void render(Renderer renderer,
                   int tx,
                   int ty,
                   int twidth,
                   int theight,
                   float alpha)
Renders this image at the specified coordinates, scaled to the specified size.


render

public void render(Renderer renderer,
                   int sx,
                   int sy,
                   int swidth,
                   int sheight,
                   int tx,
                   int ty,
                   float alpha)
Renders a region of this image at the specified coordinates.


render

public void render(Renderer renderer,
                   int sx,
                   int sy,
                   int swidth,
                   int sheight,
                   int tx,
                   int ty,
                   int twidth,
                   int theight,
                   float alpha)
Renders a region of this image at the specified coordinates, scaled to the specified size.


render

public void render(Renderer renderer,
                   int sx,
                   int sy,
                   int swidth,
                   int sheight,
                   int tx,
                   int ty,
                   int twidth,
                   int theight,
                   Color4f color,
                   float alpha)
Renders a region of this image at the specified coordinates, scaled to the specified size, in the specified color.


load

public void load(Renderer renderer,
                 int format)
Loads the image into a texture (this is called automatically when first used and need only be called manually if a specific format is desired).

Parameters:
format - the internal format to use for the texture, or -1 to use the default.


Copyright © 2011. All Rights Reserved.