11 using System.Collections.
Generic;
24 public class Frame : IEquatable<Frame> {
26 private static Queue<Hand> _handPool;
41 Hands =
new List<Hand>();
48 public Frame(
long id,
long timestamp,
float fps, List<Hand> hands) {
58 throw new NotImplementedException();
65 throw new NotImplementedException();
71 throw new NotImplementedException();
89 for (
int i =
Hands.Count; i-- != 0;) {
113 return "Frame id: " + this.
Id +
" timestamp: " + this.
Timestamp;
164 internal void ResizeHandList(
int count) {
165 if (_handPool ==
null) {
166 _handPool =
new Queue<Hand>();
169 while (
Hands.Count < count) {
171 if (_handPool.Count > 0) {
172 newHand = _handPool.Dequeue();
174 newHand =
new Hand();
179 while (
Hands.Count > count) {
182 _handPool.Enqueue(lastHand);
The Frame class represents a set of hand and finger tracking data detected in a single frame.
override string ToString()
A string containing a brief, human readable description of the Frame object.
long Id
A unique ID for this Frame.
Frame()
Constructs a Frame object.
bool Equals(Frame other)
Compare Frame object equality.
long Timestamp
The frame capture time in microseconds elapsed since an arbitrary point in time in the past.
Hand Hand(int id)
The Hand object with the specified ID in this frame, or null if none exists.
Frame(long id, long timestamp, float fps, List< Hand > hands)
Constructs a new Frame.
float CurrentFramesPerSecond
The instantaneous framerate.
void Deserialize(byte[] arg)
List< Hand > Hands
The list of Hand objects detected in this frame, given in arbitrary order. The list can be empty if n...
The Hand class reports the physical characteristics of a detected hand.