CameraDevice class controls the camera device.
◆ flipVideo()
void com.maxst.ar.CameraDevice.flipVideo |
( |
FlipDirection |
direction, |
|
|
boolean |
toggle |
|
) |
| |
Flip the video background with respect to the given direction.
- Parameters
-
direction | the direction to be flipped. |
true | for flipping, false for undoing |
◆ getBackgroundPlaneInfo()
float [] com.maxst.ar.CameraDevice.getBackgroundPlaneInfo |
( |
| ) |
|
Get the coordinates of the background plane where a camera image is rendered.
- Returns
- the coordinates of the background plane
◆ getCameraApi()
CameraApi com.maxst.ar.CameraDevice.getCameraApi |
( |
| ) |
|
Get the current camera API.
- Returns
- CameraApi enumerator value
◆ getInstance()
static CameraDevice com.maxst.ar.CameraDevice.getInstance |
( |
| ) |
|
|
static |
◆ getMaxZoomValue()
int com.maxst.ar.CameraDevice.getMaxZoomValue |
( |
| ) |
|
Get the maximum zoom-in value supporting the camera device.
- Returns
- the maximum zoom-in value.
◆ getProjectionMatrix()
float [] com.maxst.ar.CameraDevice.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.
◆ isVideoFlipped()
boolean com.maxst.ar.CameraDevice.isVideoFlipped |
( |
FlipDirection |
direction | ) |
|
Get a boolean value representing whether the video background is flipped with respect to the given direction.
- Parameters
-
- Returns
- true if the video background is flipped with respect to the given direction.
◆ setARCoreTexture()
void com.maxst.ar.CameraDevice.setARCoreTexture |
( |
| ) |
|
Assign a texture to ARCore to get its camera image.
◆ setCameraApi()
void com.maxst.ar.CameraDevice.setCameraApi |
( |
CameraApi |
cameraApi | ) |
|
Select a camera API.
- Parameters
-
◆ setFlashLightMode()
boolean com.maxst.ar.CameraDevice.setFlashLightMode |
( |
boolean |
toggle | ) |
|
Turn on a flash light, or not.
- Parameters
-
true | for turning the light on, otherwise false. |
- Returns
- true if setting is successful.
◆ setZoom()
boolean com.maxst.ar.CameraDevice.setZoom |
( |
int |
zoomScale | ) |
|
Set a camera zoom scale.
- Parameters
-
- Returns
- true if setting is successful.
◆ start()
ResultCode com.maxst.ar.CameraDevice.start |
( |
int |
cameraId, |
|
|
int |
width, |
|
|
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
-
cameraId | 0 is a rear camera, 1 is a front camera. |
width | the preferable camera width. |
height | the preferable camera height. |
- Returns
- ResultCode concerning camera initialization.
◆ stop()
Stop a camera preview.
- Returns
- ResultCode concerning camera termination.