|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.j3d.renderer.java3d.texture.TextureCreateUtils
Convenience class with a collection of useful utility methods taking an image and turning it into a Java3D texture object.
| Constructor Summary | |
TextureCreateUtils()
Default constructor. |
|
| Method Summary | |
javax.media.j3d.ImageComponent2D |
create2DImageComponent(java.lang.Object content)
Load the image component from the given object type. |
javax.media.j3d.Texture2D |
createTexture2D(java.awt.image.RenderedImage img)
Given the image, create a texture object from it, resizing the image to up to a power of 2 if needed. |
int |
getTextureFormat(javax.media.j3d.ImageComponent comp)
From the image component format, generate the appropriate texture format. |
int |
nearestPowerTwo(int val,
boolean scaleUp)
Determine the nearest power of two value for a given argument. |
java.awt.image.RenderedImage |
scaleTexture(java.awt.image.RenderedImage ri,
int newWidth,
int newHeight)
Scale a texture to a new size. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TextureCreateUtils()
| Method Detail |
public javax.media.j3d.Texture2D createTexture2D(java.awt.image.RenderedImage img)
img - The source image to work with
public int getTextureFormat(javax.media.j3d.ImageComponent comp)
comp - The image component to get the value from
public java.awt.image.RenderedImage scaleTexture(java.awt.image.RenderedImage ri,
int newWidth,
int newHeight)
ri - The texture to scalenewWidth - The new widthnewHeight - The new heightpublic javax.media.j3d.ImageComponent2D create2DImageComponent(java.lang.Object content)
content - The object that was loaded and needs to be converted
public int nearestPowerTwo(int val,
boolean scaleUp)
val - The initial sizescaleUp - true to scale the value up, false for down
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||