👐
Hand & Finger Tracking for Unity
HomepageSupportContact
  • Hand Tracking Unity Plugin
    • Overview
    • System Requirements
    • Installation
    • QuickStart
    • Supported Joints
  • Help & Support
    • Ask for help
    • Request a feature
  • Examples
    • Detect hand and retrieve joints
    • No Code: Detect and visualize hands from a Sprite
    • Detect and visualize hands from a Sprite
    • Detect and visualize hands from a video
    • Use webcam to detect and visualize hands (2D Canvas)
    • Use webcam to detect and visualize hands (3D World space)
  • API Reference
    • Finger
      • Index
      • Middle
      • Palm
      • Pinky
      • Ring
      • Thumb
    • FingerJoint
    • FingerJointType
    • Hand
    • HandExtensions
    • HandSide
    • HandTracker
  • UI Reference
    • HandManager
    • HandViewer
    • HandVisual
    • ImageView
    • StreamSource
      • SpriteSource
      • VideoSource
      • WebcamSource
    • HandTrackerExtensions
    • WebcamSelector
Powered by GitBook
On this page
  • Constructors
  • Properties
  • Example
  1. UI Reference

StreamSource

Represents a stream source.

PreviousImageViewNextSpriteSource

Last updated 1 year ago

public class StreamSource : MonoBehaviour

Inherits class.

Constructors

Name
Description

StreamSource()

Creates a new StreamSource object.

Properties

Name
Type
Description

Timestamp

DateTime

Virtual. The stream timestamp.

Pixels

Virtual. The pixel color data for a mipmap level as Color32 structs.

Width

int

Virtual. The width of the WebcamTexture in pixels.

Height

int

Virtual. The height of the WebcamTexture in pixels.

Rotation

int

Virtual. The frame rotation

Example

The example shows how to manage a stream with the StreamSource class.

Create a StreamSource

To create a StreamSource, add a field for Unity to serialize.

[SerializeField] private StreamSource _stream;

Get stream information

Get the stream's timestamp, pixels, width, height and rotation.

// Get stream timestamp.
DateTime timestamp = _stream.Timestamp;

// Get stream pixels.
Color32[] pixels = _stream.Pixels;

// Get stream width.
int width = _stream.Width;

// Get stream height.
int height = _stream.Height;

// Get stream rotation.
int rotation = _stream.Rotation;

[]

UnityEngine.MonoBehaviour
UnityEngine.Color32