edu.dhbw.andar
Class AndARRenderer

java.lang.Object
  extended by edu.dhbw.andar.AndARRenderer
All Implemented Interfaces:
PreviewFrameSink

public class AndARRenderer
extends java.lang.Object
implements PreviewFrameSink

Opens the camera and displays the output on a square (as a texture)

Author:
Tobias Domhan

Constructor Summary
AndARRenderer(Resources res, ARToolkit markerInfo, AndARActivity activity)
          the default constructer
 
Method Summary
 java.util.concurrent.locks.ReentrantLock getFrameLock()
           
 void onDrawFrame(GL10 gl)
           
 void onSurfaceChanged(GL10 gl, int width, int height)
           
 void onSurfaceCreated(GL10 gl, EGLConfig config)
           
 void setMode(int pMode)
          sets the mode(either GL10.GL_RGB or GL10.GL_LUMINANCE)
 void setNextFrame(java.nio.ByteBuffer buf)
           
 void setNonARRenderer(OpenGLRenderer customRenderer)
           
 void setPreviewFrameSize(int textureSize, int realWidth, int realHeight)
          Set the size of the texture(must be power of two)
 Bitmap takeScreenshot()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndARRenderer

public AndARRenderer(Resources res,
                     ARToolkit markerInfo,
                     AndARActivity activity)
the default constructer

Parameters:
int - the PixelFormat of the Camera preview
res - Resources
customRenderer - non AR renderer, may be null
Method Detail

onDrawFrame

public final void onDrawFrame(GL10 gl)

onSurfaceChanged

public void onSurfaceChanged(GL10 gl,
                             int width,
                             int height)

onSurfaceCreated

public void onSurfaceCreated(GL10 gl,
                             EGLConfig config)

setNextFrame

public final void setNextFrame(java.nio.ByteBuffer buf)
Specified by:
setNextFrame in interface PreviewFrameSink

getFrameLock

public java.util.concurrent.locks.ReentrantLock getFrameLock()
Specified by:
getFrameLock in interface PreviewFrameSink

setPreviewFrameSize

public void setPreviewFrameSize(int textureSize,
                                int realWidth,
                                int realHeight)
Description copied from interface: PreviewFrameSink
Set the size of the texture(must be power of two)

Specified by:
setPreviewFrameSize in interface PreviewFrameSink

setMode

public void setMode(int pMode)
sets the mode(either GL10.GL_RGB or GL10.GL_LUMINANCE)

Specified by:
setMode in interface PreviewFrameSink
Parameters:
pMode -

setNonARRenderer

public void setNonARRenderer(OpenGLRenderer customRenderer)

takeScreenshot

public Bitmap takeScreenshot()