org.j3d.aviatrix3d
Class ByteTextureComponent2D
java.lang.Object
org.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.NodeComponent
org.j3d.aviatrix3d.TextureComponent
org.j3d.aviatrix3d.TextureComponent2D
org.j3d.aviatrix3d.ByteTextureComponent2D
- public class ByteTextureComponent2D
- extends TextureComponent2D
A Texture component that uses raw byte data to be interpreted by the
format IDs passed in.
- Version:
- $Revision: 1.4 $
- Author:
- Alan Hudson
Fields inherited from class org.j3d.aviatrix3d.TextureComponent |
data, format, FORMAT_BGR, FORMAT_BGRA, FORMAT_INTENSITY_ALPHA, FORMAT_RGB, FORMAT_RGBA, FORMAT_SINGLE_COMPONENT, invertY, numLevels, size, type, TYPE_BYTE, TYPE_INT, width |
Constructor Summary |
ByteTextureComponent2D()
Constructs an image with default values. |
ByteTextureComponent2D(boolean yUp)
Constructs an image with default values. |
ByteTextureComponent2D(int format,
int width,
int height,
byte[] srcPixels)
Constructs an Image2D using the specified format, width, height and
rendered image. |
ByteTextureComponent2D(int format,
int width,
int height,
byte[][] srcPixels,
int numLevels)
Constructs an Image2D using the specified format, width, height and
rendered image. |
ByteTextureComponent2D(int format,
int width,
int height,
byte[] srcPixels,
boolean yUp)
Constructs an Image2D using the specified format, width, height and
rendered image. |
Method Summary |
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 widht,
int height,
int lvl,
byte[] img)
Update a sub-section of the image data with the new pixel values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteTextureComponent2D
public ByteTextureComponent2D()
- Constructs an image with default values.
ByteTextureComponent2D
public ByteTextureComponent2D(boolean yUp)
- Constructs an image with default values.
- Parameters:
yUp
- Change the image aroud the Y axis if needed
ByteTextureComponent2D
public ByteTextureComponent2D(int format,
int width,
int height,
byte[] srcPixels)
- Constructs an Image2D using the specified format, width, height and
rendered image. If the srcImage[0] is an instance of BufferedImage,
the format passed is ignored and the image directly used.
- Parameters:
format
- The image format. RGB, RGBA currentlywidth
- The width of the imageheight
- The height of the imagesrcPixels
- The image data
ByteTextureComponent2D
public ByteTextureComponent2D(int format,
int width,
int height,
byte[][] srcPixels,
int numLevels)
- Constructs an Image2D using the specified format, width, height and
rendered image. If the srcImage[0] is an instance of BufferedImage,
the format passed is ignored and the image directly used.
- Parameters:
format
- The image format. RGB, RGBA currentlywidth
- The width of the imageheight
- The height of the imagesrcPixels
- The image datanumLevels
- The number of mip-map levels to generate
ByteTextureComponent2D
public ByteTextureComponent2D(int format,
int width,
int height,
byte[] srcPixels,
boolean yUp)
- Constructs an Image2D using the specified format, width, height and
rendered image. If the srcImage[0] is an instance of BufferedImage,
the format passed is ignored and the image directly used.
- Parameters:
format
- The image format. RGB, RGBA currentlywidth
- The width of the imageheight
- The height of the imageyUp
- Change the image aroud the Y axis if needed
updateSubImage
public void updateSubImage(int srcX,
int srcY,
int destX,
int destY,
int widht,
int height,
int lvl,
byte[] img)
throws InvalidWriteTimingException
- Update a sub-section of the image data with the new pixel values. Not
implemented yet.
- Parameters:
srcX
- The starting X offset in the existing image spacesrcY
- The starting Y offset in the existing image spacedestX
- The starting X offset in the existing image spacedestY
- The starting Y offset in the existing image spaceheight
- The height of the section to replaceimg
- The image to take data from
- Throws:
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback method
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
Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - j3d.org