org.dronus.gl.Texture Class Reference

Inheritance diagram for org.dronus.gl.Texture:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Texture (Image image)
 Texture (ByteBuffer pixels, int w, int h, int glPixelFormat)
 Texture (int w, int h, int format, boolean mipmap)
void render ()

Static Public Member Functions

static ByteBuffer getImageBuffer (Image image)

Public Attributes

int width
int height
float imagewidth
float imageheight

Protected Member Functions

 Texture ()
void setPixels (ByteBuffer pixels, int width, int height)
void finalize () throws Throwable

Protected Attributes

int level = 0
int internalformat = GL11.GL_RGBA
int border = 0
int format = GL11.GL_RGBA
int type = GL11.GL_UNSIGNED_BYTE
int texid

Detailed Description

encapsulates an OpenGL 2d texture map quite restricted.

the texture need to be created, sized, filled, updated and then used. this all is done by one convenient constructor

the pixel buffer is of mutable size, allowing of different level of details loaded at need.

the opengl specs are currently:

internalformat= GL_RGBA, format= GL_RGBA, type= GL_UNSIGNED_BYTE, filtering trilinear, automatic mipmapping.

Author:
Paul

Definition at line 37 of file Texture.java.


Constructor & Destructor Documentation

org.dronus.gl.Texture.Texture (  )  [protected]

Definition at line 48 of file Texture.java.

References org.dronus.gl.Texture.imageheight, org.dronus.gl.Texture.imagewidth, and org.dronus.gl.Texture.texid.

org.dronus.gl.Texture.Texture ( Image  image  ) 

creates a texture from an BufferedImage bitmap. This is quite slow as we don't know which maybe strange data format (depth, stride, packing..) the source image uses, so we convert it to an known format of gpu pleasure. thus the texture is of machine dependent resolution and so the image may only occupy a portion of it which is stored in imagewidth, imageheight whose should be used as texture coordinates to ensure the original proportions of image are preserved.

Parameters:
image to build the texture from

Definition at line 64 of file Texture.java.

References org.dronus.gl.Texture.getImageBuffer(), org.dronus.gl.Texture.height, org.dronus.gl.Texture.setPixels(), and org.dronus.gl.Texture.width.

Here is the call graph for this function:

org.dronus.gl.Texture.Texture ( ByteBuffer  pixels,
int  w,
int  h,
int  glPixelFormat 
)

Definition at line 94 of file Texture.java.

References org.dronus.gl.Texture.setPixels().

Here is the call graph for this function:

org.dronus.gl.Texture.Texture ( int  w,
int  h,
int  format,
boolean  mipmap 
)

Definition at line 100 of file Texture.java.

References org.dronus.gl.Texture.border, org.dronus.gl.Texture.height, org.dronus.gl.Texture.imageheight, org.dronus.gl.Texture.imagewidth, org.dronus.gl.Texture.internalformat, org.dronus.gl.Texture.level, org.dronus.gl.Texture.texid, org.dronus.gl.Texture.type, and org.dronus.gl.Texture.width.


Member Function Documentation

static ByteBuffer org.dronus.gl.Texture.getImageBuffer ( Image  image  )  [static]

Definition at line 70 of file Texture.java.

Referenced by org.dronus.gl.Texture.Texture().

Here is the caller graph for this function:

void org.dronus.gl.Texture.setPixels ( ByteBuffer  pixels,
int  width,
int  height 
) [protected]

Definition at line 122 of file Texture.java.

References org.dronus.gl.Texture.format, org.dronus.gl.Texture.level, org.dronus.gl.Texture.texid, and org.dronus.gl.Texture.type.

Referenced by org.hfbk.vid.VideoTexture.render(), and org.dronus.gl.Texture.Texture().

Here is the caller graph for this function:

void org.dronus.gl.Texture.render (  ) 

enables and binds this texture to gl.

Reimplemented in org.hfbk.vid.VideoTexture.

Definition at line 134 of file Texture.java.

References org.dronus.gl.Texture.texid.

Referenced by org.dronus.gl.GLFont.render(), org.hfbk.vis.visnode.VisVideoImage.renderSelf(), and org.hfbk.vis.visnode.VisImage.renderSelf().

Here is the caller graph for this function:

void org.dronus.gl.Texture.finalize (  )  throws Throwable [protected]

remove hardware pixel buffers.

Reimplemented in org.hfbk.vid.VideoTexture.

Definition at line 142 of file Texture.java.

References org.dronus.gl.Texture.texid.


Member Data Documentation

int org.dronus.gl.Texture.level = 0 [protected]

Definition at line 39 of file Texture.java.

Referenced by org.dronus.gl.Texture.setPixels(), and org.dronus.gl.Texture.Texture().

int org.dronus.gl.Texture.internalformat = GL11.GL_RGBA [protected]

Definition at line 39 of file Texture.java.

Referenced by org.dronus.gl.Texture.Texture().

int org.dronus.gl.Texture.border = 0 [protected]

Definition at line 39 of file Texture.java.

Referenced by org.dronus.gl.Texture.Texture().

int org.dronus.gl.Texture.format = GL11.GL_RGBA [protected]

Definition at line 40 of file Texture.java.

Referenced by org.dronus.gl.Texture.setPixels().

int org.dronus.gl.Texture.type = GL11.GL_UNSIGNED_BYTE [protected]

Definition at line 40 of file Texture.java.

Referenced by org.dronus.gl.Texture.setPixels(), and org.dronus.gl.Texture.Texture().

int org.dronus.gl.Texture.width

Definition at line 43 of file Texture.java.

Referenced by org.hfbk.vid.VideoTexture.render(), org.hfbk.vis.visnode.VisVideoImage.renderSelf(), org.hfbk.vis.visnode.VisVideo.renderSelf(), org.hfbk.vis.visnode.VisImage.renderSelf(), and org.dronus.gl.Texture.Texture().

int org.dronus.gl.Texture.height

Definition at line 43 of file Texture.java.

Referenced by org.hfbk.vid.VideoTexture.render(), org.hfbk.vis.visnode.VisVideoImage.renderSelf(), org.hfbk.vis.visnode.VisVideo.renderSelf(), org.hfbk.vis.visnode.VisImage.renderSelf(), and org.dronus.gl.Texture.Texture().

float org.dronus.gl.Texture.imagewidth

Definition at line 44 of file Texture.java.

Referenced by org.hfbk.vis.visnode.VisVideoImage.renderSelf(), org.hfbk.vis.visnode.VisVideo.renderSelf(), org.hfbk.vis.visnode.VisImage.renderSelf(), and org.dronus.gl.Texture.Texture().

float org.dronus.gl.Texture.imageheight

Definition at line 44 of file Texture.java.

Referenced by org.hfbk.vis.visnode.VisVideoImage.renderSelf(), org.hfbk.vis.visnode.VisVideo.renderSelf(), org.hfbk.vis.visnode.VisImage.renderSelf(), and org.dronus.gl.Texture.Texture().

int org.dronus.gl.Texture.texid [protected]

Definition at line 46 of file Texture.java.

Referenced by org.dronus.gl.Texture.finalize(), org.dronus.gl.Texture.render(), org.dronus.gl.Texture.setPixels(), and org.dronus.gl.Texture.Texture().


The documentation for this class was generated from the following file:
Generated on Tue Apr 7 17:57:37 2009 for visclient by  doxygen 1.5.1