All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
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.
 
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.
 
VuResult vuCameraControllerGetFlashMode (const VuController *controller, VuBool *flashMode)
 Get the current flash mode of the camera.
 
VuResult vuCameraControllerSetFlashMode (VuController *controller, VuBool flashMode)
 Set the flash mode of the camera.
 
VuResult vuCameraControllerIsFlashModeSupported (VuController *controller, VuBool *isFlashModeSupported)
 Check if setting the flash mode is supported on the current device and camera.
 
VuResult vuCameraControllerGetFocusMode (const VuController *controller, VuCameraFocusMode *focusMode)
 Get the current focus mode of the camera.
 
VuResult vuCameraControllerSetFocusMode (VuController *controller, VuCameraFocusMode focusMode)
 Set the focus mode of the camera.
 
VuResult vuCameraControllerGetExposureMode (const VuController *controller, VuCameraExposureMode *exposureMode)
 Get the current exposure mode of the camera.
 
VuResult vuCameraControllerSetExposureMode (VuController *controller, VuCameraExposureMode exposureMode)
 Set the exposure mode of the camera.
 
VuResult vuCameraControllerIsFocusModeSupported (VuController *controller, VuCameraFocusMode focusMode, VuBool *isFocusModeSupported)
 Check if setting a specific focus mode is supported on the current device.
 
VuResult vuCameraControllerIsExposureModeSupported (VuController *controller, VuCameraExposureMode exposureMode, VuBool *isExposureModeSupported)
 Check if setting a specific exposure mode is supported on the current device.
 
VuResult vuCameraControllerGetFocusRegion (const VuController *controller, VuCameraRegionOfInterest *focusROI)
 Get the region of interest currently active for camera focus control.
 
VuResult vuCameraControllerSetFocusRegion (VuController *controller, VuCameraRegionOfInterest focusROI)
 Set the active region of interest for camera focus control.
 
VuResult vuCameraControllerGetExposureRegion (const VuController *controller, VuCameraRegionOfInterest *exposureROI)
 Get the region of interest currently active for camera exposure control.
 
VuResult vuCameraControllerSetExposureRegion (VuController *controller, VuCameraRegionOfInterest exposureROI)
 Set the active region of interest for camera exposure control.
 
VuResult vuCameraControllerIsFocusRegionSupported (const VuController *controller, VuBool *isFocusRegionSupported)
 Check if setting a focus region is supported on the current device.
 
VuResult vuCameraControllerIsExposureRegionSupported (const VuController *controller, VuBool *isExposureRegionSupported)
 Check if setting an exposure region is supported on the current device.
 
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 a video pixel format to be delivered in the list of images of a camera frame.
 
VuResult vuCameraControllerUnregisterImageFormat (VuController *controller, VuImagePixelFormat format)
 Unregister a video pixel format from being delivered in the list of images of a camera frame.
 
VuResult vuCameraControllerIsDepthSupported (const VuController *controller, VuBool *supported)
 Check if depth frames are supported on this device.
 
VuResult vuCameraControllerEnableDepth (VuController *controller)
 Enable depth frames.
 
VuResult vuCameraControllerDisableDepth (VuController *controller)
 Disable depth frames.
 
VuBool vuCameraControllerIsDepthEnabled (const VuController *controller)
 Check if depth frames are currently enabled.
 

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 or Engine is not running

◆ 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 or Engine is not running

◆ vuCameraControllerIsFlashModeSupported()

VuResult vuCameraControllerIsFlashModeSupported ( VuController * controller,
VuBool * isFlashModeSupported )

Check if setting the flash mode is supported on the current device and camera.

Note
This function can only be called while Vuforia Engine is running
On Android devices flash mode support requires ARCore version 1.45 or newer
When this function returns VU_FALSE in 'isFlashModeSupported', calls to setting and getting the respective flash mode will fail.
Returns
VU_SUCCESS on success or VU_FAILED if Vuforia Engine is not running

◆ 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 a video pixel format to be delivered in the list of images of a camera frame.

For a registered video pixel format an image will be converted from the native video pixel format of the camera on each state update and delivered in the list of images of the VuCameraFrame. The list of images can be queried via vuCameraFrameGetImages.

By default only the image with the native video pixel format of the camera will be delivered. The native video pixel format can be queried via vuCameraControllerGetVideoModes in field VuCameraVideoMode::format.

Note
Please note that not all video pixel formats can be registered as the supported conversions depend on the native pixel format. Registration will fail if the conversion from the native pixel format to the requested video pixel format is not supported.
This function supports only the registration of video pixel formats. Registration of depth pixel formats (see VuImagePixelFormat) will fail. Please refer to vuCameraControllerEnableDepth for enabling the delivery of depth frames.
This function can only be called while Engine is running.
Will fail if the given video pixel format is already registered.
See also
vuCameraControllerUnregisterImageFormat

◆ vuCameraControllerUnregisterImageFormat()

VuResult vuCameraControllerUnregisterImageFormat ( VuController * controller,
VuImagePixelFormat format )

Unregister a video pixel format from being delivered in the list of images of a camera frame.

Unregistering a video pixel format will stop Engine from delivering (and potentially converting to) an image of the given video pixel format on each state update in the list of images of the VuCameraFrame.

Note
This function supports only the deregistration of video pixel formats. Deregistration of depth pixel formats (see VuImagePixelFormat) will fail. Please refer to vuCameraControllerDisableDepth for disabling the delivery of depth frames.
This function can only be called while Engine is running.
Will fail if the given video pixel format is not registered.
See also
vuCameraControllerRegisterImageFormat

◆ vuCameraControllerIsDepthSupported()

VuResult vuCameraControllerIsDepthSupported ( const VuController * controller,
VuBool * supported )

Check if depth frames are supported on this device.

Note
This function is part of an API in beta and may change from release-to-release without notice.

◆ vuCameraControllerEnableDepth()

VuResult vuCameraControllerEnableDepth ( VuController * controller)

Enable depth frames.

Note
This will fail if depth frames are not supported on this device (see vuCameraControllerIsDepthSupported) or depth frames have already been enabled (see vuCameraControllerIsDepthEnabled).
Enabling depth frames may impact the performance of your App and may also increase the power consumption of your device.
The depth frames setting is retained across Vuforia Engine stop/start, for instance when an App is paused and then resumed.
This function is part of a feature in beta and may change from release to release without notice.
Returns
VU_SUCCESS if call was successful, otherwise VU_FAILED

◆ vuCameraControllerDisableDepth()

VuResult vuCameraControllerDisableDepth ( VuController * controller)

Disable depth frames.

Note
This will fail if depth frames are not currently enabled (see vuCameraControllerIsDepthEnabled).
This function is part of a feature in beta and may change from release to release without notice.
Returns
VU_SUCCESS if call was successful, otherwise VU_FAILED

◆ vuCameraControllerIsDepthEnabled()

VuBool vuCameraControllerIsDepthEnabled ( const VuController * controller)

Check if depth frames are currently enabled.

Note
This function is part of a feature in beta and may change from release to release without notice.