VideoKitCameraView
namespace VideoKit.UI {
/// <summary>
/// Unity component for displaying the camera preview on a UI panel.
/// </summary>
class VideoKitCameraView : MonoBehaviour { ... }
}
This component displays the camera preview texture or human texture on a UI panel.
Configuring the View
INCOMPLETE
Specifying the Camera Manager
/// <summary>
/// VideoKit camera manager.
/// </summary>
VideoKitCameraManager cameraManager { get; set; }
INCOMPLETE
Specifying the View Mode
/// <summary>
/// View mode of the view.
/// </summary>
ViewMode viewMode { get; set; } = ViewMode.CameraTexture;
INCOMPLETE
/// <summary>
/// View mode.
/// </summary>
enum ViewMode : int {
/// <summary>
/// Display the camera texture.
/// </summary>
CameraTexture = 0,
/// <summary>
/// Display the human texture.
/// </summary>
HumanTexture = 1,
}
Accessing the Camera Texture
INCOMPLETE
Accessing the Preview Texture
/// <summary>
/// Get the camera preview texture.
/// </summary>
Texture2D? texture { get; }
INCOMPLETE
When the viewMode
is set to ViewMode.HumanTexture
, the texture
will contain the human texture.
Listening for Texture Updates
/// <summary>
/// Event raised when a new pixel buffer is available in the preview texture.
/// The preview texture and human texture will contain the latest pixel buffer.
/// </summary>
UnityEvent? OnCameraFrame { get; set; }
INCOMPLETE
Inspecting the Preview Rotation
/// <summary>
/// Get the camera preview rotation to become upright.
/// </summary>
PixelBuffer.Rotation rotation { get; }
INCOMPLETE
Handling User Gestures
INCOMPLETE
/// <summary>
/// Gesture mode.
/// </summary>
enum GestureMode : int {
/// <summary>
/// Do not respond to gestures.
/// </summary>
None = 0,
/// <summary>
/// Detect tap gestures.
/// </summary>
Tap = 1,
/// <summary>
/// Detect two-finger pinch gestures.
/// </summary>
Pinch = 2,
/// <summary>
/// Detect single-finger drag gestures.
/// This gesture mode is recommended when the user is holding a button to record a video.
/// </summary>
Drag = 3,
}
Handling Focus Gestures
/// <summary>
/// Focus gesture.
/// </summary>
GestureMode focusMode { get; set; } = GestureMode.None;
INCOMPLETE
Handling Exposure Gestures
/// <summary>
/// Exposure gesture.
/// </summary>
GestureMode exposureMode { get; set; } = GestureMode.None;
INCOMPLETE
Handling Zoom Gestures
/// <summary>
/// Zoom gesture.
/// </summary>
GestureMode zoomMode { get; set; } = GestureMode.None;
INCOMPLETE
Zoom gestures cannot be handled when using GestureMode.Tap
.