com.threerings.opengl.renderer
Class Texture2D

java.lang.Object
  extended by com.threerings.opengl.renderer.Texture
      extended by com.threerings.opengl.renderer.Texture2D

public class Texture2D
extends Texture

A two-dimensional texture.


Constructor Summary
Texture2D(Renderer renderer)
          Creates a new texture.
Texture2D(Renderer renderer, boolean rectangle)
          Creates a new texture.
 
Method Summary
 void copySubImage(int level, int xoffset, int yoffset, int x, int y, int width, int height)
          Copies part of the read buffer to the texture.
 int getHeight()
          Returns the height of the texture.
 int getWidth()
          Returns the width of the texture.
 boolean isRectangle()
          Determines whether this texture is associated with the rectangle target.
 void setCompressedImage(int level, int format, int width, int height, boolean border, ByteBuffer data)
          Sets a single compressed level of this texture.
 void setImage(BufferedImage image, boolean premultiply, boolean mipmap, boolean compress)
          Sets this texture to the provided image.
 void setImage(BufferedImage image, boolean premultiply, boolean mipmap, boolean compress, boolean rescale)
          Sets this texture to the provided image.
 void setImage(int format, boolean border, BufferedImage image, boolean premultiply, boolean rescale, boolean mipmap)
          Sets this texture to the supplied image.
 void setImage(int level, int format, boolean border, BufferedImage image, boolean premultiply, boolean rescale)
          Sets a single mipmap level of this texture.
 void setImage(int format, int width, int height, boolean border, boolean mipmap)
          Sets this texture to an empty image with the specified format and dimensions.
 void setImage(int level, int format, int width, int height, boolean border)
          Sets a single mipmap level of this texture.
 void setImage(int level, int format, int width, int height, boolean border, int dformat, int dtype, ByteBuffer data)
          Sets a single mipmap level of this texture.
 void setSubimage(BufferedImage image, boolean premultiply, int x, int y, int width, int height)
          Sets part of the texture image.
 void setSubimage(int level, int x, int y, int width, int height, int dformat, int dtype, ByteBuffer data)
          Sets part of the texture image.
 
Methods inherited from class com.threerings.opengl.renderer.Texture
delete, generateMipmap, getDepth, getFormat, getId, getTarget, hasAlpha, isDepth, setBorderColor, setCompare, setCompareFunc, setCompareMode, setDepthMode, setFilters, setGenerateMipmaps, setMagFilter, setMaxAnisotropy, setMinFilter, setWrap, setWrap, setWrapR, setWrapS, setWrapT
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Texture2D

public Texture2D(Renderer renderer)
Creates a new texture.


Texture2D

public Texture2D(Renderer renderer,
                 boolean rectangle)
Creates a new texture.

Parameters:
rectangle - if true, create a texture for the rectangle target. Rectangular textures are not limited to square powers-of-two dimensions and use non-normalized texture coordinates.
Method Detail

isRectangle

public boolean isRectangle()
Determines whether this texture is associated with the rectangle target.


setImage

public void setImage(int format,
                     int width,
                     int height,
                     boolean border,
                     boolean mipmap)
Sets this texture to an empty image with the specified format and dimensions.

Parameters:
mipmap - if true, generate a complete mipmap chain.

setImage

public void setImage(int level,
                     int format,
                     int width,
                     int height,
                     boolean border)
Sets a single mipmap level of this texture.


setImage

public void setImage(int level,
                     int format,
                     int width,
                     int height,
                     boolean border,
                     int dformat,
                     int dtype,
                     ByteBuffer data)
Sets a single mipmap level of this texture.


setCompressedImage

public void setCompressedImage(int level,
                               int format,
                               int width,
                               int height,
                               boolean border,
                               ByteBuffer data)
Sets a single compressed level of this texture.


setImage

public void setImage(int format,
                     boolean border,
                     BufferedImage image,
                     boolean premultiply,
                     boolean rescale,
                     boolean mipmap)
Sets this texture to the supplied image.

Parameters:
mipmap - if true, generate a complete mipmap chain.

setImage

public void setImage(int level,
                     int format,
                     boolean border,
                     BufferedImage image,
                     boolean premultiply,
                     boolean rescale)
Sets a single mipmap level of this texture.


setImage

public void setImage(BufferedImage image,
                     boolean premultiply,
                     boolean mipmap,
                     boolean compress)
Sets this texture to the provided image.

Parameters:
premultiply - if true, premultiply the alpha values.
mipmap - if true, generate a complete set of mipmaps for the image.
compress - if true, compress the texture if possible.

setImage

public void setImage(BufferedImage image,
                     boolean premultiply,
                     boolean mipmap,
                     boolean compress,
                     boolean rescale)
Sets this texture to the provided image.

Parameters:
premultiply - if true, premultiply the alpha values.
mipmap - if true, generate a complete set of mipmaps for the image.
compress - if true, compress the texture if possible.
rescale - if true, rescale the image if it is not a power of two (and the video card doesn't support non-power-of-two textures). If false, place the unscaled image in the lower left part of the texture.

setSubimage

public void setSubimage(BufferedImage image,
                        boolean premultiply,
                        int x,
                        int y,
                        int width,
                        int height)
Sets part of the texture image.


setSubimage

public void setSubimage(int level,
                        int x,
                        int y,
                        int width,
                        int height,
                        int dformat,
                        int dtype,
                        ByteBuffer data)
Sets part of the texture image.


copySubImage

public void copySubImage(int level,
                         int xoffset,
                         int yoffset,
                         int x,
                         int y,
                         int width,
                         int height)
Copies part of the read buffer to the texture.


getWidth

public int getWidth()
Description copied from class: Texture
Returns the width of the texture.

Specified by:
getWidth in class Texture

getHeight

public int getHeight()
Description copied from class: Texture
Returns the height of the texture.

Specified by:
getHeight in class Texture


Copyright © 2011. All Rights Reserved.