MaxstAR Native iOS  5.0.2
List of all members | Instance Methods | Protected Types
MasCameraDevice Class Reference

Description

MasCameraDevice class controls the camera device.

Inherits NSObject.

Instance Methods

(MasResultCode- start
 Start a camera preview. More...
 
(void) - stop
 Stop a camera preview. More...
 
(void) - setFusionEnable
 Enable ARKit for AR Fusion. More...
 
(bool) - setZoom
 Set a camera zoom scale. More...
 
(int) - getMaxZoomValue
 Get the maximum zoom-in value supporting the camera device. More...
 
(bool) - setFlashLightMode
 Turn on/off flash light. More...
 
(void) - flipVideo
 Flip the video background with respect to the given direction. More...
 
(bool) - isFlipHorizontal
 Get a boolean value representing whether the video background is flipped horizontally. More...
 
(bool) - isFlipVertical
 Get a boolean value representing whether the video background is flipped vertically. More...
 
(matrix_float4x4) - getProjectionMatrix
 Get a projection matrix for rendering 3d virtual objects. More...
 
(float *) - getBackgroundPlaneInfo
 Get the coordinates of the background plane where a camera image is rendered. More...
 

Member Enumeration Documentation

◆ MasFlipDirection

- (enum) MasFlipDirection
protected

Flip direction enumerator.

Enumerator
HORIZONTAL 

Horizontal Direction

VERTICAL 

Vertical Direction

◆ MasResultCode

- (enum) MasResultCode
protected

ResultCode enumerator related to camera and tracker.

Enumerator
Success 

Success

CameraPermissionIsNotResolved 

CameraPermissionIsNotResolved

CameraDevicedRestriced 

CameraDevicedRestriced

CameraPermissionIsNotGranted 

CameraPermissionIsNotGranted

CameraAlreadyOpened 

CameraAlreadyOpened

TrackerAlreadyStarted 

TrackerAlreadyStarted

UnknownError 

UnknownError

Method Documentation

◆ flipVideo

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

Flip the video background with respect to the given direction.

Parameters
directionthe direction to be flipped.
truefor flipping, false for undoing

◆ getBackgroundPlaneInfo

- (float *) getBackgroundPlaneInfo

Get the coordinates of the background plane where a camera image is rendered.

Returns
the coordinates of the background plane

◆ getMaxZoomValue

- (int) getMaxZoomValue

Get the maximum zoom-in value supporting the camera device.

Returns
the maximum zoom-in value.

◆ getProjectionMatrix

- (matrix_float4x4) getProjectionMatrix

Get a projection matrix for rendering 3d virtual objects.

MAXST AR obeys the right-handed coordinated system same as OpenGL.

Returns
a 4x4 projection matrix stored in column-major order.

◆ isFlipHorizontal

- (bool) isFlipHorizontal

Get a boolean value representing whether the video background is flipped horizontally.

Parameters
directionthe direction
Returns
true if the video background is flipped horizontally.

◆ isFlipVertical

- (bool) isFlipVertical

Get a boolean value representing whether the video background is flipped vertically.

Parameters
directionthe direction
Returns
true if the video background is flipped vertically.

◆ setFlashLightMode

- (bool) setFlashLightMode: (bool)  toggle

Turn on/off flash light.

◆ setFusionEnable

- (void) setFusionEnable

Enable ARKit for AR Fusion.

◆ setZoom

- (bool) setZoom: (float)  zoomScale

Set a camera zoom scale.

Parameters
zoomScalea zoom value
Returns
true if setting is successful.

◆ start

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

Start a camera preview.

After an AR tracker starts, camera frames is sequentially sent to the AR tracker. This method gets preferable camera width and height as parameters. If the camera device does not support the exact width and height, the most similar width and height are chosen.

Parameters
cameraId0 is a rear camera, 1 is a front camera.
widththe preferable camera width.
heightthe preferable camera height.
Returns
ResultCode concerning camera initialization.

◆ stop

- (void) stop

Stop a camera preview.

Returns
ResultCode concerning camera termination.