The basic component of the Pikkart Augmented Reality SDK. More...
Inherits Fragment, and OnTouchListener.
Inherited by com.pikkart.ar.geo.GeoFragment.
Public Member Functions | |
void | startRecognition (RecognitionOptions recognitionOptions, IRecognitionListener recognitionCallback) |
Starts the recognition process with the selected RecognitionOptions and IRecognitionListener. More... | |
void | stopRecognition () |
Stop the active recognition process manually without closing the camera. More... | |
void | changeRecognitionOptions (RecognitionOptions recognitionOptions) |
Changes the current RecognitionOptions without stopping the recognition process. More... | |
void | setMarkerCacheSize (int markerCacheSize) |
Set the max number of markers to keep locally. More... | |
boolean | isRecognitionActive () |
Returns if the recognition is currently running. More... | |
boolean | enableTorch () |
Turn on the torch of the device. More... | |
boolean | disableTorch () |
Turn off the torch of the device. More... | |
void | setFocusMode (String mode) |
Set the selected focus mode for the camera if available for the device. More... | |
String | getFocusMode () |
Retrieve the currently set focus mode. More... | |
String | GetAppPath () |
Returns the local storage application path. | |
void | DisableRecognition () |
Disable the recognition system. | |
void | EnableRecognition () |
Enables the recognition system. | |
boolean | IsRecognitionEnabled () |
Is the recognition system enabled. | |
Static Public Member Functions | |
static boolean | isTracking () |
Returns if the Pikkart-AR SDK is currently tracking a marker. More... | |
static Marker | getCurrentMarker () |
Returns the currently tracked marker. More... | |
static float [] | getCurrentProjectionMatrix () |
Returns the current projection matrix and make it available for rendering purpose. More... | |
static float [] | getCurrentModelViewMatrix () |
Returns the current modelview matrix and make it available for rendering purpose. More... | |
static void | renderCamera (int viewportWidth, int viewportHeight, int angle) |
Create a texture and render the current camera frame. More... | |
Protected Attributes | |
RecognitionManager | _recognitionManager = null |
The recognition manager. | |
View | _fragmentView = null |
This fragment view root. | |
AssetManager | asset_manager =null |
The asset manager. | |
RecognitionOptions | requestedRecognitionOptions =null |
requested recognition options. | |
IRecognitionListener | requestedRecognitionCallback =null |
The recognition listener (usually the calling activity). | |
The RecognitionFragment is a an Android Fragment that controls the camera and the recognition process.
At its creation it open the camera and setup all its parameters and the internal variables of the system.
It exposes simple methods to manage the recognition process and the communication with the Pikkart Cloud Recognition Service
void com.pikkart.ar.recognition.RecognitionFragment.startRecognition | ( | RecognitionOptions | recognitionOptions, |
IRecognitionListener | recognitionCallback | ||
) |
Starts the recognition process with the selected RecognitionOptions and IRecognitionListener
void com.pikkart.ar.recognition.RecognitionFragment.stopRecognition | ( | ) |
Stop the active recognition process manually without closing the camera.
void com.pikkart.ar.recognition.RecognitionFragment.changeRecognitionOptions | ( | RecognitionOptions | recognitionOptions | ) |
Changes the current RecognitionOptions without stopping the recognition process.
void com.pikkart.ar.recognition.RecognitionFragment.setMarkerCacheSize | ( | int | markerCacheSize | ) |
Set the max number of markers to keep locally.
If this limit is overcome the oldest accessed markers will be deleted in order to avoid a performance degradation.
Markers from local database will not be deleted even if overcome this limit.
boolean com.pikkart.ar.recognition.RecognitionFragment.isRecognitionActive | ( | ) |
Returns if the recognition is currently running.
|
static |
Returns if the Pikkart-AR SDK is currently tracking a marker.
|
static |
Returns the currently tracked marker.
|
static |
Returns the current projection matrix and make it available for rendering purpose.
|
static |
Returns the current modelview matrix and make it available for rendering purpose.
|
static |
Create a texture and render the current camera frame.
This method has to be called inside an OpenGL context and called whenever is necessary to update the current image.
It manages automatically creation, update and deletion of the texture.
Please refers to the tutorial if you want a better understanding of how to use this method.
viewportWidth | The width in pixels of the rendered camera image. |
viewportHeight | The height in pixels of the rendered camera image. |
angle | The current angle of rotation of the device. |
boolean com.pikkart.ar.recognition.RecognitionFragment.enableTorch | ( | ) |
Turn on the torch of the device.
boolean com.pikkart.ar.recognition.RecognitionFragment.disableTorch | ( | ) |
Turn off the torch of the device.
void com.pikkart.ar.recognition.RecognitionFragment.setFocusMode | ( | String | mode | ) |
Set the selected focus mode for the camera if available for the device.
Currently supported focus modes are FOCUS_MODE_MACRO, FOCUS_MODE_INFINITY, FOCUS_MODE_CONTINUOUS_VIDEO, FOCUS_MODE_AUTO included into Camera.Parameters class of the Android SDK.
mode | A string representing a focus mode included in Camera.Parameters. |
String com.pikkart.ar.recognition.RecognitionFragment.getFocusMode | ( | ) |
Retrieve the currently set focus mode.
Currently supported focus modes are FOCUS_MODE_MACRO, FOCUS_MODE_INFINITY, FOCUS_MODE_CONTINUOUS_VIDEO, FOCUS_MODE_AUTO included into Camera.Parameters class of the Android SDK.