C API Unity API
Unity API Reference (Version 10.22.5)
CameraDevice Class Reference

Represents the physical camera used to capture the real world More...

Classes

class  HoloLensDevice
 HoloLens specific camera functionality More...
 
class  WebCamDevice
 WebCam specific camera functionality More...
 

Public Member Functions

Vector2 GetCameraFieldOfViewRads ()
 Get the field of view for the active camera. This is a Vector2 containing the x- and y- components of the FOV in radians. If the value cannot be obtained for some reason, then Vector2.zero will be returned More...
 
Image GetCameraImage (PixelFormat format)
 Returns a camera image from the current Vuforia State for the requested format. Returns null if this image is not available. You must call SetFrameFormat before accessing the corresponding camera image. More...
 
Intrinsics GetCameraIntrinsics ()
 Returns the camera intrinsics from the current Vuforia State. More...
 
CameraRegionOfInterest GetExposureRegion ()
 Get the region of interest currently active for auto-exposure More...
 
CameraRegionOfInterest GetFocusRegion ()
 Get the region of interest currently active for auto-focus More...
 
int GetRecommendedFPS ()
 Returns the current framerate of the camera, which is what's recommended as the framerate cap of the application in most cases More...
 
Rect GetVideoBackgroundRectInViewPort ()
 The area in the viewport that is covered by the video background. More...
 
VideoModeData GetVideoMode ()
 Get the video mode data that matches the selected CameraMode. More...
 
VideoModeData GetVideoMode (CameraMode mode)
 Get the video mode data that matches the given CameraMode. More...
 
bool IsExposureModeSupported (ExposureMode exposureMode)
 Check if setting a specific exposure mode is supported on the current device More...
 
bool IsFocusModeSupported (FocusMode focusMode)
 Check if setting a specific focus mode is supported on the current device More...
 
bool SetCameraMode (CameraMode mode)
 Set the current camera mode which which preferences either quality or speed This can only be called before starting Vuforia, otherwise returns false More...
 
bool SetExposureMode (ExposureMode exposureMode)
 Set the active exposure mode. Returns false if this mode is not available or can't be activated. More...
 
bool SetExposureRegion (CameraRegionOfInterest regionOfInterest)
 Set the active region of interest for auto-exposure More...
 
bool SetFlash (bool on)
 Activate or deactivate the camera device flash. Returns false if flash is not available or can't be activated. More...
 
bool SetFocusMode (FocusMode focusMode)
 Set the active focus mode. Returns false if this mode is not available or can't be activated. More...
 
bool SetFocusRegion (CameraRegionOfInterest regionOfInterest)
 Set the active region of interest for auto-focus More...
 
bool SetFrameFormat (PixelFormat format, bool enabled)
 Enables or disables the request of the camera image in the desired pixel format. Returns true on success, false otherwise. Note that this may result in processing overhead. Image is accessed using GetCameraImage. Note that there may be a delay of several frames until the camera image becomes available. More...
 

Public Attributes

CameraMode CameraMode => GetCameraController().CameraMode
 Get the current camera mode which which preferences either quality or speed More...
 
bool IsActive => mEngine.IsRunning
 Returns whether the camera is currently capturing More...
 

Properties

ExposureMode ExposureMode [get]
 Get the current exposure mode of the camera, e.g. automatic or continuous More...
 
bool ExposureRegionSupported [get]
 Check if setting an exposure region is supported on the current device More...
 
bool Flash [get]
 Get camera device flash state More...
 
FocusMode FocusMode [get]
 Get the current focus mode of the camera, e.g. manual or automatic Must be called after Engine has been started More...
 
bool FocusRegionSupported [get]
 Check if setting a focus region is supported on the current device More...
 
HoloLensDevice HoloLens [get]
 Hololens specific camera functionality More...
 
WebCamDevice WebCam [get]
 Webcam specific functionality More...
 

Detailed Description

Represents the physical camera used to capture the real world

Most functionality is not accessible until Vuforia has initialized completely. This can be checked by a call to VuforiaBehaviour.Instance.IsInitialized

Member Function Documentation

◆ GetCameraFieldOfViewRads()

Vector2 GetCameraFieldOfViewRads ( )
inline

