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

void NewCameraFrame (int frameIndex, int frameDataSize, IntPtr frameData)
 Notifies the Wikitude SDK about a new input frame. More...
 
long GetPresentableInputFrameIndex ()
 Use this method to retrieve the last processed input frame index. Using this will allow you to synchronize the camera with the tracking data. More...
 

Public Attributes

UnityEvent OnInputPluginRegistered = new UnityEvent()
 Event called when the input plugin was registered and it is safe to try to access the camera. More...
 
OnInputPluginFailureEvent OnInputPluginFailure = new OnInputPluginFailureEvent()
 Event called when there was an error with the input plugin. More...
 
OnCameraFailureEvent OnCameraFailure = new OnCameraFailureEvent()
 Called whenever the device camera encounters an error. More...
 

Properties

string WikitudeLicenseKey [get, set]
 Gets or sets the Wikitude license key. More...
 
Texture2D CameraTexture [get]
 Gets the camera feed texture. More...
 
CaptureDevicePosition DevicePosition [get, set]
 Indicates the physical position of the capture device on the system. More...
 
CaptureFocusMode FocusMode [get, set]
 Indicates the current focus mode of the device. More...
 
float ManualFocusDistance [set]
 Indicates the current value of for manual focus. 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]
 Indicates 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]
 Indicates the current autofocus restriction. More...
 
float ZoomLevel [get, set]
 The zoom level that is currently active. More...
 
float MaxZoomLevel [get]
 The maximum supported zoom level. More...
 
CaptureFlashMode FlashMode [get, set]
 Indicates the current flash mode of the device. More...
 
CaptureDeviceResolution DesiredCameraResolution [get, set]
 Indicates the desired resolution of the camera capture device. More...
 
CaptureDeviceFramerate DesiredCameraFramerate [get, set]
 Indicates the desired framerate of the camera capture device. More...
 
bool EnableCamera2 [get]
 Enables Camera 2 API on Android, required if the Focus Distance needs to be set manually. More...
 
bool EnableInputPlugin [get, set]
 Enables Input Plugins for Unity. The setter should only be used during initialization, otherwise, it won't have any effect. More...
 
bool EnableMirroring [get, set]
 Will flip the frame horizontally for rendering only. No operations are done on the data itself. Only works if RequestInputFrameRendering is also enabled. More...
 
bool InvertedFrame [get, set]
 Will flip the frame vertically before any processing and rendering is done. Can be used together with MirroredFrame to rotate the frame by 180 degrees. Only works if the color space is RGBA. More...
 
bool MirroredFrame [get, set]
 Will flip the frame horizontally before any processing and rendering is done. Can be used together with InvertedFrame to rotate the frame by 180 degrees. Only works if the color space is RGBA. More...
 
FrameColorSpace InputFrameColorSpace [get]
 Input Plugin color space More...
 
float HorizontalAngle [get, set]
 Gets or sets the horizontal angle of the device used to capture the frame (FOV). More...
 
int InputFrameWidth [get, set]
 Gets or sets the width of the input frame. More...
 
int InputFrameHeight [get, set]
 Gets or sets the height of the input frame. More...
 
bool RequestInputFrameRendering [get, set]
 Gets or sets a value indicating whether the SDK should render the frame. 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

long Wikitude.WikitudeCamera.GetPresentableInputFrameIndex ( )
inline

Use this method to retrieve the last processed input frame index. Using this will allow you to synchronize the camera with the tracking data.

Returns
void Wikitude.WikitudeCamera.NewCameraFrame ( int  frameIndex,
int  frameDataSize,
IntPtr  frameData 
)
inline

Notifies the Wikitude SDK about a new input frame.

Parameters
frameIndexA unique identifier for each frame. Specifying the same value twice will lead to undefined behaviour.
frameDataSizeThe size of the frame data in bytes.
frameDataNative pointer to the frame data.

Member Data Documentation

