vmm3d.core3D
Class StereoComposite
- java.lang.Object
-
- vmm3d.core3D.StereoComposite
-
public class StereoComposite extends java.lang.ObjectThis 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
Constructors Constructor and Description StereoComposite()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcompose()intgetHeight()Returns the image height, as specified insetSize(int, int).java.awt.image.BufferedImagegetImage()Returns the BufferedImage that contains the composed view.org.freehep.graphics2d.VectorGraphicsgetLeftEyeGraphics()Returns a newly created graphics context for drawing into the left eye view.java.awt.image.BufferedImagegetLeftEyeImage()Returns the BufferedImage where the left-eye view is rendered.org.freehep.graphics2d.VectorGraphicsgetRightEyeGraphics()Returns a newly created graphics context for drawing into the right eye view.java.awt.image.BufferedImagegetRightEyeImage()Returns the BufferedImage where the right view is rendered.intgetWidth()Returns the image width, as specified insetSize(int, int).voidreleaseMemory()Releases the memory allocated bysetSize(int, int).voidsetSize(int width, int height)Sets the size of the image that is to be composed.
-
-
-
Method Detail
-
setSize
public void setSize(int width, int height)Sets the size of the image that is to be composed. Buffered images are allocated for the left, right, and composed views as well as for some arrays that are used to do the compostion. This method must be called before any drawing or compositing can be done.- Parameters:
width- the width of the imageheight- the height of the image
-
getWidth
public int getWidth()
Returns the image width, as specified insetSize(int, int). IfsetSizehas not yet been called, the return value is 0.
-
getHeight
public int getHeight()
Returns the image height, as specified insetSize(int, int). IfsetSizehas not yet been called, the return value is 0.
-
releaseMemory
public void releaseMemory()
Releases the memory allocated bysetSize(int, int). The width and the height are also reset to 0.
-
getLeftEyeGraphics
public org.freehep.graphics2d.VectorGraphics getLeftEyeGraphics()
Returns a newly created graphics context for drawing into the left eye view. ThesetSize(int, int)method must already have been called to allocate memory for the views. IfsetSizehas not been called, the return value is null.
-
getRightEyeGraphics
public org.freehep.graphics2d.VectorGraphics getRightEyeGraphics()
Returns a newly created graphics context for drawing into the right eye view. ThesetSize(int, int)method must already have been called to allocate memory for the views. IfsetSizehas not been called, the return value is null.
-
getLeftEyeImage
public java.awt.image.BufferedImage getLeftEyeImage()
Returns the BufferedImage where the left-eye view is rendered. IfsetSizehas not been called, the return value is null.
-
getRightEyeImage
public java.awt.image.BufferedImage getRightEyeImage()
Returns the BufferedImage where the right view is rendered. IfsetSizehas not been called, the return value is null.
-
getImage
public java.awt.image.BufferedImage getImage()
Returns the BufferedImage that contains the composed view. Note thatcompose()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 ifsetSize(int, int)has not been called to allocate memory.
-
compose
public void compose()
-
-
DMelt 3.0 © DataMelt by jWork.ORG