public class

VDARAnnotationView

extends FrameLayout
implements VDARSDKControllerEventReceiver
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.vidinoti.android.vdarsdk.VDARAnnotationView

Class Overview

The annotation view which will display the camera frames and the annotations.

The view is OpenGL-backed. Therefore it is not recommended to overlay views on top of it. Note that the view should fit the whole screen to work correctly.

Warning: The VDARSDKController should have been already started before any instance of that view to be created.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
VDARAnnotationView(Context context)
Create a new annotation view.
VDARAnnotationView(Context context, AttributeSet attrs)
Create a new annotation view.
VDARAnnotationView(Context context, boolean renderCamera)
Create a new annotation view.
VDARAnnotationView(Context context, boolean renderCamera, AttributeSet attrs)
Create a new annotation view.
Public Methods
void captureScreenshot(String outputFile, Observer callback)
Capture a screenshot of the current view and store it into outputFile as a JPEG image.
abstract void didCaptureAndProcessedFrame(VDARFrame frame, VDARMatrix3x3 homography)
float getAnimationSpeed()
boolean getDarkScreenMode()
int getPPI()
Returns the number of pixels per inch of the device
void grabStillCameraFrame(FrameGrabberCallback callback)
void grabStreamingCameraFrame(FrameGrabberCallback callback)
boolean isRendering()
void onAnnotationsHidden()
Called when all annotations (i.e.
void onCodesRecognized(ArrayList<VDARCode> codes)
Call when the given codes are recognized.
void onEnterContext(VDARContext context)
Advertise the listener that the user is in the specified context
void onExitContext(VDARContext context)
Advertise the listener that the user is not anymore in the specified context
void onFatalError(String errorDescription)
Called when a fatal error has occurred within VDARSDK.
void onPause()
onPause event of VDARAnnotationView.
void onPresentAnnotations()
Called when some annotations (i.e.
void onRequireSynchronization(ArrayList<VDARPrior> priors)
Called when some context or content requires the app to trigger a synchronization based on a given tag.
void onResume()
onResume event of VDARAnnotationView.
void onTrackingStarted(int imageWidth, int imageHeight)
Advertise the listener that we have recognized an image and we are currently tracking it.
void setAnimationSpeed(float value)
The speed of animation displayed in the transition from dark screen to non-dark screen.
void setDarkScreenMode(boolean value)
The brightness of camera view drops by half if the value is set as true.
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.vidinoti.android.vdarsdk.VDARSDKControllerEventReceiver

Public Constructors

public VDARAnnotationView (Context context)

Create a new annotation view.

Warning: Only a single VDARAnnotationView can be used in an activity at the same time.

Parameters
context Android context

public VDARAnnotationView (Context context, AttributeSet attrs)

Create a new annotation view.

Warning: Only a single VDARAnnotationView can be used in an activity at the same time.

Parameters
context Android context

public VDARAnnotationView (Context context, boolean renderCamera)

Create a new annotation view.

Warning: Only a single VDARAnnotationView can be used in an activity at the same time.

Parameters
context Android context
renderCamera Render the camera stream or not

public VDARAnnotationView (Context context, boolean renderCamera, AttributeSet attrs)

Create a new annotation view.

Warning: Only a single VDARAnnotationView can be used in an activity at the same time.

Parameters
context Android context
renderCamera Render the camera stream or not
attrs The attribute to apply on the view

Public Methods

public void captureScreenshot (String outputFile, Observer callback)

Capture a screenshot of the current view and store it into outputFile as a JPEG image.

If output file already exists, it is overwritten.

Parameters
outputFile The file in which to store the screenshot in JPEG format.
callback The observer which is updated when the screenshot is saved. The data argument of the "update" method is null if the image is successfully saved.

public abstract void didCaptureAndProcessedFrame (VDARFrame frame, VDARMatrix3x3 homography)

Since: API Level

public float getAnimationSpeed ()

Returns
  • a float value of the speed of animation

public boolean getDarkScreenMode ()

Returns
  • true if the dark screen mode is turned on.

public int getPPI ()

Returns the number of pixels per inch of the device

public void grabStillCameraFrame (FrameGrabberCallback callback)

public void grabStreamingCameraFrame (FrameGrabberCallback callback)

public boolean isRendering ()

public void onAnnotationsHidden ()

Called when all annotations (i.e. AR Content) are removed (hidden) from the screen.

Note that this can be called multiple times and even if a model is currently recognized.

This can be used to show overlays that used to be displayed over the AR view when onPresentAnnotations() was called.

public void onCodesRecognized (ArrayList<VDARCode> codes)

Call when the given codes are recognized.

public void onEnterContext (VDARContext context)

Advertise the listener that the user is in the specified context

Parameters
context The context the user is currently in

public void onExitContext (VDARContext context)

Advertise the listener that the user is not anymore in the specified context

Parameters
context The context the user was before it was out of it.

public void onFatalError (String errorDescription)

Called when a fatal error has occurred within VDARSDK.

It can be either a camera error or a certificate error preventing the application to use the SDK correctly.

Parameters
errorDescription The description of the error

public void onPause ()

onPause event of VDARAnnotationView. This method should be called from the onPause method of your application

public void onPresentAnnotations ()

Called when some annotations (i.e. AR Content) is displayed on screen.

Note that this can be called multiple times and even if no model is yet recognized.

This can be used to hide any overlays displayed over the AR view.

public void onRequireSynchronization (ArrayList<VDARPrior> priors)

Called when some context or content requires the app to trigger a synchronization based on a given tag. The app should start the synchronization with the given tag(s) right away or at the end of the currently running synchronization.

Parameters
priors a list of VDARPrior object to launch the synchronization for.

public void onResume ()

onResume event of VDARAnnotationView. This method should be called from the onResume method of your application

public void onTrackingStarted (int imageWidth, int imageHeight)

Advertise the listener that we have recognized an image and we are currently tracking it.

Note this method is in practice not needed and you can provide an empty implementation in your application.

Parameters
imageWidth The width in pixel of the tracked image
imageHeight The height in pixel of the tracked image

public void setAnimationSpeed (float value)

The speed of animation displayed in the transition from dark screen to non-dark screen. The animation is disabled if the value is set as 0.

public void setDarkScreenMode (boolean value)

The brightness of camera view drops by half if the value is set as true.