All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
ExternalCamera Class Referenceabstract

Public Member Functions

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION open ()=0
 Open the camera.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION close ()=0
 Close the camera.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION start (CameraMode cameraMode, CameraCallback *cb)=0
 Start the camera.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION stop ()=0
 Stop the camera.
 
virtual uint32_t VUFORIA_DRIVER_CALLING_CONVENTION getNumSupportedCameraModes ()=0
 Get the number of supported camera modes.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION getSupportedCameraMode (uint32_t index, CameraMode *cameraMode)=0
 Get a camera mode from a certain index.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsExposureMode (ExposureMode exposureMode)=0
 Check whether a particular exposure mode is supported.
 
virtual ExposureMode VUFORIA_DRIVER_CALLING_CONVENTION getExposureMode ()=0
 Get current exposure mode.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setExposureMode (ExposureMode exposureMode)=0
 Set the current exposure mode.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsExposureValue ()=0
 Check whether setting the exposure manually is supported.
 
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValueMin ()=0
 Get the minimum supported value for manual exposure.
 
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValueMax ()=0
 Get the maximum supported value for manual exposure.
 
virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValue ()=0
 Get the current manual exposure value.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setExposureValue (uint64_t exposureTime)=0
 Set the current manual exposure value.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsFocusMode (FocusMode focusMode)=0
 Check whether a particular focus mode is supported.
 
virtual FocusMode VUFORIA_DRIVER_CALLING_CONVENTION getFocusMode ()=0
 Get the current focus mode.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setFocusMode (FocusMode mode)=0
 Set the current focus mode.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsFocusValue ()=0
 Get whether setting manual focus distance is supported.
 
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValueMin ()=0
 Get the minimum supported value for manual focus distance.
 
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValueMax ()=0
 Get the maximum supported value for manual focus distance.
 
virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValue ()=0
 Get the current manual focus distance.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setFocusValue (float focusValue)=0
 Set the current manual focus value.
 
virtual bool VUFORIA_DRIVER_CALLING_CONVENTION processFramesOnThread ()
 Function called by Vuforia to determine whether it should create a separate thread to process frame data.
 

Detailed Description

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

Note
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::processFramesOnThread()
  6. Vuforia calls ExternalCamera::start(), which starts the flow of frames into the provided CameraCallback.
  7. On shutdown Vuforia calls -> ExternalCamera::stop() -> ExternalCamera::close() -> and finally VuforiaDriver::destroyExternalCamera().

Member Function Documentation

◆ open()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION open ( )
pure virtual

Open the camera.

Note
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, false otherwise

◆ close()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION close ( )
pure virtual

Close the camera.

Returns
True if the camera was closed, false otherwise

◆ start()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION start ( CameraMode cameraMode,
CameraCallback * cb )
pure virtual

Start the camera.

Parameters
cameraModeThe requested camera 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, false otherwise

◆ stop()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION stop ( )
pure virtual

Stop the camera.

Returns
True if the camera was stopped, false otherwise

◆ getNumSupportedCameraModes()

virtual uint32_t VUFORIA_DRIVER_CALLING_CONVENTION getNumSupportedCameraModes ( )
pure virtual

Get the number of supported camera modes.

Note
This function returns the total number of supported camera modes. Vuforia uses this number to query the camera modes with getSupportedCameraMode(), which iterates from 0 to (totalNumber - 1).
Returns
Number of camera modes that this camera supports

◆ getSupportedCameraMode()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION getSupportedCameraMode ( uint32_t index,
CameraMode * cameraMode )
pure virtual

Get a camera mode from a certain index.

Parameters
indexThe index of the mode to get, in the range [0 .. getNumSupportedCameraModes()-1]
cameraModeOn return, this output parameter 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

◆ supportsExposureMode()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsExposureMode ( ExposureMode exposureMode)
pure virtual

Check whether a particular exposure mode is supported.

Parameters
exposureModeThe exposure mode to check
Returns
True if the exposure mode is supported, false otherwise

◆ getExposureMode()

virtual ExposureMode VUFORIA_DRIVER_CALLING_CONVENTION getExposureMode ( )
pure virtual

Get current exposure mode.

Returns
The current exposure mode

◆ setExposureMode()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setExposureMode ( ExposureMode exposureMode)
pure virtual

Set the current exposure mode.

Parameters
exposureModeNew exposure mode
Returns
True if setting the exposure mode succeeded, false otherwise

◆ supportsExposureValue()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsExposureValue ( )
pure virtual

Check whether setting the exposure manually is supported.

Returns
True if usage of setExposureValue() is supported, false otherwise

◆ getExposureValueMin()

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()

◆ getExposureValueMax()

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()

◆ getExposureValue()

virtual uint64_t VUFORIA_DRIVER_CALLING_CONVENTION getExposureValue ( )
pure virtual

Get the current manual exposure value.

Returns
The current camera exposure value

◆ setExposureValue()

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 function, supportsExposureValue() must return true and the provided value must be in the range specified by getExposureValueMin() and getExposureValueMax() inclusive.
Returns
True if value was set successfully, false otherwise

◆ supportsFocusMode()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION supportsFocusMode ( FocusMode focusMode)
pure virtual

Check whether a particular focus mode is supported.

Parameters
focusModeThe focus mode to check
Returns
True if the mode is supported, false otherwise

◆ getFocusMode()

virtual FocusMode VUFORIA_DRIVER_CALLING_CONVENTION getFocusMode ( )
pure virtual

Get the current focus mode.

Returns
The current focus mode

◆ setFocusMode()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setFocusMode ( FocusMode mode)
pure virtual

Set the current focus mode.

Parameters
modeThe new focus mode
Returns
True if value was set successfully, false otherwise

◆ supportsFocusValue()

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, false otherwise

◆ getFocusValueMin()

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()

◆ getFocusValueMax()

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()

◆ getFocusValue()

virtual float VUFORIA_DRIVER_CALLING_CONVENTION getFocusValue ( )
pure virtual

Get the current manual focus distance.

Returns
Current manual focus value in millimeters

◆ setFocusValue()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION setFocusValue ( float focusValue)
pure virtual

Set the current manual focus value.

Parameters
focusValueThe 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, false otherwise

◆ processFramesOnThread()

virtual bool VUFORIA_DRIVER_CALLING_CONVENTION processFramesOnThread ( )
inlinevirtual

Function called by Vuforia to determine whether it should create a separate thread to process frame data.

Note
By default this method returns false and Vuforia will process the frame in the callback. Once the callback returns a new Vuforia state will be ready for the App to interrogate for results. If this method returns true Vuforia will create a separate thread to process the frame, during the callback Vuforia will just copy the provided data and queue it for processing on the thread.