Wikitude Unity Plugin
Public Member Functions | Public Attributes | Properties | List of all members
Wikitude.WikitudeCamera Class Reference

The Wikitude camera handles the connection with the native plugins. More...

Inherits MonoBehaviour.

Public Member Functions

bool IsFocusModeSupported (CaptureFocusMode focusMode)
 Checks if a focus mode is supported is supported by the current capture device. More...
 
bool IsExposureModeSupported (CaptureExposureMode exposureMode)
 Checks if an exposure mode is supported by the current capture device. More...
 
bool IsZoomLevelSupported (float zoomLevel)
 Checks if a zoom level is supported by the current capture device. More...
 
bool IsFlashModeSupported (CaptureFlashMode flashMode)
 Checks if a flash mode is supported by the current capture device. More...
 
bool IsCameraListSupported ()
 Checks if the platform supports listing external cameras. More...
 
void GetCameraList (Action< int > callback)
 Retrieve a list of available camera on the host system. More...
 
string GetCameraName (int cameraIndex)
 Get the camera name given it's index. More...
 
void SetActiveCamera (int cameraIndex)
 On platfoms supporting external cameras, select a camera by its index. More...
 
int GetActiveCameraIndex ()
 On platforms supporting external cameras, get the current active camera index. More...
 
void FocusAtPointOfInterest (Vector2 pointOfInterest)
 Sets the focus around a point. Should be called again whenever the camera is restarted More...
 
void ExposeAtPointOfInterest (Vector2 pointOfInterest, CaptureExposureMode exposureMode)
 Sets the exposure level around a point. Should be called again whenever the camera is restarted. More...
 

Public Attributes

OnCameraErrorEvent OnCameraError = new OnCameraErrorEvent()
 Called whenever the device camera encounters an error. More...
 
OnCameraOpenedEvent OnCameraOpened = new OnCameraOpenedEvent()
 Called whenever the device camera is opened. More...
 
OnSDKInitializedEvent OnSDKInitialized = new OnSDKInitializedEvent()
 Called after the SDK finished initialization. More...
 

Properties

CaptureDevicePosition DevicePosition [get, set]
 Gets or sets the position of the capture device that is used or should be used. More...
 
CaptureFocusMode FocusMode [get, set]
 Gets or sets the focus mode that should be used by the current capture device, if supported. More...
 
CaptureExposureMode ExposureMode [get, set]
 Gets or sets the exposure mode that should be used by the current capture device, if supported. More...
 
float ManualFocusDistance [set]
 Gets or sets the manual focus distance that should be used. Valid values are between 0 and 1 and only works when the FocusMode is set to Locked and Camera2 API is enabled on Android. Value 0 indicates that the camera should focus as close as possible. More...
 
bool IsManualFocusAvailable [get]
 Checks if the current device supports manual focus. On Android, if Camera 2 API is not enabled, this will always be false. More...
 
CaptureAutoFocusRestriction AutoFocusRestriction [get, set]
 Gets or sets the current auto focus range restriction. This option is only available on iOS. More...
 
bool IsAutoFocusRestrictionSupported [get]
 Checks if auto focus range restriction is supported on the device. More...
 
float ZoomLevel [get, set]
 Gets or sets the zoom level that should be used. More...
 
float MaxZoomLevel [get]
 Gets the maximum zoom level supported by the current capture device. More...
 
CaptureFlashMode FlashMode [get, set]
 Gets or sets the current flash mode that should be used by the capture device. More...
 
CaptureDeviceResolution DesiredCameraResolution [get, set]
 Gets or sets the desired resolution of the camera capture device. The change will take place the next time a camera is started. More...
 
CaptureDeviceFramerate DesiredCameraFramerate [get, set]
 Gets or sets the desired framerate of the camera capture device. The change will take place the next time a camera is started. More...
 
bool EnableCamera2 [get, set]
 Enables Camera 2 API on Android, required if the Focus Distance needs to be set manually. More...
 
