|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ryanm.glvisualiser.imp.TextureUtils
public class TextureUtils
Utility class for loading and manipulating textures
| Constructor Summary | |
|---|---|
TextureUtils()
|
|
| Method Summary | |
|---|---|
static int |
createRGBATexture(javax.media.opengl.GLAutoDrawable drawable,
java.nio.ByteBuffer pixels,
int width,
int height,
boolean mipmap)
Create RGBA OpenGL texture. |
static int |
createRGBTexture(javax.media.opengl.GLAutoDrawable drawable,
java.nio.ByteBuffer pixels,
int width,
int height,
boolean mipmap)
Create RGB OpenGL texture. |
static void |
destroyTexture(javax.media.opengl.GL gl,
int handle)
Destroy texture. |
static java.net.URL |
getResource(java.lang.String fileName)
Get resource URL. |
static int[] |
grabPixels(java.awt.image.BufferedImage bufImage)
Get image pixels. |
static java.awt.image.BufferedImage |
loadImage(java.lang.String filePath)
Load image file. |
static int |
loadTexture(java.io.File imageFile,
boolean hasAlpha,
boolean mipmap,
javax.media.opengl.GLAutoDrawable drawable)
Simple texture load helper. |
static java.nio.ByteBuffer |
simpleImageConvert(int[] pixels,
int width,
int height,
boolean hasAlpha)
Convert image to OpenGL ready format for simple RGB/RGBA cases only! |
static int |
textureFromImage(java.awt.image.BufferedImage image,
boolean hasAlpha,
boolean mipmap,
javax.media.opengl.GLAutoDrawable drawable)
Simple texture creator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextureUtils()
| Method Detail |
|---|
public static int loadTexture(java.io.File imageFile,
boolean hasAlpha,
boolean mipmap,
javax.media.opengl.GLAutoDrawable drawable)
throws java.io.IOException
imageFile - the image filehasAlpha - Use alpha switchmipmap - Build mipmap switchdrawable -
java.io.IOException
public static int textureFromImage(java.awt.image.BufferedImage image,
boolean hasAlpha,
boolean mipmap,
javax.media.opengl.GLAutoDrawable drawable)
image - the imagehasAlpha - Use alpha switchmipmap - Build mipmap switchdrawable -
public static void destroyTexture(javax.media.opengl.GL gl,
int handle)
gl - handle - Texture handlepublic static java.awt.image.BufferedImage loadImage(java.lang.String filePath)
filePath - Path to file
public static java.net.URL getResource(java.lang.String fileName)
fileName - Name of file to load
public static int[] grabPixels(java.awt.image.BufferedImage bufImage)
bufImage - Buffered image
public static java.nio.ByteBuffer simpleImageConvert(int[] pixels,
int width,
int height,
boolean hasAlpha)
pixels - int array of pixelswidth - Width of imageheight - Height of imagehasAlpha - Image have alpha
public static int createRGBATexture(javax.media.opengl.GLAutoDrawable drawable,
java.nio.ByteBuffer pixels,
int width,
int height,
boolean mipmap)
drawable - pixels - ByteBuffer containing pixelswidth - Width of textureheight - Height of texturemipmap - Mipmap generation switch
public static int createRGBTexture(javax.media.opengl.GLAutoDrawable drawable,
java.nio.ByteBuffer pixels,
int width,
int height,
boolean mipmap)
drawable - pixels - ByteBuffer containing pixelswidth - Width of textureheight - Height of texturemipmap - Mipmap generation switch
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||