|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGLSurfaceView
com.metaio.sdk.MetaioSurfaceView
public final class MetaioSurfaceView
This class encapsulates metaio SDK renderer's view. It manages tracking, touch events, loading and rendering geometries. This view should be overlayed on top of camera view to experience the augmentation, because rendered does not renders camera image
Nested Class Summary | |
---|---|
static interface |
MetaioSurfaceView.Callback
Implement this callback to load/unload geometries, transform geometries and handle geometries selection through touch event and receive animation events. |
Constructor Summary | |
---|---|
MetaioSurfaceView(Context context)
Creates GLSurfaceView for rendering |
|
MetaioSurfaceView(Context context,
GLSurfaceView.EGLConfigChooser chooser)
Creates GLSurfaceView for rendering |
Method Summary | |
---|---|
AudioRenderer |
getAudioRenderer()
|
static GLSurfaceView.EGLConfigChooser |
getEGLConfigChooser(int r,
int g,
int b,
int a,
int depth,
int stencil,
int samples)
Returns |
FrameLayout.LayoutParams |
getLayoutParams(Vector2di cameraResolution,
boolean fullScreen)
Helper method to determine best layout parameters for this view This method assumes that Activity is in landscape mode. |
FrameLayout.LayoutParams |
getLayoutParams(Vector2di cameraResolution,
boolean fullScreen,
boolean portrait)
Helper method to determine best layout parameters for this view |
FrameLayout.LayoutParams |
getLayoutParams(Vector2di cameraResolution,
Rect visibleFrame,
boolean fullView)
Helper method to determine best layout parameters for this view This method assumes that Activity is in landscape mode. |
FrameLayout.LayoutParams |
getLayoutParams(Vector2di cameraResolution,
Rect visibleFrame,
boolean fullView,
boolean portrait)
Helper method to determine best layout parameters for this view |
PointF |
globalToLocalViewCoordinates(MotionEvent event,
Rect visibleFrame)
This transforms onTouch global screen coordinates into local view coordinate system, while compensating for the visible window frame and local view dimensions. |
void |
onDrawFrame(GL10 gl)
|
void |
onPause()
|
void |
onResume()
|
void |
onSurfaceChanged(GL10 gl,
int w,
int h)
|
void |
onSurfaceCreated(GL10 gl,
EGLConfig config)
|
void |
registerCallback(MetaioSurfaceView.Callback callback)
Register a callback class to load/unload geometries, transform geometries and handle selection of geometries through touch event. |
void |
surfaceChanged(SurfaceHolder holder,
int format,
int w,
int h)
|
void |
surfaceCreated(SurfaceHolder holder)
|
void |
surfaceDestroyed(SurfaceHolder holder)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaioSurfaceView(Context context)
context
- Application contextpublic MetaioSurfaceView(Context context, GLSurfaceView.EGLConfigChooser chooser)
context
- Application contextchooser
- Customized GLSurfaceView.EGLConfigChooser instanceMethod Detail |
---|
public static GLSurfaceView.EGLConfigChooser getEGLConfigChooser(int r, int g, int b, int a, int depth, int stencil, int samples)
r
- int redSizeg
- int greenSizeb
- int blueSizea
- int alphaSizedepth
- int depthSizestencil
- int stencilSizesamples
- int samples 0/2/4 for multisampling
public FrameLayout.LayoutParams getLayoutParams(Vector2di cameraResolution, boolean fullScreen)
cameraResolution
- Camera image resolutionfullScreen
- camera view will be stretched to full screen if
true
, else it will be stretched to best fit
keeping the aspect ratio
getLayoutParams(Vector2di, boolean, boolean)
public FrameLayout.LayoutParams getLayoutParams(Vector2di cameraResolution, Rect visibleFrame, boolean fullView)
cameraResolution
- Camera image resolutionvisibleFrame
- Visible window frame in which this view should fit infullView
- true to fill entire parent view, false to best fit
public FrameLayout.LayoutParams getLayoutParams(Vector2di cameraResolution, Rect visibleFrame, boolean fullView, boolean portrait)
cameraResolution
- Camera image resolutionvisibleFrame
- Visible window frame in which this view should fit infullView
- true to fill entire parent view, false to best fitportrait
- true
if the Activity is in portrait orientation
public FrameLayout.LayoutParams getLayoutParams(Vector2di cameraResolution, boolean fullScreen, boolean portrait)
cameraResolution
- Camera image resolutionfullScreen
- camera view will be stretched to full screen if
true
, else it will be stretched to best fit
keeping the aspect ratioportrait
- public PointF globalToLocalViewCoordinates(MotionEvent event, Rect visibleFrame)
event
- MotionEventvisibleFrame
- Visible window frame
public void surfaceCreated(SurfaceHolder holder)
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h)
public void surfaceDestroyed(SurfaceHolder holder)
public void registerCallback(MetaioSurfaceView.Callback callback)
callback
- a class which implements MetaioSurfaceView.Callback
interfaceMetaioSurfaceView.Callback
public void onPause()
public void onResume()
public AudioRenderer getAudioRenderer()
public void onSurfaceCreated(GL10 gl, EGLConfig config)
public void onSurfaceChanged(GL10 gl, int w, int h)
public void onDrawFrame(GL10 gl)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |