Class CameraManager
Class to control the camera. Camera settings are only available after CameraManager::CameraOpenedEventHandler and before CameraManager::CameraClosedEventHandler were fired.
Inheritance
Implements
Namespace: wikitude.sdk.uwp
Assembly: wikitude.sdk.dll
Syntax
public sealed class CameraManager : CameraControls
Methods
disableTorch()
Call to turn off the device torch.
Declaration
public void disableTorch()
enableTorch()
Call to turn on the device torch.
Declaration
public void enableTorch()
findCameraMatchingCharacteristics(CameraPosition, CameraResolution, CameraResolutionMatchMode, CameraMatchedHandler, ErrorHandler)
Call this method to get a filtered list of available cameras.
Declaration
public void findCameraMatchingCharacteristics(CameraPosition position_, CameraResolution resolution_, CameraResolutionMatchMode resolutionMatchMode_, CameraMatchedHandler cameraMatchedHandler, ErrorHandler errorHandler_)
Parameters
Type | Name | Description |
---|---|---|
CameraPosition | position_ | Desired camera position. |
CameraResolution | resolution_ | Desired camera resolution. |
CameraResolutionMatchMode | resolutionMatchMode_ | Camera resolution match mode |
CameraMatchedHandler | cameraMatchedHandler | Delegate called matched camera result. |
ErrorHandler | errorHandler_ | Delegate called if an error happens. |
getActiveCamera()
Call to get a reference to the currently active camera.
Declaration
public Camera getActiveCamera()
Returns
Type | Description |
---|---|
Camera | the currently active camera. |
getAvailableCameras(CameraDiscoveryHandler)
Call to get the list of all available cameras.
Declaration
public void getAvailableCameras(CameraDiscoveryHandler cameraMatchedHandler)
Parameters
Type | Name | Description |
---|---|---|
CameraDiscoveryHandler | cameraMatchedHandler | Delegate called with the camera list result. |
getExposureTime()
Call to get the current exposure time.
Declaration
public long getExposureTime()
Returns
Type | Description |
---|---|
System.Int64 | the exposure time in 100ns units. |
getExposureTimeStep()
Get the steps to increment/decrement exposure time.
Declaration
public long getExposureTimeStep()
Returns
Type | Description |
---|---|
System.Int64 | the exposure time step in 100ns units. |
getFocusMode()
Call to get the current active focus.
Declaration
public FocusMode getFocusMode()
Returns
Type | Description |
---|---|
FocusMode | the current active focus. |
getManualFocusDistance()
Call to get the current manual focus distance.
Declaration
public uint getManualFocusDistance()
Returns
Type | Description |
---|---|
System.UInt32 | the focus distance. |
getMaximumExposureTime()
Get the meximum exposure time.
Declaration
public long getMaximumExposureTime()
Returns
Type | Description |
---|---|
System.Int64 | the maximum exposure time in 100ns units. |
getMaximumFocusDistance()
Call to check the maximum focus distance, should be called before setting the manual focus ditance.
Declaration
public uint getMaximumFocusDistance()
Returns
Type | Description |
---|---|
System.UInt32 | the maximum focus distance. |
getMaximumZoomFactor()
Call to check the maximum zoom level, should be called before setting the zoom level
Declaration
public float getMaximumZoomFactor()
Returns
Type | Description |
---|---|
System.Single | The maximum zoom level. |
getMinimumExposureTime()
Get minimum exposure time.
Declaration
public long getMinimumExposureTime()
Returns
Type | Description |
---|---|
System.Int64 | the minimum exposure time in 100ns units. |
getMinimumFocusDistance()
Call to check the minimum focus distance, should be called before setting the manual focus ditance.
Declaration
public uint getMinimumFocusDistance()
Returns
Type | Description |
---|---|
System.UInt32 | the minimum focus distance. |
getMinimumZoomFactor()
Call to check the minimum zoom level, should be called before setting the zoom level
Declaration
public float getMinimumZoomFactor()
Returns
Type | Description |
---|---|
System.Single | The minimum zoom level. |
getTorchPower()
Call to get the current power level of the torch.
Declaration
public float getTorchPower()
Returns
Type | Description |
---|---|
System.Single | the power level of the torch. |
getVerticalFieldOfView()
Call to get the active camera vertical field of view.
Declaration
public float getVerticalFieldOfView()
Returns
Type | Description |
---|---|
System.Single | the active camera field of view. |
getZoomFactor()
Call to get the current zoom level
Declaration
public float getZoomFactor()
Returns
Type | Description |
---|---|
System.Single | The current zoom level |
getZoomFactorStep()
Call to check the smallest zoom increment, should be called before setting the zoom level
Declaration
public float getZoomFactorStep()
Returns
Type | Description |
---|---|
System.Single | The smallest zoom increment. |
isExposureControlSupported()
Call to check if exposure control is supported.
Declaration
public bool isExposureControlSupported()
Returns
Type | Description |
---|---|
System.Boolean | true if exposure control is supported |
isExposurePointOfInterestSupported()
Call to check is point of interest exposure mode is supported (tap to exposure).
Declaration
public bool isExposurePointOfInterestSupported()
Returns
Type | Description |
---|---|
System.Boolean | true if exposure to POI is supported |
isFocusControlSupported()
Call to check if focus control is supported by the current active camera.
Declaration
public bool isFocusControlSupported()
Returns
Type | Description |
---|---|
System.Boolean | Focus control availability |
isFocusModeSupported(FocusMode)
Call to check if focus mode is supported.
Declaration
public bool isFocusModeSupported(FocusMode focusMode_)
Parameters
Type | Name | Description |
---|---|---|
FocusMode | focusMode_ | Focus mode to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the focus mode is supported. |
isFocusPointOfInterestSupported()
Call to check is point of interest focus mode is supported (tap to focus).
Declaration
public bool isFocusPointOfInterestSupported()
Returns
Type | Description |
---|---|
System.Boolean | true if focus to POI is supported |
isManualFocusSupported()
Call to check if Manual focus is supported.
Declaration
public bool isManualFocusSupported()
Returns
Type | Description |
---|---|
System.Boolean | true if manual focus is supported. |
isTorchEnabled()
Call to check if torch is enabled.
Declaration
public bool isTorchEnabled()
Returns
Type | Description |
---|---|
System.Boolean | true if torch is enabled. |
isTorchPowerSupported()
Call to chek if the power level of the torch can be adjusted.
Declaration
public bool isTorchPowerSupported()
Returns
Type | Description |
---|---|
System.Boolean | true if torch power level is supported. |
isTorchSupported()
Call to check is the camera device supports torch (flash light).
Declaration
public bool isTorchSupported()
Returns
Type | Description |
---|---|
System.Boolean | true if torch is supported. |
isZoomControlSupported()
Call to check if the current active camera supports zoom control.
Declaration
public bool isZoomControlSupported()
Returns
Type | Description |
---|---|
System.Boolean | true if zoom control is supported. |
setActiveCamera(Camera)
Call to set the active camera.
Declaration
public void setActiveCamera(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | a reference to the camera to be used by the SDK. |
setAutoExposure()
Call to set back exposure to auto setting.
Declaration
public void setAutoExposure()
setExposureTime(Int64)
Call to se the exposure time of the camera.
Declaration
public void setExposureTime(long exposureTime_)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | exposureTime_ | exposure time in 100ns units. |
setFocusMode(FocusMode)
Call to set focus mode to active camera.
Declaration
public void setFocusMode(FocusMode focusMode_)
Parameters
Type | Name | Description |
---|---|---|
FocusMode | focusMode_ | Focus mode to set |
setManualFocusDistance(UInt32)
Call to set the focus distance when focus mode is manual.
Declaration
public void setManualFocusDistance(uint focusDistance_)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | focusDistance_ | focus distance within range of getMinimumFocusDistance() and getMaximumFocusDistance() |
setPointOfInterest(Point2i, Boolean, Boolean)
Call to set the point interest for tap to focus and/or tap to exposure.
Declaration
public void setPointOfInterest(Point2i pointOfInterest_, bool enableFocus_, bool enableExposure_)
Parameters
Type | Name | Description |
---|---|---|
Point2i | pointOfInterest_ | |
System.Boolean | enableFocus_ | |
System.Boolean | enableExposure_ |
setTorchPower(Single)
Call to set the power level of the torch.
Declaration
public void setTorchPower(float powerPercent)
Parameters
Type | Name | Description |
---|---|---|
System.Single | powerPercent | power level of the torch. |
setZoomFactor(Single)
Call to set the zoom level.
Declaration
public void setZoomFactor(float zoomFactor_)
Parameters
Type | Name | Description |
---|---|---|
System.Single | zoomFactor_ | Zoom level within range of getMinimumZoomFactor() and getMaximumZoomFactor() values |
Events
CameraClosedEventHandler
This event is fired when the active camera is stopped.
Declaration
public event CameraClosedHandler CameraClosedEventHandler
Event Type
Type | Description |
---|---|
CameraClosedHandler |
CameraOpenedEventHandler
This event is fired when the active camera is started.
Declaration
public event CameraOpenedHandler CameraOpenedEventHandler
Event Type
Type | Description |
---|---|
CameraOpenedHandler |
ErrorEventHandler
This event is fired when an error happens in the camera manager.
Declaration
public event ErrorHandler ErrorEventHandler
Event Type
Type | Description |
---|---|
ErrorHandler |
VerticalFieldOfViewChanged
This event is fired when the vertical field of view changes.
Declaration
public event VerticalFieldOfViewChangedEventHandler VerticalFieldOfViewChanged
Event Type
Type | Description |
---|---|
VerticalFieldOfViewChangedEventHandler |