|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core3D.StereoComposite
public class StereoComposite
This class provides support for "Anaglyph Stereo" rendering. Left- and right-eye views are drawn to separate grayscale images. Then these images are composed into a single RGB image in which the left-eye view becomes the green color component, the right-eye view becomes the red color component, and the blue color component is zero. The resulting composite image can be viewed with red/green or red/blue stereo glasses. (There should really be some way of doing all this directly in Java graphics, but support for this type of composition does not seem to exist.)
Constructor Summary | |
---|---|
StereoComposite()
|
Method Summary | |
---|---|
void |
compose()
|
int |
getHeight()
Returns the image height, as specified in setSize(int, int) . |
java.awt.image.BufferedImage |
getImage()
Returns the BufferedImage that contains the composed view. |
java.awt.Graphics2D |
getLeftEyeGraphics()
Returns a newly created graphics context for drawing into the left eye view. |
java.awt.image.BufferedImage |
getLeftEyeImage()
Returns the BufferedImage where the left-eye view is rendered. |
java.awt.Graphics2D |
getRightEyeGraphics()
Returns a newly created graphics context for drawing into the right eye view. |
java.awt.image.BufferedImage |
getRightEyeImage()
Returns the BufferedImage where the right view is rendered. |
int |
getWidth()
Returns the image width, as specified in setSize(int, int) . |
void |
releaseMemory()
Releases the memory allocated by setSize(int, int) . |
void |
setSize(int width,
int height)
Sets the size of the image that is to be composed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StereoComposite()
Method Detail |
---|
public void setSize(int width, int height)
width
- the width of the imageheight
- the height of the imagepublic int getWidth()
setSize(int, int)
. If setSize
has not yet been called, the return value is 0.
public int getHeight()
setSize(int, int)
. If setSize
has not yet been called, the return value is 0.
public void releaseMemory()
setSize(int, int)
. The width and the height are also reset to 0.
public java.awt.Graphics2D getLeftEyeGraphics()
setSize(int, int)
method
must already have been called to allocate memory for the views. If setSize
has not been
called, the return value is null.
public java.awt.Graphics2D getRightEyeGraphics()
setSize(int, int)
method
must already have been called to allocate memory for the views. If setSize
has not been
called, the return value is null.
public java.awt.image.BufferedImage getLeftEyeImage()
setSize
has not been
called, the return value is null.
public java.awt.image.BufferedImage getRightEyeImage()
setSize
has not been
called, the return value is null.
public java.awt.image.BufferedImage getImage()
compose()
must
be called in order to combine the left- and righ-eye views into the composite image -- this is
not done automatically. The return value can be null if setSize(int, int)
has
not been called to allocate memory.
public void compose()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |