|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.renderer.aviatrix3d.texture.TextureCreateUtils
public class TextureCreateUtils
Convenience class with a collection of useful utility methods taking an image and turning it into a Aviatrix3D texture object.
Constructor Summary | |
---|---|
TextureCreateUtils()
Default constructor. |
Method Summary | |
---|---|
TextureComponent2D |
create2DTextureComponent(java.lang.Object content)
Load the image component from the given object type. |
java.awt.image.BufferedImage |
createNormalMap(java.awt.image.BufferedImage bumpImage,
java.awt.image.BufferedImage destImage)
Convert an image that is a greyscale heightmap into a normal map, for use in DOT3 bump mapping. |
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(TextureComponent 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 Texture2D createTexture2D(java.awt.image.RenderedImage img)
img
- The source image to work with
public int getTextureFormat(TextureComponent 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 TextureComponent2D create2DTextureComponent(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
public java.awt.image.BufferedImage createNormalMap(java.awt.image.BufferedImage bumpImage, java.awt.image.BufferedImage destImage)
bumpImage
- The source image to take the heights fromdestImage
- An image to write the normal map to or null if creating new
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |