|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.NodeComponent org.j3d.aviatrix3d.Raster org.j3d.aviatrix3d.ByteRaster
public class ByteRaster
Raster object that represents a coloured image defined by a raw byte array.
The image raster can contain 1 to 4 colour components in the definition.
Internationalisation Resource Names
Field Summary | |
---|---|
static int |
FORMAT_BGR
Specifies the source is in Windows BGR format |
static int |
FORMAT_BGRA
Specifies the source is in Windows BGRA format |
static int |
FORMAT_INTENSITY
Specifies the source is in 1-component Intensity (greyscale) format |
static int |
FORMAT_INTENSITY_ALPHA
Specifies the source is in 2-component Intensity-Alpha format |
static int |
FORMAT_RGB
Specifies the source is in RGB format |
static int |
FORMAT_RGBA
Specifies the source is in RGBA format |
Fields inherited from class org.j3d.aviatrix3d.Raster |
---|
bounds, implicitBounds, internalUpdater, INVALID_BOUNDS, lastParentList, parentList, pickFlags, validAlpha |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
lastParent, liveCount |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject |
---|
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget |
---|
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE |
Constructor Summary | |
---|---|
ByteRaster(int width,
int height,
int format)
Create a new empty raster with the given width and height. |
Method Summary | |
---|---|
int |
compareTo(ByteRaster ir)
Compares this object with the specified object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(ByteRaster ir)
Compares this object with the specified object to check for equivalence. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
void |
getBits(byte[] bitmask)
Retrieve the vertices that are currently set. |
int |
getHeight()
Get the height of this bitmap. |
int |
getWidth()
Get the width of this bitmap. |
boolean |
pickLineRay(float[] origin,
float[] direction,
boolean findAny,
float[] dataOut,
int dataOutFlags)
Check for all intersections against this geometry using a line ray and return the exact distance away of the closest picking point. |
boolean |
pickLineSegment(float[] start,
float[] end,
boolean findAny,
float[] dataOut,
int dataOutFlags)
Check for all intersections against this geometry using a line segment and return the exact distance away of the closest picking point. |
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
void |
render(javax.media.opengl.GL gl)
Render the geometry now. |
void |
setBits(byte[] pixels)
Set the pixel data for the bitmap contents. |
void |
setBits(byte[] pixels,
int width,
int height,
int format)
Set the pixel data for the bitmap contents and change the size of the raster at the same time. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
protected void |
updateBounds()
Update this node's bounds and then call the parent to update it's bounds. |
Methods inherited from class org.j3d.aviatrix3d.Raster |
---|
addParent, boundsChanged, checkPickMask, getBounds, getPickableBounds, getPickMask, getPickTargetType, hasTransparency, isVisible, markBoundsDirty, pickBatch, pickSingle, removeParent, setBounds, setPickMask |
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, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FORMAT_RGB
public static final int FORMAT_RGBA
public static final int FORMAT_BGR
public static final int FORMAT_BGRA
public static final int FORMAT_INTENSITY_ALPHA
public static final int FORMAT_INTENSITY
Constructor Detail |
---|
public ByteRaster(int width, int height, int format)
width
- The width of the raster in pixelsheight
- The height of the raster in pixelsformat
- One of the FORMAT_ values describing the byte format
java.lang.IllegalArgumentException
- The width or height are not positive
or an invalid pixel formatMethod Detail |
---|
public void render(javax.media.opengl.GL gl)
gl
- The GL context to render withpublic boolean pickLineSegment(float[] start, float[] end, boolean findAny, float[] dataOut, int dataOutFlags) throws NotPickableException
pickLineSegment
in interface LeafPickTarget
pickLineSegment
in class Raster
start
- The start point of the segmentend
- The end point of the segmentfindAny
- True if it only has to find a single intersection and can
exit as soon as it finds the first intersection. False if it must find
the closest polygondataOut
- An array to put the data in for the intersection. Exact
format is described by the flagsdataOutFlags
- A set of derived-class specific flags describing what
data should be included in the output array
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anywaypublic boolean pickLineRay(float[] origin, float[] direction, boolean findAny, float[] dataOut, int dataOutFlags) throws NotPickableException
pickLineRay
in interface LeafPickTarget
pickLineRay
in class Raster
origin
- The start point of the raydirection
- The direction vector of the rayfindAny
- True if it only has to find a single intersection and can
exit as soon as it finds the first intersection. False if it must find
the closest polygondataOut
- An array to put the data in for the intersection. Exact
format is described by the flagsdataOutFlags
- A set of derived-class specific flags describing what
data should be included in the output array
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anywayprotected void updateBounds()
updateBounds
in class Raster
protected void recomputeBounds()
recomputeBounds
in class Raster
protected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public int getHeight()
public int getWidth()
public void setBits(byte[] pixels) throws InvalidWriteTimingException, java.lang.IllegalArgumentException
pixels
- The bytes to use for the raster or null to clear
java.lang.IllegalArgumentException
- The number of bytes is not sufficient to
fulfill the previously set width and height of the bitmap
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data callback methodpublic void setBits(byte[] pixels, int width, int height, int format) throws InvalidWriteTimingException, java.lang.IllegalArgumentException
pixels
- The bytes to use for the raster or null to clearwidth
- The width of the raster in pixelsheight
- The height of the raster in pixelsformat
- One of the FORMAT_ values describing the byte format
java.lang.IllegalArgumentException
- The width or height are not positive
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds callback methodpublic void getBits(byte[] bitmask)
bitmask
- The array to copy the bit mask values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic int compareTo(ByteRaster ir)
ir
- The argument instance to be compared
public boolean equals(ByteRaster ir)
ir
- The image instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |