All Packages Class Hierarchy This Package Previous Next Index
Class javax.media.j3d.Raster
java.lang.Object
|
+----javax.media.j3d.SceneGraphObject
|
+----javax.media.j3d.NodeComponent
|
+----javax.media.j3d.Geometry
|
+----javax.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 ImageComponent2D
object and/or a DepthComponent 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.
-
RASTER_COLOR
- Specifies a Raster object with color data.
-
RASTER_COLOR_DEPTH
- Specifies a Raster object with both color and depth (z-buffer) data.
-
RASTER_DEPTH
- Specifies a Raster object with depth (z-buffer) data.
-
Raster()
- Constructs a new raster image with default values.
-
Raster(Point3f, int, int, int, int, int, ImageComponent2D, DepthComponent)
- Constructs a new raster image with the specified values.
-
Raster(Point3f, int, Point, Dimension, ImageComponent2D, DepthComponent)
- Constructs a new raster image with the specified values.
-
getDepthComponent()
- Retrieves the current depth image object.
-
getImage()
- Retrieves the current pixel array object.
-
getOffset(Point)
- Retrieves the current pixel offset.
-
getPosition(Point3f)
- Retrieves the current position in object coordinates of this raster.
-
getSize(Dimension)
- Retrieves the current raster size.
-
getType()
- Retrieves the current type of this raster object, one of: RASTER_COLOR,
RASTER_DEPTH, or RASTER_COLOR_DEPTH.
-
setDepthComponent(DepthComponent)
- Sets the depth image used to copy pixels to/from a Canvas3D.
-
setImage(ImageComponent2D)
- Sets the pixel array used to copy pixels to/from a Canvas3D.
-
setOffset(int, int)
- Sets the offset within the array of pixels at which to start copying.
-
setOffset(Point)
- Sets the offset within the array of pixels at which to start copying.
-
setPosition(Point3f)
- Sets the position in object coordinates of this raster.
-
setSize(Dimension)
- Sets the size of the array of pixels to be copied.
-
setSize(int, int)
- Sets the number of pixels to be copied from the pixel array.
-
setType(int)
- Sets the type of this raster object to one of: RASTER_COLOR,
RASTER_DEPTH, or RASTER_COLOR_DEPTH.
RASTER_COLOR
public static final int RASTER_COLOR
- Specifies a Raster object with color data.
In this mode, the image reference must point to
a valid ImageComponent object.
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 DepthComponent object.
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 image reference must point to
a valid ImageComponent object, and the depthImage reference
must point to a valid DepthComponent object.
Raster
public Raster()
- Constructs a new raster image with default values.
Raster
public Raster(Point3f pos,
int type,
int xOffset,
int yOffset,
int width,
int height,
ImageComponent2D image,
DepthComponent depthComponent)
- 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
- image - the ImageComponent2D object containing the
color data
- depthImage - the DepthComponent object containing the depth
(z-buffer) data
Raster
public Raster(Point3f pos,
int type,
Point offset,
Dimension size,
ImageComponent2D image,
DepthComponent depthComponent)
- 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
- image - the ImageComponent2D object containing the
color data
- depthImage - the DepthComponent object containing the depth
(z-buffer) data
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
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
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
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
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
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
getOffset
public void getOffset(Point offset)
- Retrieves the current pixel offset.
- Parameters:
- offset - the object that will receive the offset
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
setSize
public void setSize(Dimension size)
- Sets the size of the array of pixels to be copied.
- Parameters:
- size - the new size
getSize
public void getSize(Dimension size)
- Retrieves the current raster size.
- Parameters:
- size - the object that will receive the size
setImage
public void setImage(ImageComponent2D image)
- 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:
- image - the ImageComponent2D object containing the
color data
getImage
public ImageComponent2D getImage()
- Retrieves the current pixel array object.
- Returns:
- image the ImageComponent2D object containing the
color data
setDepthComponent
public void setDepthComponent(DepthComponent depthComponent)
- 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 DepthComponent object containing the
depth (z-buffer) data
getDepthComponent
public DepthComponent getDepthComponent()
- Retrieves the current depth image object.
- Returns:
- depthImage DepthComponent containing the
depth (z-buffer) data
All Packages Class Hierarchy This Package Previous Next Index