Aviatrix3D
2.0 Beta 2

org.j3d.aviatrix3d
Class ImageTextureComponent3D

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.NodeComponent
          extended by org.j3d.aviatrix3d.TextureComponent
              extended by org.j3d.aviatrix3d.TextureComponent3D
                  extended by org.j3d.aviatrix3d.ImageTextureComponent3D
All Implemented Interfaces:
TextureSource

public class ImageTextureComponent3D
extends TextureComponent3D

A texture component that wraps a 3D image.

Version:
$Revision: 1.18 $
Author:
Alan Hudson

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.TextureComponent3D
depth, height
 
Fields inherited from class org.j3d.aviatrix3d.TextureComponent
copyBuffer, data, format, invertY, numLevels, size, type, TYPE_BYTE, TYPE_INT, width
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
lastParent, liveCount, parentList
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG
 
Fields inherited from interface org.j3d.aviatrix3d.TextureSource
FORMAT_BGR, FORMAT_BGRA, FORMAT_INTENSITY_ALPHA, FORMAT_RGB, FORMAT_RGBA, FORMAT_SINGLE_COMPONENT
 
Constructor Summary
ImageTextureComponent3D()
          Constructs an image with default values.
ImageTextureComponent3D(boolean yUp)
          Constructs an image with default values.
ImageTextureComponent3D(int format, int width, int height, int depth, java.awt.image.RenderedImage[] images)
          Constructs an Image3D using the specified format, width, height and rendered image.
ImageTextureComponent3D(int format, int width, int height, int depth, java.awt.image.RenderedImage[] images, boolean yUp)
          Constructs an Image3D using the specified format, width, height and rendered image.
ImageTextureComponent3D(int format, java.awt.image.RenderedImage[] images)
          Constructs an Image3D using the specified format and rendered image.
ImageTextureComponent3D(int format, java.awt.image.RenderedImage[] images, boolean yUp)
          Constructs an Image2D using the specified format and rendered image.
 
Method Summary
 void clearLocalData()
          Clear local data stored in this node.
protected  java.nio.ByteBuffer convertImage(int level)
          Convenience method to convert a buffered image into a NIO array of the corresponding type.
 void updateSubImage(int srcX, int srcY, int destX, int destY, int destZ, int width, int height, int depth, int level, java.awt.image.RenderedImage[] img)
          Update a sub-section of the image data with the new pixel values.
 void updateSubImage(int srcX, int srcY, int destX, int destY, int destZ, int width, int height, int level, java.awt.image.RenderedImage img)
          Update a sub-section of the image data with the new pixel values.
 
Methods inherited from class org.j3d.aviatrix3d.TextureComponent3D
getDepth, getHeight
 
Methods inherited from class org.j3d.aviatrix3d.TextureComponent
addUpdateListener, bytesPerPixel, checkCopyBufferSize, clearData, getData, getFormat, getNumLevels, getWidth, isYUp, removeUpdateListener, sendTextureUpdate
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, hasChanged, numParents, removeParent
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageTextureComponent3D

public ImageTextureComponent3D()
Constructs an image with default values.


ImageTextureComponent3D

public ImageTextureComponent3D(boolean yUp)
Constructs an image with default values.

Parameters:
yUp - Change the image aroud the Y axis if needed

ImageTextureComponent3D

public ImageTextureComponent3D(int format,
                               int width,
                               int height,
                               int depth,
                               java.awt.image.RenderedImage[] images)
Constructs an Image3D using the specified format, width, height and rendered image.

Parameters:
format - The image format. RGB, RGBA currently
width - The width of the image
height - The height of the image
images - The image data
Throws:
java.lang.IllegalArgumentException - Formats don't match

ImageTextureComponent3D

public ImageTextureComponent3D(int format,
                               int width,
                               int height,
                               int depth,
                               java.awt.image.RenderedImage[] images,
                               boolean yUp)
Constructs an Image3D using the specified format, width, height and rendered image.

Parameters:
format - The image format. RGB, RGBA currently
width - The width of the image
height - The height of the image
images - The image data
yUp - Change the image aroud the Y axis if needed
Throws:
java.lang.IllegalArgumentException - Formats don't match

ImageTextureComponent3D

public ImageTextureComponent3D(int format,
                               java.awt.image.RenderedImage[] images)
Constructs an Image3D using the specified format and rendered image.

Parameters:
format - The image format. RGB, RGBA currently
images - The image data
Throws:
java.lang.IllegalArgumentException - Formats don't match

ImageTextureComponent3D

public ImageTextureComponent3D(int format,
                               java.awt.image.RenderedImage[] images,
                               boolean yUp)
Constructs an Image2D using the specified format and rendered image.

Parameters:
format - The image format. RGB, RGBA currently
images - The image data
yUp - Change the image aroud the Y axis if needed
Throws:
java.lang.IllegalArgumentException - Formats don't match
Method Detail

updateSubImage

public void updateSubImage(int srcX,
                           int srcY,
                           int destX,
                           int destY,
                           int destZ,
                           int width,
                           int height,
                           int level,
                           java.awt.image.RenderedImage img)
                    throws InvalidWriteTimingException
Update a sub-section of the image data with the new pixel values. Since an image is a 2D object, we can only replace one piece of the depth at a time. Updating multiple pieces of the image should use the alternate form of this method.

Parameters:
srcX - The starting X offset in the existing image space
srcY - The starting Y offset in the existing image space
destX - The starting X offset in the existing image space
destY - The starting Y offset in the existing image space
destZ - The starting Z offset in the existing image space
width - The width of the section to replace
height - The height of the section to replace
level - The mipmap level to update
img - The image to take data from
Throws:
InvalidWriteTimingException

updateSubImage

public void updateSubImage(int srcX,
                           int srcY,
                           int destX,
                           int destY,
                           int destZ,
                           int width,
                           int height,
                           int depth,
                           int level,
                           java.awt.image.RenderedImage[] img)
                    throws InvalidWriteTimingException
Update a sub-section of the image data with the new pixel values. The depth should be no greater than the number of images in the provided source array.

Parameters:
srcX - The starting X offset in the existing image space
srcY - The starting Y offset in the existing image space
destX - The starting X offset in the existing image space
destY - The starting Y offset in the existing image space
width - The width of the section to replace
height - The height of the section to replace
depth - The height of the section to replace
level - The mipmap level to update
img - The image to take data from
Throws:
InvalidWriteTimingException

clearLocalData

public void clearLocalData()
Clear local data stored in this node. Only data needed for OpenGL calls will be retained;

Specified by:
clearLocalData in class TextureComponent

convertImage

protected java.nio.ByteBuffer convertImage(int level)
Convenience method to convert a buffered image into a NIO array of the corresponding type. Images typically need to be swapped when doing this by the Y axis is in the opposite direction to the one used by OpenGL.

Specified by:
convertImage in class TextureComponent
Parameters:
level - Which image level needs to be converted
Returns:
an appropriate array type - either IntBuffer or ByteBuffer

Aviatrix3D
2.0 Beta 2

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2006 j3d.org