Pikkart-AR SDK  3.5
Android SDK References
com.pikkart.ar.recognition.CameraManager Class Reference

Manages the camera lifetime.

Inherits PreviewCallback.

Inherited by com.pikkart.ar.recognition.RecognitionManager.

Public Member Functions

 CameraManager (Fragment parent)
 Constructor.
 
boolean isRecognitionRunning ()
 To be overridden by derivative classes (i.e. RecognitionManager)
 
void onPreviewFrame (byte[] data, Camera camera)
 callback from the camera on a new frame capture
 
void onCreate ()
 on app onCreate create buffers, surfaceTetures etc... App onCreate need to be forwarded here
 
boolean onTouch (View v, MotionEvent event)
 app onTouch App onTouch need to be forwarded here
 
void onResume ()
 app onResume: open and init camera App onResume need to be forwarded here
 
void onDestroy ()
 app onDestroy: destroy buffers App onDestroy need to be forwarded here
 
void onPause ()
 app onPause: stop camera preview and release resources App onPause need to be forwarded here
 
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...
 

Protected Member Functions

void initCamera () throws IOException
 Init the android camera.
 
void createFocusTimer ()
 Create timers for our custom focus mode.
 
void computeAvgRowsValues ()
 support function for our custom focus mode
 
Camera openCamera ()
 open android camera
 

Protected Attributes

Camera _camera = null
 The Android Camera.
 
ByteBuffer [] _frameData = null
 Circular ByteBuffers for the frame data.
 
SurfaceTexture _surface
 Placeholder surface texture for the camera.
 
int frames = 0
 frame counter.
 
String saved_focus_mode = FOCUS_MODE_CENTER
 requested focus mode.
 
int _cameraID
 Active camera id.
 
boolean _tapToFocusActive
 FOCUS_MODE_CENTER_W_TAP, taptoFocus is active.
 
boolean _focusAtCenterActive
 our custom focusing is active.
 
boolean _checkfocus
 Flag variable changed by the focustimer.
 
Timer _focusTimer
 focus timer.
 
boolean _focusStep1
 Flag variable, Step1: movement detected.
 
boolean _isTracking
 ARNativeWrapper currently tracking.
 
int _nframesSteady
 Number of consecutive frames of steady device.
 
float _avgRowsValuesLastFocus []
 Avg values of image rows taken at last focus.
 
float _avgRowsValuesPrev []
 Avg values of image rows taken at last frame.
 
Fragment _parent = null
 Parent fragment.
 

Member Function Documentation

◆ enableTorch()

boolean com.pikkart.ar.recognition.CameraManager.enableTorch ( )

Turn on the torch of the device.

Returns
true if the device provides a torch, false otherwise

◆ disableTorch()

boolean com.pikkart.ar.recognition.CameraManager.disableTorch ( )

Turn off the torch of the device.

Returns
true if the device provides a torch, false otherwise

◆ setFocusMode()

void com.pikkart.ar.recognition.CameraManager.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.

Parameters
modeA string representing a focus mode included in Camera.Parameters.

◆ getFocusMode()

String com.pikkart.ar.recognition.CameraManager.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.

Returns
A String representing the currently set focus mode .