bool IsFocusAtPointOfInterestSupported [get]
 Checks if FocusAtPointOfInterest is supported by the current capture device. More...
 
bool IsExposeAtPointOfInterstSupported [get]
 Checks if FocusAtPointOfInterest is supported by the current capture device. More...
 
string WikitudeLicenseKey [get, set]
 Gets or sets the Wikitude license key. More...
 
bool EnableCameraRendering [get, set]
 Enables or disables rendering of the camera feed in the background of the scene. More...
 
bool StaticCamera [get, set]
 Changes how the camera and trackables are positioned in the world. By default, the camera is dynamic and moves around a static trackable. When enabling StaticCamera, the camera is fixed to the original position and the trackable moves around it. A static camera can be procedurally moved at runtime without affecting tracking. More...
 
Vector3 CalibrationPositionOffset [get, set]
 Position offset that is applied to the tracking matrix before it is processed by the plugin. More...
 
Quaternion CalibrationRotationOffset [get, set]
 Rotation offset that is applied to the tracking matrix before it is processed by the plugin. More...
 
bool IgnoreTrackableScale [get, set]
 When enabled, ignores the scaling of the trackable for tracking purposes and assumes it to be 1.0f. More...
 
bool PrintErrorsToConsole [get, set]
 Automatically print all errors encountered by the SDK to the console. More...
 
Texture CameraTexture [get]
 Gets the GPU texture that contains the current camera frame. More...
 
string CustomTrackerConfiguration [get, set]
 A JSON configuration file that changes the tracker behavior. Should only used in very specific contexts. Please contact support for additional information regarding this property. More...
 
bool EnableLivePreview [get, set]
 Gets or sets if the Live Preview mode should be enabled or not. More...
 
LivePreviewMode LivePreviewMode [get, set]
 Gets or sets which Live Preview mode should be used. More...
 
Texture2D StaticImage [get, set]
 Gets or sets which Image should be used in the Live Preview mode. The selected image should have the Read / Write settings enabled. More...
 
String WebCamName [get, set]
 Gets or sets which WebCam should be used in the Live Preview mode. More...
 
bool WebCamIsMirrored [get, set]
 Gets or sets if the WebCam should be mirrored. More...
 
CaptureDevicePosition RemoteCameraPosition [get, set]
 Gets or sets which camera position to use in the Live Preview mode when using the Unity Remote app. More...
 
float CameraToHorizonAngle [get, set]
 Gets or sets the angle between the forward vector of the camera and the horizontal plane. A value of 0 indicates that the camera is pointed directly forward, while a value of 90 means that the camera is pointed directly down to the ground. When using static images or webcams, there is no sensor data to indicate how the ground plane is oriented in the image, but this is crucial for Instant Tracking to work correctly. More...
 
VideoClip VideoClip [get, set]
 Gets or sets which video should be used in the Live Preview mode. More...
 
bool VideoLoop [get, set]
 Gets or sets if the video should be looped for the corresponding Live Preview mode. More...
 
float VideoSpeed [get, set]
 Gets or sets the speed of the video for the corresponding Live Preview mode. More...
 
bool ForceResendData [get, set]
 When set to true, it will force resending the same image data, even if it didn't change. The value will revert to false when after the data was resent. More...
 

Detailed Description

The Wikitude camera handles the connection with the native plugins.

When the Awake function is called on it, the native plugin is initialized. When the WikitudeCamera it is destroyed, the plugin is also destroyed.

Also handles camera rendering and camera settings.

Member Function Documentation

void Wikitude.WikitudeCamera.ExposeAtPointOfInterest ( Vector2  pointOfInterest,
CaptureExposureMode  exposureMode 
)
inline

Sets the exposure level around a point. Should be called again whenever the camera is restarted.

Parameters
pointOfInterestThe point of interest around which the exposure should be taken. The point is in screen space, as would be returned by Input.mousePosition, for example.
exposureModeThe exposure mode that should be used around the point.
void Wikitude.WikitudeCamera.FocusAtPointOfInterest ( Vector2  pointOfInterest)
inline

Sets the focus around a point. Should be called again whenever the camera is restarted

Parameters
pointOfInterestThe point of interest where the camera should focus. The point is in screen space, as would be returned by Input.mousePosition, for example.
int Wikitude.WikitudeCamera.GetActiveCameraIndex ( )
inline

On platforms supporting external cameras, get the current active camera index.

void Wikitude.WikitudeCamera.GetCameraList ( Action< int >  callback)
inline

Retrieve a list of available camera on the host system.

Parameters
callbackThis callback is called once the list of camera has been filled, with the number of available cameras as a parameter.
string Wikitude.WikitudeCamera.GetCameraName ( int  cameraIndex)
inline

Get the camera name given it's index.

bool Wikitude.WikitudeCamera.IsCameraListSupported ( )
inline

Checks if the platform supports listing external cameras.

bool Wikitude.WikitudeCamera.IsExposureModeSupported ( CaptureExposureMode  exposureMode)
inline

Checks if an exposure mode is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsFlashModeSupported ( CaptureFlashMode  flashMode)
inline

Checks if a flash mode is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsFocusModeSupported ( CaptureFocusMode  focusMode)
inline

Checks if a focus mode is supported is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsZoomLevelSupported ( float  zoomLevel)
inline

Checks if a zoom level is supported by the current capture device.

void Wikitude.WikitudeCamera.SetActiveCamera ( int  cameraIndex)
inline

On platfoms supporting external cameras, select a camera by its index.

Member Data Documentation

OnCameraErrorEvent Wikitude.WikitudeCamera.OnCameraError = new OnCameraErrorEvent()

Called whenever the device camera encounters an error.

OnCameraOpenedEvent Wikitude.WikitudeCamera.OnCameraOpened = new OnCameraOpenedEvent()

Called whenever the device camera is opened.

OnSDKInitializedEvent Wikitude.WikitudeCamera.OnSDKInitialized = new OnSDKInitializedEvent()

Called after the SDK finished initialization.

Property Documentation

CaptureAutoFocusRestriction Wikitude.WikitudeCamera.AutoFocusRestriction
getset

Gets or sets the current auto focus range restriction. This option is only available on iOS.

Vector3 Wikitude.WikitudeCamera.CalibrationPositionOffset
getset

Position offset that is applied to the tracking matrix before it is processed by the plugin.

Quaternion Wikitude.WikitudeCamera.CalibrationRotationOffset
getset

Rotation offset that is applied to the tracking matrix before it is processed by the plugin.

Texture Wikitude.WikitudeCamera.CameraTexture
get

Gets the GPU texture that contains the current camera frame.

float Wikitude.WikitudeCamera.CameraToHorizonAngle
getset

Gets or sets the angle between the forward vector of the camera and the horizontal plane. A value of 0 indicates that the camera is pointed directly forward, while a value of 90 means that the camera is pointed directly down to the ground. When using static images or webcams, there is no sensor data to indicate how the ground plane is oriented in the image, but this is crucial for Instant Tracking to work correctly.

string Wikitude.WikitudeCamera.CustomTrackerConfiguration
getset

A JSON configuration file that changes the tracker behavior. Should only used in very specific contexts. Please contact support for additional information regarding this property.

CaptureDeviceFramerate Wikitude.WikitudeCamera.DesiredCameraFramerate
getset

Gets or sets the desired framerate of the camera capture device. The change will take place the next time a camera is started.

CaptureDeviceResolution Wikitude.WikitudeCamera.DesiredCameraResolution
getset

Gets or sets the desired resolution of the camera capture device. The change will take place the next time a camera is started.

CaptureDevicePosition Wikitude.WikitudeCamera.DevicePosition
getset

Gets or sets the position of the capture device that is used or should be used.

bool Wikitude.WikitudeCamera.EnableCamera2
getset

Enables Camera 2 API on Android, required if the Focus Distance needs to be set manually.

Returns
bool Wikitude.WikitudeCamera.EnableCameraRendering
getset

Enables or disables rendering of the camera feed in the background of the scene.

bool Wikitude.WikitudeCamera.EnableLivePreview
getset

Gets or sets if the Live Preview mode should be enabled or not.

CaptureExposureMode Wikitude.WikitudeCamera.ExposureMode
getset

Gets or sets the exposure mode that should be used by the current capture device, if supported.

CaptureFlashMode Wikitude.WikitudeCamera.FlashMode
getset

Gets or sets the current flash mode that should be used by the capture device.

CaptureFocusMode Wikitude.WikitudeCamera.FocusMode
getset

Gets or sets the focus mode that should be used by the current capture device, if supported.

bool Wikitude.WikitudeCamera.ForceResendData
getset

When set to true, it will force resending the same image data, even if it didn't change. The value will revert to false when after the data was resent.

bool Wikitude.WikitudeCamera.IgnoreTrackableScale
getset

When enabled, ignores the scaling of the trackable for tracking purposes and assumes it to be 1.0f.

Returns
bool Wikitude.WikitudeCamera.IsAutoFocusRestrictionSupported
get

Checks if auto focus range restriction is supported on the device.

Returns
bool Wikitude.WikitudeCamera.IsExposeAtPointOfInterstSupported
get

Checks if FocusAtPointOfInterest is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsFocusAtPointOfInterestSupported
get

Checks if FocusAtPointOfInterest is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsManualFocusAvailable
get

Checks if the current device supports manual focus. On Android, if Camera 2 API is not enabled, this will always be false.

LivePreviewMode Wikitude.WikitudeCamera.LivePreviewMode
getset

Gets or sets which Live Preview mode should be used.

float Wikitude.WikitudeCamera.ManualFocusDistance
set

Gets or sets the manual focus distance that should be used. Valid values are between 0 and 1 and only works when the FocusMode is set to Locked and Camera2 API is enabled on Android. Value 0 indicates that the camera should focus as close as possible.

float Wikitude.WikitudeCamera.MaxZoomLevel
get

Gets the maximum zoom level supported by the current capture device.

bool Wikitude.WikitudeCamera.PrintErrorsToConsole
getset

Automatically print all errors encountered by the SDK to the console.

CaptureDevicePosition Wikitude.WikitudeCamera.RemoteCameraPosition
getset

Gets or sets which camera position to use in the Live Preview mode when using the Unity Remote app.

bool Wikitude.WikitudeCamera.StaticCamera
getset

Changes how the camera and trackables are positioned in the world. By default, the camera is dynamic and moves around a static trackable. When enabling StaticCamera, the camera is fixed to the original position and the trackable moves around it. A static camera can be procedurally moved at runtime without affecting tracking.

Texture2D Wikitude.WikitudeCamera.StaticImage
getset

Gets or sets which Image should be used in the Live Preview mode. The selected image should have the Read / Write settings enabled.

VideoClip Wikitude.WikitudeCamera.VideoClip
getset

Gets or sets which video should be used in the Live Preview mode.

bool Wikitude.WikitudeCamera.VideoLoop
getset

Gets or sets if the video should be looped for the corresponding Live Preview mode.

float Wikitude.WikitudeCamera.VideoSpeed
getset

Gets or sets the speed of the video for the corresponding Live Preview mode.

bool Wikitude.WikitudeCamera.WebCamIsMirrored
getset

Gets or sets if the WebCam should be mirrored.

String Wikitude.WikitudeCamera.WebCamName
getset

Gets or sets which WebCam should be used in the Live Preview mode.

string Wikitude.WikitudeCamera.WikitudeLicenseKey
getset

Gets or sets the Wikitude license key.

The wikitude license key.

float Wikitude.WikitudeCamera.ZoomLevel
getset

Gets or sets the zoom level that should be used.