MaxstARSDK
MasCameraDevice Class Reference

class for camera device handling More...

#import <MasCameraDevice.h>

Inheritance diagram for MasCameraDevice:
Inheritance graph
Collaboration diagram for MasCameraDevice:
Collaboration graph

Instance Methods

(MasResultCode- start:width:height:
 Start camera preview. More...
 
(MasResultCode- start:
 
(void) - stop
 Stop camera preview. More...
 
(void) - setFusionEnable
 Set up the fusion camera. More...
 
(int) - getWidth
 Get Camera Width. More...
 
(int) - getHeight
 Get Camera Height. More...
 
(bool) - setFocusMode:
 Set Camera Focus. More...
 
(bool) - setZoom:
 Set Camera Zoom Scale. More...
 
(int) - getMaxZoomValue
 Get Camera Device Max Zoom value. More...
 
(bool) - setFlashLightMode:
 Turn on/off flash light. More...
 
(bool) - setAutoWhiteBalanceLock:
 Turn on/off auto white balance lock. More...
 
(void) - flipVideo:toggle:
 Flip video. More...
 
(void) - setClippingPlane:far:
 Set near, far plane. More...
 
(bool) - isFlipHorizontal
 Check Screen is Horizontal. More...
 
(bool) - isFlipVertical
 Check Screen is Vertical. More...
 
(void) - setCalibrationData:
 Set Parameter Value. More...
 
(void) - setNewFrame:length:width:height:format:
 Set new image data for tracking and background rendering (Free, Enterprise license key can activate this interface) More...
 
(void) - setNewFrameAndTimestamp:length:width:height:format:timestamp:
 Set new image data for tracking and background rendering (Free, Enterprise license key can activate this interface) More...
 
(matrix_float4x4) - getProjectionMatrix
 Get projection matrix. This is used for augmented objects projection and background rendering. More...
 
(matrix_float4x4) - getBackgroundPlaneProjectionMatrix
 Get projection matrix for background plane rendering. More...
 
(float *) - getBackgroundPlaneInfo
 Get background scale info for background plane rendering. More...
 
(NSString *) - getCameraIntrinsic
 Get Camera Intrinsic. More...
 

Protected Types

enum  MasFocusMode : int { FOCUS_MODE_CONTINUOUS_AUTO = 1 , FOCUS_MODE_AUTO = 2 }
 Camera focus mode @constant FOCUS_MODE_CONTINUOUS_AUTO Continuous focus mode. This focus mode is proper for AR @constant FOCUS_MODE_AUTO Scingle auto focus mode. More...
 
enum  MasFlipDirection : int { HORIZONTAL = 0 , VERTICAL = 1 }
 Video data flip direction @constant HORIZONTAL Flip video horizontally @constant VERTICAL Flip video vertically. More...
 
enum  MasResultCode : int {
  Success = 0 , CameraPermissionIsNotResolved = 100 , CameraDevicedRestriced = 101 , CameraPermissionIsNotGranted = 102 ,
  CameraAlreadyOpened = 103 , TrackerAlreadyStarted = 200 , UnknownError = 1000
}
 Camera Open State @constant Success @constant CameraPermissionIsNotResolved @constant CameraDevicedRestriced @constant CameraPermissionIsNotGranted @constant CameraAlreadyOpened @constant TrackerAlreadyStarted @constant UnknownError. More...
 

Detailed Description

class for camera device handling

Member Enumeration Documentation

◆ MasFlipDirection

- (enum MasFlipDirection) :
protected

Video data flip direction @constant HORIZONTAL Flip video horizontally @constant VERTICAL Flip video vertically.

Enumerator
HORIZONTAL 
VERTICAL 

◆ MasFocusMode

- (enum MasFocusMode) :
protected

Camera focus mode @constant FOCUS_MODE_CONTINUOUS_AUTO Continuous focus mode. This focus mode is proper for AR @constant FOCUS_MODE_AUTO Scingle auto focus mode.

Enumerator
FOCUS_MODE_CONTINUOUS_AUTO 
FOCUS_MODE_AUTO 

◆ MasResultCode

- (enum MasResultCode) :
protected

Camera Open State @constant Success @constant CameraPermissionIsNotResolved @constant CameraDevicedRestriced @constant CameraPermissionIsNotGranted @constant CameraAlreadyOpened @constant TrackerAlreadyStarted @constant UnknownError.

Enumerator
Success 
CameraPermissionIsNotResolved 
CameraDevicedRestriced 
CameraPermissionIsNotGranted 
CameraAlreadyOpened 
TrackerAlreadyStarted 
UnknownError 

Method Documentation

◆ flipVideo:toggle:

- (void) flipVideo: (MasFlipDirection direction
toggle: (bool)  toggle 

Flip video.

Parameters
directionFlip direction
toggletrue for set, false for reset

◆ getBackgroundPlaneInfo

- (float *) getBackgroundPlaneInfo

Get background scale info for background plane rendering.

Returns
scale value.

◆ getBackgroundPlaneProjectionMatrix

- (matrix_float4x4) getBackgroundPlaneProjectionMatrix

Get projection matrix for background plane rendering.

Returns
4x4 matrix (Column major)

◆ getCameraIntrinsic

- (NSString *) getCameraIntrinsic

Get Camera Intrinsic.

Returns
{"width":width,"height":height,"fx":fx,"fy":fy,"px":px,"py":py} fx = focal length x, fy =focal length y, px = principal point x, py = principal point y

◆ getHeight

- (int) getHeight

Get Camera Height.

Returns
camera preview height

◆ getMaxZoomValue

- (int) getMaxZoomValue

Get Camera Device Max Zoom value.

Returns
Max Zoom value.

◆ getProjectionMatrix

- (matrix_float4x4) getProjectionMatrix

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

Returns
4x4 matrix (Column major)

◆ getWidth

- (int) getWidth

Get Camera Width.

Returns
camera preview width

◆ isFlipHorizontal

- (bool) isFlipHorizontal

Check Screen is Horizontal.

Returns
return Horizontal value.

◆ isFlipVertical

- (bool) isFlipVertical

Check Screen is Vertical.

Returns
return Vertical value.

◆ setAutoWhiteBalanceLock:

- (bool) setAutoWhiteBalanceLock: (bool)  toggle

Turn on/off auto white balance lock.

◆ setCalibrationData:

- (void) setCalibrationData: (NSString *)  filePath

Set Parameter Value.

Parameters
filePathParameter file Path.

◆ setClippingPlane:far:

- (void) setClippingPlane: (float)  near
far: (float)  far 

Set near, far plane.

Parameters
nearnear plane value
farfar plane value

◆ setFlashLightMode:

- (bool) setFlashLightMode: (bool)  toggle

Turn on/off flash light.

◆ setFocusMode:

- (bool) setFocusMode: (MasFocusMode mode

Set Camera Focus.

Returns
true if focus setting success

◆ setFusionEnable

- (void) setFusionEnable

Set up the fusion camera.

◆ setNewFrame:length:width:height:format:

- (void) setNewFrame: (Byte *)  data
length: (int)  length
width: (int)  width
height: (int)  height
format: (MasColorFormat)  format 

Set new image data for tracking and background rendering (Free, Enterprise license key can activate this interface)

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

◆ setNewFrameAndTimestamp:length:width:height:format:timestamp:

- (void) setNewFrameAndTimestamp: (Byte *)  data
length: (int)  length
width: (int)  width
height: (int)  height
format: (MasColorFormat)  format
timestamp: (unsigned long long int)  timestamp 

Set new image data for tracking and background rendering (Free, Enterprise license key can activate this interface)

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

◆ setZoom:

- (bool) setZoom: (float)  zoomScale

Set Camera Zoom Scale.

Parameters
zoomScaleZoom value
Returns
result Zoom.

◆ start:

- (MasResultCode) start: (NSString *)  path

◆ start:width:height:

- (MasResultCode) start: (int)  cameraId
width: (int)  width
height: (int)  height 

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
MasResultCode

◆ stop

- (void) stop

Stop camera preview.


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