MaxstARSDK
maxstAR::CameraDevice Class Referenceabstract

class for camera device handling More...

#include <CameraDevice.h>

Collaboration diagram for maxstAR::CameraDevice:
Collaboration graph

Public Types

enum  FocusMode { FOCUS_MODE_CONTINUOUS_AUTO = 1, FOCUS_MODE_AUTO = 2 }
 Camera focus mode. More...
 
enum  FlipDirection { HORIZONTAL = 0, VERTICAL = 1 }
 Video data flip direction. More...
 

Public Member Functions

 CameraDevice ()
 
virtual ~CameraDevice ()
 
virtual ResultCode start (int cameraId, int width, int height)=0
 Start camera preview. More...
 
virtual void stop ()=0
 Stop camera preview. More...
 
virtual int getWidth ()=0
 
virtual int getHeight ()=0
 
virtual bool setFocusMode (FocusMode mode)=0
 
virtual bool setFlashLightMode (bool toggle)=0
 Turn on/off flash light. More...
 
virtual bool setAutoWhiteBalanceLock (bool toggle)=0
 Turn on/off auto white balance lock. More...
 
virtual void flipVideo (CameraDevice::FlipDirection direction, bool toggle)=0
 Flip video. More...
 
virtual std::list< std::string > getParamList ()=0
 Get supported parameter key list. More...
 
virtual bool setParam (std::string key, bool toggle)=0
 Set camera parameter (Android only supported now) More...
 
virtual bool setParam (std::string key, int value)=0
 Set camera parameter (Android only supported now) More...
 
virtual bool setParam (std::string key, int min, int max)=0
 Set camera parameter (Android only supported now) More...
 
virtual bool setParam (std::string key, std::string value)=0
 Set camera parameter (Android only supported now) More...
 
virtual void setNewFrame (Byte *data, int length, int width, int height, ColorFormat format)=0
 Set new image data for tracking and background rendering (Only enterprise license key can activate this interface) More...
 
virtual float * getProjectionMatrix ()=0
 Get projection matrix. This is used for augmented objects projection and background rendering. More...
 
virtual const float * getBackgroundPlaneProjectionMatrix ()=0
 Get projection matrix for background plane rendering. More...
 

Static Public Member Functions

static CameraDevicegetInstance ()
 get class instance More...
 

Detailed Description

class for camera device handling

Member Enumeration Documentation

◆ FlipDirection

Video data flip direction.

Enumerator
HORIZONTAL 
VERTICAL 

◆ FocusMode

Camera focus mode.

Enumerator
FOCUS_MODE_CONTINUOUS_AUTO 
FOCUS_MODE_AUTO 

Constructor & Destructor Documentation

◆ CameraDevice()

maxstAR::CameraDevice::CameraDevice ( )
inline

◆ ~CameraDevice()

virtual maxstAR::CameraDevice::~CameraDevice ( )
inlinevirtual

Member Function Documentation

◆ flipVideo()

virtual void maxstAR::CameraDevice::flipVideo ( CameraDevice::FlipDirection  direction,
bool  toggle 
)
pure virtual

Flip video.

Parameters
directionFlip direction
toggletrue for set, false for reset

◆ getBackgroundPlaneProjectionMatrix()

virtual const float* maxstAR::CameraDevice::getBackgroundPlaneProjectionMatrix ( )
pure virtual

Get projection matrix for background plane rendering.

Returns
4x4 gl matrix (Column major)

◆ getHeight()

virtual int maxstAR::CameraDevice::getHeight ( )
pure virtual
Returns
camera preview height

◆ getInstance()

static CameraDevice* maxstAR::CameraDevice::getInstance ( )
static

get class instance

◆ getParamList()

virtual std::list<std::string> maxstAR::CameraDevice::getParamList ( )
pure virtual

Get supported parameter key list.

Returns
Parameter key list

◆ getProjectionMatrix()

virtual float* maxstAR::CameraDevice::getProjectionMatrix ( )
pure virtual

Get projection matrix. This is used for augmented objects projection and background rendering.

Returns
4x4 gl matrix (Column major)

◆ getWidth()

virtual int maxstAR::CameraDevice::getWidth ( )
pure virtual
Returns
camera preview width

◆ setAutoWhiteBalanceLock()

virtual bool maxstAR::CameraDevice::setAutoWhiteBalanceLock ( bool  toggle)
pure virtual

Turn on/off auto white balance lock.

◆ setFlashLightMode()

virtual bool maxstAR::CameraDevice::setFlashLightMode ( bool  toggle)
pure virtual

Turn on/off flash light.

◆ setFocusMode()

virtual bool maxstAR::CameraDevice::setFocusMode ( FocusMode  mode)
pure virtual
Returns
true if focus setting success

◆ setNewFrame()

virtual void maxstAR::CameraDevice::setNewFrame ( Byte data,
int  length,
int  width,
int  height,
ColorFormat  format 
)
pure virtual

Set new image data for tracking and background rendering (Only enterprise license key can activate this interface)

Parameters
dataimage data bytes.
lengthimage length
widthimage width
heightimage height
formatimage format

◆ setParam() [1/4]

virtual bool maxstAR::CameraDevice::setParam ( std::string  key,
bool  toggle 
)
pure virtual

Set camera parameter (Android only supported now)

Parameters
keyParameter key
toggleParameter value
Returns
True if setting success

◆ setParam() [2/4]

virtual bool maxstAR::CameraDevice::setParam ( std::string  key,
int  value 
)
pure virtual

Set camera parameter (Android only supported now)

Parameters
keyParameter key
valueParameter value
Returns
True if setting success

◆ setParam() [3/4]

virtual bool maxstAR::CameraDevice::setParam ( std::string  key,
int  min,
int  max 
)
pure virtual

Set camera parameter (Android only supported now)

Parameters
keyParameter key
minParameter min value
maxParameter max value
Returns
True if setting success

◆ setParam() [4/4]

virtual bool maxstAR::CameraDevice::setParam ( std::string  key,
std::string  value 
)
pure virtual

Set camera parameter (Android only supported now)

Parameters
keyParameter key
valueParameter value
Returns
True if setting success

◆ start()

virtual ResultCode maxstAR::CameraDevice::start ( int  cameraId,
int  width,
int  height 
)
pure virtual

Start camera preview.

Parameters
cameraId0 is rear camera, 1 is face camera. camera index may depends on device.
widthprefer camera width
heightprefer camera height
Returns
0 : camera open success others : camera open fails

◆ stop()

virtual void maxstAR::CameraDevice::stop ( )
pure virtual

Stop camera preview.


The documentation for this class was generated from the following file: