C API Unity API
C API Reference (Version 10.22.5)
Camera Controller

Classes

struct  VuCameraRegionOfInterest
 Data structure for setting and getting focus and exposure regions of interest in the camera image. More...
 
struct  VuCameraVideoMode
 Camera video mode description. More...
 

Typedefs

typedef struct VuCameraVideoModeList_ VuCameraVideoModeList
 List of video modes available for a camera.
 

Enumerations

enum  VuCameraVideoModePreset : int32_t {
  VU_CAMERA_VIDEO_MODE_PRESET_DEFAULT = 0x1,
  VU_CAMERA_VIDEO_MODE_PRESET_OPTIMIZE_SPEED = 0x2,
  VU_CAMERA_VIDEO_MODE_PRESET_OPTIMIZE_QUALITY = 0x3
}
 Supported camera video mode presets. More...
 
enum  VuCameraFocusMode : int32_t {
  VU_CAMERA_FOCUS_MODE_UNKNOWN = 0x1,
  VU_CAMERA_FOCUS_MODE_TRIGGERAUTO = 0x3,
  VU_CAMERA_FOCUS_MODE_CONTINUOUSAUTO = 0x4,
  VU_CAMERA_FOCUS_MODE_INFINITY = 0x5,
  VU_CAMERA_FOCUS_MODE_MACRO = 0x6,
  VU_CAMERA_FOCUS_MODE_FIXED = 0x7
}
 Supported camera focus modes. More...
 
enum  VuCameraExposureMode : int32_t {
  VU_CAMERA_EXPOSURE_MODE_UNKNOWN = 0x1,
  VU_CAMERA_EXPOSURE_MODE_TRIGGERAUTO = 0x2,
  VU_CAMERA_EXPOSURE_MODE_CONTINUOUSAUTO = 0x3,
  VU_CAMERA_EXPOSURE_MODE_FIXED = 0x4
}
 Supported camera exposure modes. More...
 

Functions

VuResult vuEngineGetCameraController (const VuEngine *engine, VuController **controller)
 Retrieve Camera Controller to get access to camera-specific functionality in Engine.
 
VuResult vuCameraControllerGetVideoModes (const VuController *controller, VuCameraVideoModeList *cameraVideoModeList)
 Get all the supported video modes for the camera. More...
 
VuResult vuCameraVideoModeListCreate (VuCameraVideoModeList **list)
 Create a camera video mode list.
 
VuResult vuCameraVideoModeListGetSize (const VuCameraVideoModeList *list, int32_t *listSize)
 Get number of elements in a camera video mode list.
 
VuResult vuCameraVideoModeListGetElement (const VuCameraVideoModeList *list, int32_t element, VuCameraVideoMode *videoMode)
 Get an element in a camera video mode list.
 
VuResult vuCameraVideoModeListDestroy (VuCameraVideoModeList *list)
 Destroy a camera video mode list.
 
VuResult vuCameraControllerGetActiveVideoMode (const VuController *controller, VuCameraVideoModePreset *cameraVideoModePreset)
 Get the the currently active video mode of the camera.
 
VuResult vuCameraControllerSetActiveVideoMode (VuController *controller, VuCameraVideoModePreset cameraVideoModePreset)
 Set the current video mode of the camera from the list of supported presets. More...
 
VuResult vuCameraControllerGetFlashMode (const VuController *controller, VuBool *flashMode)
 Get the current flash mode of the camera. More...
 
VuResult vuCameraControllerSetFlashMode (VuController *controller, VuBool flashMode)
 Set the flash mode of the camera. More...
 
VuResult vuCameraControllerGetFocusMode (const VuController *controller, VuCameraFocusMode *focusMode)
 Get the current focus mode of the camera. More...
 
VuResult vuCameraControllerSetFocusMode (VuController *controller, VuCameraFocusMode focusMode)
 Set the focus mode of the camera. More...
 
VuResult vuCameraControllerGetExposureMode (const VuController *controller, VuCameraExposureMode *exposureMode)
 Get the current exposure mode of the camera. More...
 
VuResult vuCameraControllerSetExposureMode (VuController *controller, VuCameraExposureMode exposureMode)
 Set the exposure mode of the camera. More...
 
VuResult vuCameraControllerIsFocusModeSupported (VuController *controller, VuCameraFocusMode focusMode, VuBool *isFocusModeSupported)
 Check if setting a specific focus mode is supported on the current device. More...
 
VuResult vuCameraControllerIsExposureModeSupported (VuController *controller, VuCameraExposureMode exposureMode, VuBool *isExposureModeSupported)
 Check if setting a specific exposure mode is supported on the current device. More...
 
VuResult vuCameraControllerGetFocusRegion (const VuController *controller, VuCameraRegionOfInterest *focusROI)
 Get the region of interest currently active for camera focus control. More...
 
VuResult vuCameraControllerSetFocusRegion (VuController *controller, VuCameraRegionOfInterest focusROI)
 Set the active region of interest for camera focus control. More...
 
VuResult vuCameraControllerGetExposureRegion (const VuController *controller, VuCameraRegionOfInterest *exposureROI)
 Get the region of interest currently active for camera exposure control. More...
 
VuResult vuCameraControllerSetExposureRegion (VuController *controller, VuCameraRegionOfInterest exposureROI)
 Set the active region of interest for camera exposure control. More...
 
VuResult vuCameraControllerIsFocusRegionSupported (const VuController *controller, VuBool *isFocusRegionSupported)
 Check if setting a focus region is supported on the current device. More...
 
VuResult vuCameraControllerIsExposureRegionSupported (const VuController *controller, VuBool *isExposureRegionSupported)
 Check if setting an exposure region is supported on the current device. More...
 
VuResult vuCameraControllerGetRegisteredImageFormats (const VuController *controller, VuImagePixelFormatList *list)
 Get list of image formats registered to be returned with the camera frame.
 
VuResult vuCameraControllerRegisterImageFormat (VuController *controller, VuImagePixelFormat format)
 Register an image format to be returned with the camera frame. More...
 
VuResult vuCameraControllerUnregisterImageFormat (VuController *controller, VuImagePixelFormat format)
 Unregister an image format to be returned with the camera frame. More...
 

Detailed Description

This controller allows the control of camera features such as configuring the video mode, focus mode, exposure mode, flash mode or accessing advanced camera properties.

Enumeration Type Documentation

◆ VuCameraVideoModePreset

enum VuCameraVideoModePreset : int32_t

Supported camera video mode presets.

Enumerator
VU_CAMERA_VIDEO_MODE_PRESET_DEFAULT 

Default camera mode.

VU_CAMERA_VIDEO_MODE_PRESET_OPTIMIZE_SPEED 

Fast camera mode. Camera mode that reduces the system resource impact of Vuforia Engine at the cost of lower image and/or tracking quality.

VU_CAMERA_VIDEO_MODE_PRESET_OPTIMIZE_QUALITY 

High-quality camera mode. Camera mode that maximizes image and tracking quality at the cost of higher system resource impact.

◆ VuCameraFocusMode

enum VuCameraFocusMode : int32_t

Supported camera focus modes.

Enumerator
VU_CAMERA_FOCUS_MODE_UNKNOWN 

Unknown focus mode.

VU_CAMERA_FOCUS_MODE_TRIGGERAUTO 

Focus mode to trigger a single auto-focus operation.

VU_CAMERA_FOCUS_MODE_CONTINUOUSAUTO 

Continuous auto-focus mode.

VU_CAMERA_FOCUS_MODE_INFINITY 

Focus set to infinity.

VU_CAMERA_FOCUS_MODE_MACRO 

Macro mode for close-up focus.

VU_CAMERA_FOCUS_MODE_FIXED 

Fixed focus mode.

◆ VuCameraExposureMode

enum VuCameraExposureMode : int32_t

Supported camera exposure modes.

Enumerator
VU_CAMERA_EXPOSURE_MODE_UNKNOWN 

Unknown exposure mode.

VU_CAMERA_EXPOSURE_MODE_TRIGGERAUTO 

Exposure mode to trigger a single auto-exposure operation.

VU_CAMERA_EXPOSURE_MODE_CONTINUOUSAUTO 

Continuous auto-exposure mode.

VU_CAMERA_EXPOSURE_MODE_FIXED 

Fixed exposure mode.

Function Documentation

◆ vuCameraControllerGetVideoModes()

VuResult vuCameraControllerGetVideoModes ( const VuController controller,
VuCameraVideoModeList cameraVideoModeList 
)

Get all the supported video modes for the camera.

Note
If this is called before the engine is started, the camera will be accessed which may be a longer-running operation on some platforms

◆ vuCameraControllerSetActiveVideoMode()

VuResult vuCameraControllerSetActiveVideoMode ( VuController controller,
VuCameraVideoModePreset  cameraVideoModePreset 
)

Set the current video mode of the camera from the list of supported presets.

Note
This function can only be called before the engine is started. To change the video mode after the engine is started, stop the engine, then change the video mode and restart it again.

◆ vuCameraControllerGetFlashMode()

VuResult vuCameraControllerGetFlashMode ( const VuController controller,
VuBool flashMode 
)

Get the current flash mode of the camera.

Note
This function can only be called while the engine is running
This function will output the current value as it is reported by the device
Returns
VU_SUCCESS on success or VU_FAILED if this operation is not supported on the current device

◆ vuCameraControllerSetFlashMode()

VuResult vuCameraControllerSetFlashMode ( VuController controller,
VuBool  flashMode 
)

Set the flash mode of the camera.

Note
This function can only be called while the engine is running
Setting the flash mode might not take effect immediately. Depending on the platform it may take up to a few hundred milliseconds until the change is applied after this function returns. Use vuCameraControllerGetFlashMode to query the current state as it is reported by the device.
The flash mode is retained across Vuforia Engine stop/start, for instance when an App is paused and then resumed.
Returns
VU_SUCCESS on success or VU_FAILED if this operation is not supported on the current device

◆ vuCameraControllerGetFocusMode()

VuResult vuCameraControllerGetFocusMode ( const VuController controller,
VuCameraFocusMode focusMode 
)

Get the current focus mode of the camera.

Note
This function can only be called while Vuforia Engine is running
This function will output the current value as it is reported by the device
Returns
VU_SUCCESS on success or VU_FAILED if this operation is not supported on the current device or Vuforia Engine is not running

◆ vuCameraControllerSetFocusMode()

VuResult vuCameraControllerSetFocusMode ( VuController controller,
VuCameraFocusMode  focusMode 
)

Set the focus mode of the camera.

Note
This function can only be called while Vuforia Engine is running
Setting the focus mode might not take effect immediately. Depending on the platform it may take up to a few hundred milliseconds until the change is applied after this function returns. Use vuCameraControllerGetFocusMode to query the current state as it is reported by the device.
Changing the focus might have a negative effect on the performance of Vuforia tracking, in particular when applying more extreme changes.
The focus mode is retained across Vuforia Engine stop/start, for instance when an App is paused and then resumed, EXCEPT for the case where the focus mode has changed to VU_CAMERA_FOCUS_MODE_FIXED as a result of VU_CAMERA_FOCUS_MODE_TRIGGERAUTO, in which case the focus mode will be set to VU_CAMERA_FOCUS_MODE_CONTINUOUSAUTO on resume.
Returns
VU_SUCCESS on success or VU_FAILED if this operation or the requested focus mode is not supported on the current device, or Vuforia Engine is not running

◆ vuCameraControllerGetExposureMode()

VuResult vuCameraControllerGetExposureMode ( const VuController controller,
VuCameraExposureMode exposureMode 
)

Get the current exposure mode of the camera.

Note
This function can only be called while Vuforia Engine is running
This function will output the current value as it is reported by the device
Returns
VU_SUCCESS on success or VU_FAILED if this operation is not supported on the current device or Vuforia Engine is not running

◆ vuCameraControllerSetExposureMode()

VuResult vuCameraControllerSetExposureMode ( VuController controller,
VuCameraExposureMode  exposureMode 
)

Set the exposure mode of the camera.

Note
This function can only be called while Vuforia Engine is running
Setting the exposure mode might not take effect immediately. Depending on the platform it may take up to a few hundred milliseconds until the change is applied after this function returns. Use vuCameraControllerGetExposureMode to query the current state as it is reported by the device.
Changing the exposure might have a negative effect on the performance of Vuforia tracking, in particular when applying more extreme changes.
Setting the exposure mode is not supported on all platforms and fusion providers, see vuCameraControllerIsExposureModeSupported.
The exposure mode is NOT retained across Vuforia Engine stop/start: for instance when an App is paused and then resumed, it will revert back to the default exposure mode.
Returns
VU_SUCCESS on success or VU_FAILED if this operation or the requested exposure mode is not supported on the current device, or Vuforia Engine is not running

◆ vuCameraControllerIsFocusModeSupported()

VuResult vuCameraControllerIsFocusModeSupported ( VuController controller,
VuCameraFocusMode  focusMode,
VuBool isFocusModeSupported 
)

Check if setting a specific focus mode is supported on the current device.

Note
This function can only be called while Vuforia Engine is running
When this function returns VU_FALSE in 'isFocusModeSupported' calls to setting the respective focus mode will fail.
Returns
VU_SUCCESS on success or VU_FAILED if Vuforia Engine is not running

◆ vuCameraControllerIsExposureModeSupported()

VuResult vuCameraControllerIsExposureModeSupported ( VuController controller,
VuCameraExposureMode  exposureMode,
VuBool isExposureModeSupported 
)

Check if setting a specific exposure mode is supported on the current device.

Note
This function can only be called while Vuforia Engine is running
When this function returns VU_FALSE in 'isExposureModeSupported' calls to setting the respective exposure mode will fail.
Returns
VU_SUCCESS on success or VU_FAILED if Vuforia Engine is not running

◆ vuCameraControllerGetFocusRegion()