Get the field of view for the active camera. This is a Vector2 containing the x- and y- components of the FOV in radians. If the value cannot be obtained for some reason, then Vector2.zero will be returned

◆ GetCameraImage()

Image GetCameraImage ( PixelFormat  format)
inline

Returns a camera image from the current Vuforia State for the requested format. Returns null if this image is not available. You must call SetFrameFormat before accessing the corresponding camera image.

◆ GetCameraIntrinsics()

Intrinsics GetCameraIntrinsics ( )
inline

Returns the camera intrinsics from the current Vuforia State.

Returns
The camera intrinsics

◆ GetExposureRegion()

CameraRegionOfInterest GetExposureRegion ( )
inline

Get the region of interest currently active for auto-exposure

◆ GetFocusRegion()

CameraRegionOfInterest GetFocusRegion ( )
inline

Get the region of interest currently active for auto-focus

◆ GetRecommendedFPS()

int GetRecommendedFPS ( )
inline

Returns the current framerate of the camera, which is what's recommended as the framerate cap of the application in most cases

◆ GetVideoBackgroundRectInViewPort()

Rect GetVideoBackgroundRectInViewPort ( )
inline

The area in the viewport that is covered by the video background.

◆ GetVideoMode() [1/2]

VideoModeData GetVideoMode ( )
inline

Get the video mode data that matches the selected CameraMode.

◆ GetVideoMode() [2/2]

VideoModeData GetVideoMode ( CameraMode  mode)
inline

Get the video mode data that matches the given CameraMode.

◆ IsExposureModeSupported()

bool IsExposureModeSupported ( ExposureMode  exposureMode)
inline

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

Parameters
exposureModeThe exposure mode to be checked for support

◆ IsFocusModeSupported()

bool IsFocusModeSupported ( FocusMode  focusMode)
inline

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

Parameters
focusModeThe focus mode to be checked for support

◆ SetCameraMode()

bool SetCameraMode ( CameraMode  mode)
inline

Set the current camera mode which which preferences either quality or speed This can only be called before starting Vuforia, otherwise returns false

◆ SetExposureMode()

bool SetExposureMode ( ExposureMode  exposureMode)
inline

Set the active exposure mode. Returns false if this mode is not available or can't be activated.

Parameters
exposureModeThe mode of the setting

◆ SetExposureRegion()

bool SetExposureRegion ( CameraRegionOfInterest  regionOfInterest)
inline

Set the active region of interest for auto-exposure

Parameters
regionOfInterestThe region of interest to be set for exposure

◆ SetFlash()

bool SetFlash ( bool  on)
inline

Activate or deactivate the camera device flash. Returns false if flash is not available or can't be activated.

◆ SetFocusMode()

bool SetFocusMode ( FocusMode  focusMode)
inline

Set the active focus mode. Returns false if this mode is not available or can't be activated.

Parameters
focusModeThe mode of the setting

◆ SetFocusRegion()

bool SetFocusRegion ( CameraRegionOfInterest  regionOfInterest)
inline

Set the active region of interest for auto-focus

Parameters
regionOfInterestThe region of interest to be set for focus

◆ SetFrameFormat()

bool SetFrameFormat ( PixelFormat  format,
bool  enabled 
)
inline

Enables or disables the request of the camera image in the desired pixel format. Returns true on success, false otherwise. Note that this may result in processing overhead. Image is accessed using GetCameraImage. Note that there may be a delay of several frames until the camera image becomes available.

Member Data Documentation

◆ CameraMode

CameraMode CameraMode => GetCameraController().CameraMode

Get the current camera mode which which preferences either quality or speed

◆ IsActive

bool IsActive => mEngine.IsRunning

Returns whether the camera is currently capturing

Property Documentation

◆ ExposureMode

Get the current exposure mode of the camera, e.g. automatic or continuous

◆ ExposureRegionSupported

bool ExposureRegionSupported
get

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

◆ Flash

bool Flash
get

Get camera device flash state

◆ FocusMode

Get the current focus mode of the camera, e.g. manual or automatic Must be called after Engine has been started

◆ FocusRegionSupported

bool FocusRegionSupported
get

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

◆ HoloLens

HoloLensDevice HoloLens
get

Hololens specific camera functionality

◆ WebCam

WebCamDevice WebCam
get

Webcam specific functionality