OnCameraFailureEvent Wikitude.WikitudeCamera.OnCameraFailure = new OnCameraFailureEvent()

Called whenever the device camera encounters an error.

OnInputPluginFailureEvent Wikitude.WikitudeCamera.OnInputPluginFailure = new OnInputPluginFailureEvent()

Event called when there was an error with the input plugin.

UnityEvent Wikitude.WikitudeCamera.OnInputPluginRegistered = new UnityEvent()

Event called when the input plugin was registered and it is safe to try to access the camera.

Property Documentation

CaptureAutoFocusRestriction Wikitude.WikitudeCamera.AutoFocusRestriction
getset

Indicates the current autofocus restriction.

The auto focus restriction.

Texture2D Wikitude.WikitudeCamera.CameraTexture
get

Gets the camera feed texture.

The camera texture.

CaptureDeviceFramerate Wikitude.WikitudeCamera.DesiredCameraFramerate
getset

Indicates the desired framerate of the camera capture device.

CaptureDeviceResolution Wikitude.WikitudeCamera.DesiredCameraResolution
getset

Indicates the desired resolution of the camera capture device.

CaptureDevicePosition Wikitude.WikitudeCamera.DevicePosition
getset

Indicates the physical position of the capture device on the system.

bool Wikitude.WikitudeCamera.EnableCamera2
get

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

Returns
bool Wikitude.WikitudeCamera.EnableInputPlugin
getset

Enables Input Plugins for Unity. The setter should only be used during initialization, otherwise, it won't have any effect.

true if Input Plugins should be running; otherwise, false.

bool Wikitude.WikitudeCamera.EnableMirroring
getset

Will flip the frame horizontally for rendering only. No operations are done on the data itself. Only works if RequestInputFrameRendering is also enabled.

true if mirroring for rendering should be enabled; otherwise, false.

CaptureFlashMode Wikitude.WikitudeCamera.FlashMode
getset

Indicates the current flash mode of the device.

CaptureFocusMode Wikitude.WikitudeCamera.FocusMode
getset

Indicates the current focus mode of the device.

float Wikitude.WikitudeCamera.HorizontalAngle
getset

Gets or sets the horizontal angle of the device used to capture the frame (FOV).

The horizontal angle.

FrameColorSpace Wikitude.WikitudeCamera.InputFrameColorSpace
get

Input Plugin color space

The input frame color space.

int Wikitude.WikitudeCamera.InputFrameHeight
getset

Gets or sets the height of the input frame.

The height of the input frame.

int Wikitude.WikitudeCamera.InputFrameWidth
getset

Gets or sets the width of the input frame.

The width of the input frame.

bool Wikitude.WikitudeCamera.InvertedFrame
getset

Will flip the frame vertically before any processing and rendering is done. Can be used together with MirroredFrame to rotate the frame by 180 degrees. Only works if the color space is RGBA.

true if the frame should be flipped vertically; otherwise, false.

bool Wikitude.WikitudeCamera.IsManualFocusAvailable
get

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

float Wikitude.WikitudeCamera.ManualFocusDistance
set

Indicates the current value of for manual focus. 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

The maximum supported zoom level.

The max zoom level.

bool Wikitude.WikitudeCamera.MirroredFrame
getset

Will flip the frame horizontally before any processing and rendering is done. Can be used together with InvertedFrame to rotate the frame by 180 degrees. Only works if the color space is RGBA.

///

true if the frame should be flipped horizontally; otherwise, false.

Returns
bool Wikitude.WikitudeCamera.RequestInputFrameRendering
getset

Gets or sets a value indicating whether the SDK should render the frame.

true if the SDK should render the frame; otherwise, false.

string Wikitude.WikitudeCamera.WikitudeLicenseKey
getset

Gets or sets the Wikitude license key.

The wikitude license key.

float Wikitude.WikitudeCamera.ZoomLevel
getset

The zoom level that is currently active.