C++ Java Unity
C++ Reference
ExternalCamera Class Referenceabstract

Detailed Description

Interface used by Vuforia to interact with the external camera implementation.

The sequence of events between Vuforia and the external camera implementation is as follows:

  1. Vuforia calls VuforiaDriver::createExternalCamera() when the driver capability includes CAMERA_IMAGE.
  2. The implementation creates an ExternalCamera instance and returns it to Vuforia.
  3. Vuforia calls ExternalCamera::open() on the returned instance.
  4. Vuforia discovers supported camera modes by iterating them by getting the number of modes with ExternalCamera::getNumSupportedCameraModes() and then iterates over the list with ExternalCamera::getSupportedCameraMode().
  5. Vuforia calls ExternalCamera::start(), which starts the flow of frames into the provided CameraCallback.
  6. On shutdown Vuforia calls -> ExternalCamera::stop() -> ExternalCamera::close() -> and finally VuforiaDriver::destroyExternalCamera().

Public Member Functions

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION open ()=0
 Open the camera. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION close ()=0
 Close the camera. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION start (CameraMode cameraMode, CameraCallback *cb)=0
 Start the camera. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION stop ()=0
 Stops the camera. More...
 
virtual uint32_t VUFORIA_DRIVER_CALLING_CONVENTION getNumSupportedCameraModes ()=0
 Get the number of supported camera modes. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION getSupportedCameraMode (uint32_t index, CameraMode *out)=0
 Get a camera mode from a certain index. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsExposureMode (ExposureMode parameter)=0
 Get whether a particular exposure mode is supported. More...
 
virtual ExposureMode VUFORIA_DRIVER_CALLING_CONVENTION getExposureMode ()=0
 Get current exposure mode. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setExposureMode (ExposureMode mode)=0
 Set the current exposure mode. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsExposureValue ()=0
 Get whether setting the exposure manually is supported. More...
 
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValueMin ()=0
 Get the minimum supported value for manual exposure. More...
 
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValueMax ()=0
 Get the maximum supported value for manual exposure. More...
 
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValue ()=0
 Get the current manual exposure value. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setExposureValue (uint64_t exposureTime)=0
 Set the current manual exposure value. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsFocusMode (FocusMode parameter)=0
 Get whether a particular focus mode is supported. More...
 
virtual FocusMode VUFORIA_DRIVER_CALLING_CONVENTION getFocusMode ()=0
 Get the current focus mode. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setFocusMode (FocusMode mode)=0
 Set the current focus mode. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsFocusValue ()=0
 Get whether setting manual focus distance is supported. More...
 
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValueMin ()=0
 Get the minimum supported value for manual focus distance. More...
 
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValueMax ()=0
 Get the maximum supported value for manual focus distance. More...
 
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValue ()=0
 Get the current manual focus distance. More...
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setFocusValue (float value)=0
 Set the current manual focus value. More...
 

Member Function Documentation

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION open ( )
pure virtual

Open the camera.

After opening the camera, the supported video modes should be available to be queried with getNumSupportedCameraModes() and getSupportedCameraMode().

Returns
True if the camera was opened, otherwise false.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION close ( )
pure virtual

Close the camera.

Returns
True if the camera was closed, otherwise false.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION start ( CameraMode  cameraMode,
CameraCallback cb 
)
pure virtual

Start the camera.

Parameters
cameraModeThe requested mode that the camera should deliver the frames in.
cbCallback that the camera frames should be delivered to.
Returns
True if the camera was started, otherwise false.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION stop ( )
pure virtual

Stops the camera.

Returns
True if the camera was stopped, otherwise false.
virtual uint32_t VUFORIA_DRIVER_CALLING_CONVENTION getNumSupportedCameraModes ( )
pure virtual

Get the number of supported camera modes.

Should return the total number of supported camera modes. Vuforia uses this number then to query the camera modes with getSupportedCameraMode(), which iterates from 0 to totalNumber - 1.

Returns
Number of camera modes that this camera supports.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION getSupportedCameraMode ( uint32_t  index,
CameraMode *  out 
)
pure virtual

Get a camera mode from a certain index.

Parameters
indexThe index of the mode to get, in the range 0..getNumSupportedCameraModes()-1.
outOn return, will be populated with the camera mode corresponding to the requested index.
Returns
True on success, or false if the index was out of bounds.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsExposureMode ( ExposureMode  parameter)
pure virtual

Get whether a particular exposure mode is supported.

Returns
True if the mode is supported, otherwise false.
virtual ExposureMode VUFORIA_DRIVER_CALLING_CONVENTION getExposureMode ( )
pure virtual

Get current exposure mode.

Returns
The current exposure mode.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setExposureMode ( ExposureMode  mode)
pure virtual

Set the current exposure mode.

Parameters
modeNew exposure mode.
Returns
True if setting the mode succeeded, otherwise false.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsExposureValue ( )
pure virtual

Get whether setting the exposure manually is supported.

Returns
True if usage of setExposureValue() is supported, otherwise false.
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValueMin ( )
pure virtual

Get the minimum supported value for manual exposure.

Returns
The minimum value that can be provided for setExposureValue().
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValueMax ( )
pure virtual

Get the maximum supported value for manual exposure.

Returns
The maximum value that can be provided for setExposureValue().
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValue ( )
pure virtual

Get the current manual exposure value.

Returns
The current value.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setExposureValue ( uint64_t  exposureTime)
pure virtual

Set the current manual exposure value.

Parameters
exposureTimeNew value for manual exposure.
Note
To use this supportsExposureValue() must return true and the provided value must be in the range speficied by getExposureValueMin() and getExposureValueMax() inclusive.
Returns
True value was set successfully, otherwise false.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsFocusMode ( FocusMode  parameter)
pure virtual

Get whether a particular focus mode is supported.

Returns
True if the mode is supported, otherwise false.
virtual FocusMode VUFORIA_DRIVER_CALLING_CONVENTION getFocusMode ( )
pure virtual

Get the current focus mode.

Returns
The current focus mode.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setFocusMode ( FocusMode  mode)
pure virtual

Set the current focus mode.

Parameters
modeThe new focus mode.
Returns
A boolean indicating if setting succeeded.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsFocusValue ( )
pure virtual

Get whether setting manual focus distance is supported.

Returns
True if usage of setFocusValue() is supported, otherwise false.
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValueMin ( )
pure virtual

Get the minimum supported value for manual focus distance.

Returns
The minimum value in millimeters that can be provided for setFocusValue().
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValueMax ( )
pure virtual

Get the maximum supported value for manual focus distance.

Returns
The maximum value in millimeters that can be provided for setFocusValue().
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValue ( )
pure virtual

Get the current manual focus distance.

Returns
Current manual focus value in millimeters.
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setFocusValue ( float  value)
pure virtual

Set the current manual focus value.

Parameters
valueThe new value for manual focus distance in millimeters.
Note
To use this supportsFocusValue() must return true and the provided value must be in the range specified by getFocusValueMin() and getFocusValueMax() inclusive.
Returns
True value was set successfully, otherwise false.