All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.Raster

java.lang.Object
   |
   +----java.media.j3d.SceneGraphObject
           |
           +----java.media.j3d.NodeComponent
                   |
                   +----java.media.j3d.Geometry
                           |
                           +----java.media.j3d.Raster

public class Raster
extends Geometry
The Raster object extends Geometry to allow drawing a raster image that is attached to a 3D location in the virtual world. It contains a point that is defined in the local object coordinate system of the Shape3D node that references the Raster. It also contains a type specifier, a reference to a PixelArray2D object and/or a DepthImage object, and an integer x,y offset and a size (width, height) to allow reading or writing a portion of the referenced image. In addition to being used as a type of geometry for drawing, a Raster may be used to readback pixel data (color and/or z-buffer) from the frame buffer in immediate mode.


Variable Index

 o RASTER_COLOR
Specifies a Raster object with color data.
 o RASTER_COLOR_DEPTH
Specifies a Raster object with both color and depth (z-buffer) data.
 o RASTER_DEPTH
Specifies a Raster object with depth (z-buffer) data.

Constructor Index

 o Raster()
Constructs a new raster image with default values.
 o Raster(Point3f, int, int, int, int, int, PixelArray2D, DepthImage)
Constructs a new raster image with the specified values.
 o Raster(Point3f, int, Point, Dimension, PixelArray2D, DepthImage)
Constructs a new raster image with the specified values.

Method Index

 o getDepthImage()
Retrieves the current depth image object.
 o getOffset(Point)
Retrieves the current pixel offset.
 o getPixelArray()
Retrieves the current pixel array object.
 o getPosition(Point3f)
Retrieves the current position in object coordinates of this raster.
 o getSize(Dimension)
Retrieves the current raster size.
 o getType()
Retrieves the current type of this raster object, one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.
 o setDepthImage(DepthImage)
Sets the depth image used to copy pixels to/from a Canvas3D.
 o setOffset(int, int)
Sets the offset within the array of pixels at which to start copying.
 o setOffset(Point)
Sets the offset within the array of pixels at which to start copying.
 o setPixelArray(PixelArray2D)
Sets the pixel array used to copy pixels to/from a Canvas3D.
 o setPosition(Point3f)
Sets the position in object coordinates of this raster.
 o setSize(Dimension)
Sets the size of the array of pixels to be copied.
 o setSize(int, int)
Sets the number of pixels to be copied from the pixel array.
 o setType(int)
Sets the type of this raster object to one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.

Variables

 o RASTER_COLOR
 public static final int RASTER_COLOR
Specifies a Raster object with color data. In this mode, the pixelArray reference must point to a valid PixelArray object.

 o RASTER_DEPTH
 public static final int RASTER_DEPTH
Specifies a Raster object with depth (z-buffer) data. In this mode, the depthImage reference must point to a valid DepthImage object.

 o RASTER_COLOR_DEPTH
 public static final int RASTER_COLOR_DEPTH
Specifies a Raster object with both color and depth (z-buffer) data. In this mode, the pixelArray reference must point to a valid PixelArray object, and the depthImage reference must point to a valid DepthImage object.

Constructors

 o Raster
 public Raster()
Constructs a new raster image with default values.

 o Raster
 public Raster(Point3f pos,
               int type,
               int xOffset,
               int yOffset,
               int width,
               int height,
               PixelArray2D pixelArray,
               DepthImage depthImage)
Constructs a new raster image with the specified values.

Parameters:
pos - the position in object coordinates of the upper-left corner of the raster
type - the type of raster object, one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.
xOffset - the x offset within the array of pixels at which to start copying
yOffset - the y offset within the array of pixels at which to start copying
width - the number of columns of pixels to copy
height - the number of rows of pixels to copy
pixelArray - the PixelArray2D object containing the color data
depthImage - the DepthImage object containing the depth (z-buffer) data
 o Raster
 public Raster(Point3f pos,
               int type,
               Point offset,
               Dimension size,
               PixelArray2D pixelArray,
               DepthImage depthImage)
Constructs a new raster image with the specified values.

Parameters:
pos - the position in object coordinates of the upper-left corner of the raster
type - the type of raster object, one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.
offset - the offset within the array of pixels at which to start copying
size - the width and height of the image to be copied
pixelArray - the PixelArray2D object containing the color data
depthImage - the DepthImage object containing the depth (z-buffer) data

Methods

 o setPosition
 public void setPosition(Point3f pos)
Sets the position in object coordinates of this raster. This position is transformed into device coordinates and is used as the upper-left corner of the raster.

Parameters:
pos - the new position of this raster
 o getPosition
 public void getPosition(Point3f pos)
Retrieves the current position in object coordinates of this raster.

Parameters:
pos - the vector that will receive the current position
 o setType
 public void setType(int type)
Sets the type of this raster object to one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.

Parameters:
type - the new type of this raster
 o getType
 public int getType()
Retrieves the current type of this raster object, one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.

Returns:
type the type of this raster
 o setOffset
 public void setOffset(int xOffset,
                       int yOffset)
Sets the offset within the array of pixels at which to start copying.

Parameters:
xOffset - the x offset within the array of pixels at which to start copying
yOffset - the y offset within the array of pixels at which to start copying
 o setOffset
 public void setOffset(Point offset)
Sets the offset within the array of pixels at which to start copying.

Parameters:
offset - the new pixel offset
 o getOffset
 public void getOffset(Point offset)
Retrieves the current pixel offset.

Parameters:
offset - the object that will receive the offset
 o setSize
 public void setSize(int width,
                     int height)
Sets the number of pixels to be copied from the pixel array.

Parameters:
width - the number of columns in the array of pixels to copy
height - the number of rows in the array of pixels to copy
 o setSize
 public void setSize(Dimension size)
Sets the size of the array of pixels to be copied.

Parameters:
size - the new size
 o getSize
 public void getSize(Dimension size)
Retrieves the current raster size.

Parameters:
size - the object that will receive the size
 o setPixelArray
 public void setPixelArray(PixelArray2D pixelArray)
Sets the pixel array used to copy pixels to/from a Canvas3D. This is used when the type is RASTER_COLOR or RASTER_COLOR_DEPTH.

Parameters:
pixelArray - the PixelArray2D object containing the color data
 o getPixelArray
 public PixelArray2D getPixelArray()
Retrieves the current pixel array object.

Returns:
pixelArray the PixelArray2D object containing the color data
 o setDepthImage
 public void setDepthImage(DepthImage depthImage)
Sets the depth image used to copy pixels to/from a Canvas3D. This is used when the type is RASTER_DEPTH or RASTER_COLOR_DEPTH.

Parameters:
depthImage - the DepthImage object containing the depth (z-buffer) data
 o getDepthImage
 public DepthImage getDepthImage()
Retrieves the current depth image object.

Returns:
depthImage DepthImage containing the depth (z-buffer) data

All Packages  Class Hierarchy  This Package  Previous  Next  Index