VuResult vuCameraControllerGetFocusRegion ( const VuController controller,
VuCameraRegionOfInterest focusROI 
)

Get the region of interest currently active for camera focus control.

Note
This function can only be called while Vuforia Engine is running
Returns
VU_SUCCESS on success or VU_FAILED if this operation is not supported on the current device or Vuforia Engine is not running

◆ vuCameraControllerSetFocusRegion()

VuResult vuCameraControllerSetFocusRegion ( VuController controller,
VuCameraRegionOfInterest  focusROI 
)

Set the active region of interest for camera focus control.

Note
This will replace any previously set region
This function can only be called while Vuforia Engine is running
To restore the focus settings to the state before explicitly setting any focus region pass in a VuCameraRegionOfInterest with center = (0.5f, 0.5f) and extent = 1.0f
Setting the focus region is not supported on all platforms and fusion providers, see vuCameraControllerIsFocusRegionSupported.
If the region defined through VuCameraRegionOfInterest exceeds the bounds of the camera frame it will be clamped. The center point will also be adjusted accordingly to the centre of the clamped region. Example: Setting a region of center = (1.0f, 1.0f) and extent = 1.0f will result in a clamped region of center = (0.75f, 0.75f) and extent = 0.5f.
The focus region is NOT retained across Vuforia Engine stop/start: for instance when an App is paused and then resumed, it will revert back to the default focus region.
Returns
VU_SUCCESS on success or VU_FAILED if this operation is not supported on the current device or if the specified region is not in a valid range, or Vuforia Engine is not running

◆ vuCameraControllerGetExposureRegion()

VuResult vuCameraControllerGetExposureRegion ( const VuController controller,
VuCameraRegionOfInterest exposureROI 
)

Get the region of interest currently active for camera exposure control.

Note
This function can only be called while Vuforia Engine is running
Returns
VU_SUCCESS on success or VU_FAILED if this operation is not supported on the current device or Vuforia Engine is not running

◆ vuCameraControllerSetExposureRegion()

VuResult vuCameraControllerSetExposureRegion ( VuController controller,
VuCameraRegionOfInterest  exposureROI 
)

Set the active region of interest for camera exposure control.

Note
This will replace any previously set region
This function can only be called while Vuforia Engine is running
To restore the exposure settings to the state before explicitly setting any focus region pass in a VuCameraRegionOfInterest with center = (0.5f, 0.5f) and extent = 1.0f
Setting the exposure region is not supported on all platforms and fusion providers, see vuCameraControllerIsExposureRegionSupported.
If the region defined through VuCameraRegionOfInterest exceeds the bounds of the camera frame it will be clamped. The center point will also be adjusted accordingly to the centre of the clamped region. Example: Setting a region of center = (1.0f, 1.0f) and extent = 1.0f will result in a clamped region of center = (0.75f, 0.75f) and extent = 0.5f.
The exposure region is NOT retained across Vuforia Engine stop/start: for instance when an App is paused and then resumed, it will revert back to the default exposure region.
Returns
VU_SUCCESS on success or VU_FAILED if this operation is not supported on the current device or if the specified region is not in a valid range, or Vuforia Engine is not running

◆ vuCameraControllerIsFocusRegionSupported()

VuResult vuCameraControllerIsFocusRegionSupported ( const VuController controller,
VuBool isFocusRegionSupported 
)

Check if setting a focus region is supported on the current device.

Note
This function can only be called while Vuforia Engine is running
When this function returns VU_FALSE in 'isFocusRegionSupported' calls to getting and setting the focus region will fail.
Returns
VU_SUCCESS on success or VU_FAILED if Vuforia Engine is not running

◆ vuCameraControllerIsExposureRegionSupported()

VuResult vuCameraControllerIsExposureRegionSupported ( const VuController controller,
VuBool isExposureRegionSupported 
)

Check if setting an exposure region is supported on the current device.

Note
This function can only be called while Vuforia Engine is running
When this function returns VU_FALSE in 'isExposureRegionSupported' calls to getting and setting the exposure region will fail.
Returns
VU_SUCCESS on success or VU_FAILED if Vuforia Engine is not running

◆ vuCameraControllerRegisterImageFormat()

VuResult vuCameraControllerRegisterImageFormat ( VuController controller,
VuImagePixelFormat  format 
)

Register an image format to be returned with the camera frame.

Note
This function can only be called while the engine is running
Please note that not all formats can be registered as the supported conversions depend on the native camera format

◆ vuCameraControllerUnregisterImageFormat()

VuResult vuCameraControllerUnregisterImageFormat ( VuController controller,
VuImagePixelFormat  format 
)

Unregister an image format to be returned with the camera frame.

Note
This function can only be called while the engine is running