|
Aviatrix3D 2.1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.NodeComponent
org.j3d.aviatrix3d.TextureComponent
public abstract class TextureComponent
Common representation of a component that contains source data to be used in textures.
| Field Summary | |
|---|---|
protected byte[] |
copyBuffer
Temp buffer used to transfer subimage updates to the listeners |
protected java.nio.ByteBuffer[] |
data
Buffer to hold the data |
protected int |
format
The format |
protected boolean |
invertY
Flag describing whether the Y axis should be inverted before use. |
protected int |
numLevels
The number of levels in this component. |
protected int |
size
The size of the data buffer |
protected int |
type
The type of the data |
static int |
TYPE_BYTE
Specifies the data is in byte format |
static int |
TYPE_INT
Specifies the data is in int format |
protected int |
width
The width |
| Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
|---|
lastParent, liveCount, parentList |
| Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
|---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
| Fields inherited from interface org.j3d.aviatrix3d.TextureSource |
|---|
FORMAT_BGR, FORMAT_BGRA, FORMAT_INTENSITY_ALPHA, FORMAT_LUMINANCE_ALPHA, FORMAT_RGB, FORMAT_RGBA, FORMAT_SINGLE_COMPONENT |
| Constructor Summary | |
|---|---|
TextureComponent(int numLevels)
Constructs an image with default values. |
|
| Method Summary | |
|---|---|
void |
addUpdateListener(SubTextureUpdateListener l)
Add a listener for subtexture change updates. |
protected int |
bytesPerPixel()
Convenience method that looks at the user provided image format and returns the number of bytes per pixel |
protected void |
checkCopyBufferSize(int size)
Ensure copyBuffer is large enough to hold the given number of pixels. |
protected void |
clearData(int level)
Clear the storage used for this object. |
abstract void |
clearLocalData()
Clear local data stored in this node. |
protected abstract java.nio.ByteBuffer |
convertImage(int level)
Convenience method to convert a buffered image into a NIO array of the corresponding type. |
protected java.nio.ByteBuffer |
getData(int level)
Get the underlying data object. |
int |
getFormat(int level)
Get the format of this image at the given mipmap level. |
int |
getNumLevels()
Get the number of levels in this component. |
int |
getWidth()
Get the width of this image. |
boolean |
isYUp()
Get the current value of the Y-axis inversion flag. |
void |
removeUpdateListener(SubTextureUpdateListener l)
Remove a listener for subtexture change updates. |
protected void |
sendTextureUpdate(int x,
int y,
int z,
int width,
int height,
int depth,
int level,
byte[] pixels)
Send off a sub-image update event. |
| Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
|---|
addParent, getParents, numParents, removeParent |
| Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
|---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_BYTE
public static final int TYPE_INT
protected int width
protected int format
protected int size
protected int type
protected java.nio.ByteBuffer[] data
protected boolean invertY
protected int numLevels
protected byte[] copyBuffer
| Constructor Detail |
|---|
public TextureComponent(int numLevels)
numLevels - The number of mipmap levels to create| Method Detail |
|---|
public int getWidth()
getWidth in interface TextureSourcepublic int getNumLevels()
getNumLevels in interface TextureSourcepublic int getFormat(int level)
getFormat in interface TextureSourcelevel - The mipmap level to get the format for
public void addUpdateListener(SubTextureUpdateListener l)
l - The listener instance to addpublic void removeUpdateListener(SubTextureUpdateListener l)
l - The listener instance to addpublic boolean isYUp()
public abstract void clearLocalData()
protected java.nio.ByteBuffer getData(int level)
level - Which image level needs to be converted
protected void clearData(int level)
level - Which image level needs to be convertedprotected abstract java.nio.ByteBuffer convertImage(int level)
level - Which image level needs to be converted
protected void checkCopyBufferSize(int size)
size - The number of bytes to hold
protected void sendTextureUpdate(int x,
int y,
int z,
int width,
int height,
int depth,
int level,
byte[] pixels)
x - The start location x coordinate in texel spacey - The start location y coordinate in texel spacez - The start location z coordinate in texel spacewidth - The width of the update in texel spaceheight - The height of the update in texel spacedepth - The depth of the update in texel spacelevel - The mipmap level that changedpixels - Buffer of the data that has updatedprotected int bytesPerPixel()
|
Aviatrix3D 2.1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||