Tanoda
LeapC.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9
10namespace LeapInternal {
11 using System;
12 using System.Runtime.InteropServices;
13
14 public enum eLeapConnectionStatus : uint {
31 };
32
33 public enum eLeapDeviceCaps : uint {
37 eLeapDeviceCaps_Color = 0x00000001,
38 };
39
40 public enum eLeapDeviceType : uint {
57 };
58
59 public enum eLeapServiceDisposition : uint {
65
71 };
72
78 };
79
80 public enum eLeapPolicyFlag : uint {
88 eLeapPolicyFlag_Images = 0x00000002,
92 eLeapPolicyFlag_OptimizeHMD = 0x00000004,
100 eLeapPolicyFlag_MapPoints = 0x00000080,
105 eLeapPolicyFlag_ScreenTop = 0x00000100,
106 };
107
108 public enum eLeapDeviceStatus : uint {
112 eLeapDeviceStatus_Streaming = 0x00000001,
116 eLeapDeviceStatus_Paused = 0x00000002,
121 eLeapDeviceStatus_Robust = 0x00000004,
125 eLeapDeviceStatus_Smudged = 0x00000008,
149 eLeapDeviceStatus_BadControl = 0xE8010004,
150 };
151
152 public enum eLeapImageType {
162 };
163
164 public enum eLeapImageFormat : uint {
172 eLeapImageType_IR = 0x317249,
176 eLeapImageType_RGBIr_Bayer = 0x49425247,
177 };
178
196 };
197
198 public enum eLeapHandType {
201 };
202
203 public enum eLeapLogSeverity {
220 };
221
222 public enum eLeapValueType : int {
231 };
232
233 public enum eLeapAllocatorType : uint {
244 };
245
246 public enum eLeapRS : uint {
250 eLeapRS_Success = 0x00000000,
256 eLeapRS_UnknownError = 0xE2010000,
260 eLeapRS_InvalidArgument = 0xE2010001,
268 eLeapRS_InsufficientBuffer = 0xE2010003,
272 eLeapRS_Timeout = 0xE2010004,
276 eLeapRS_NotConnected = 0xE2010005,
280 eLeapRS_HandshakeIncomplete = 0xE2010006,
284 eLeapRS_BufferSizeOverflow = 0xE2010007,
288 eLeapRS_ProtocolError = 0xE2010008,
292 eLeapRS_InvalidClientID = 0xE2010009,
297 eLeapRS_UnexpectedClosed = 0xE201000A,
320 eLeapRS_RoutineIsNotSeer = 0xE201000D,
327 eLeapRS_TimestampTooEarly = 0xE201000E,
331 eLeapRS_ConcurrentPoll = 0xE201000F,
335 eLeapRS_NotAvailable = 0xE7010002,
339 eLeapRS_NotStreaming = 0xE7010004,
344 eLeapRS_CannotOpenDevice = 0xE7010005,
345 };
346
347 public enum eLeapEventType {
442 };
443
444 public enum eLeapDeviceFlag : uint {
452 eLeapDeviceFlag_Stream = 0x00000001
453 };
454
459 };
460
461 //Note the following LeapC structs are just IntPtrs in C#:
462 // LEAP_CONNECTION is an IntPtr
463 // LEAP_DEVICE is an IntPtr
464 // LEAP_CLOCK_REBASER is an IntPtr
465
466 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
468 public UInt32 size;
469 public UInt32 flags;
470 public IntPtr server_namespace; //char*
471 }
472
473 [StructLayout(LayoutKind.Sequential, Pack = 1)]
474 public struct LEAP_CONNECTION_INFO {
475 public UInt32 size;
477 }
478
479 [StructLayout(LayoutKind.Sequential, Pack = 1)]
480 public struct LEAP_CONNECTION_EVENT {
482 }
483
484 [StructLayout(LayoutKind.Sequential, Pack = 1)]
485 public struct LEAP_DEVICE_REF {
486 public IntPtr handle; //void *
487 public UInt32 id;
488 }
489
490 [StructLayout(LayoutKind.Sequential, Pack = 1)]
492 public UInt32 flags;
493 }
494
495 [StructLayout(LayoutKind.Sequential, Pack = 1)]
496 public struct LEAP_ALLOCATOR {
497 [MarshalAs(UnmanagedType.FunctionPtr)]
499 [MarshalAs(UnmanagedType.FunctionPtr)]
501 public IntPtr state;
502 }
503
504 [StructLayout(LayoutKind.Sequential, Pack = 1)]
505 public struct LEAP_DEVICE_EVENT {
506 public UInt32 flags;
509 }
510
511 [StructLayout(LayoutKind.Sequential, Pack = 1)]
516 }
517
518 [StructLayout(LayoutKind.Sequential, Pack = 1)]
521 public IntPtr hDevice;
522 }
523
524 [StructLayout(LayoutKind.Sequential, Pack = 1)]
525 public struct LEAP_TRACKING_EVENT {
527 public Int64 tracking_id;
528 public UInt32 nHands;
529 public IntPtr pHands; //LEAP_HAND*
530 public float framerate;
531 }
532
533 [StructLayout(LayoutKind.Sequential, Pack = 1)]
535 public Int64 frame_id;
537 }
538
539 [StructLayout(LayoutKind.Sequential, Pack = 1)]
541 public Int64 frame_id;
542 public Int64 timestamp;
543 public UInt32 nPoints;
544 }
545
546 [StructLayout(LayoutKind.Sequential, Pack = 1)]
547 public struct LEAP_POINT_MAPPING {
548 public Int64 frame_id;
549 public Int64 timestamp;
550 public UInt32 nPoints;
551 public IntPtr points; //LEAP_VECTOR*
552 public IntPtr ids; //uint32*
553 }
554
555 [StructLayout(LayoutKind.Sequential, Pack = 1)]
556 public struct LEAP_HEAD_POSE_EVENT {
557 public Int64 timestamp;
560 }
561
562 [StructLayout(LayoutKind.Sequential, Pack = 1)]
564 public UInt32 size;
566 public IntPtr eventStructPtr;
567 }
568
569 [StructLayout(LayoutKind.Sequential, Pack = 1)]
571 public UInt32 reserved;
572 }
573
574 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
575 public struct LEAP_DEVICE_INFO {
576 public UInt32 size;
577 public UInt32 status;
580 public UInt32 baseline;
581 public UInt32 serial_length;
582 public IntPtr serial; //char*
583 public float h_fov;
584 public float v_fov;
585 public UInt32 range;
586 }
587
588 [StructLayout(LayoutKind.Sequential, Pack = 1)]
589 public struct LEAP_FRAME_HEADER {
590 public IntPtr reserved;
591 public Int64 frame_id;
592 public Int64 timestamp;
593 }
594
595 [StructLayout(LayoutKind.Sequential, Pack = 1)]
596 public struct LEAP_IMAGE_PROPERTIES {
599 public UInt32 bpp;
600 public UInt32 width;
601 public UInt32 height;
602 public float x_scale;
603 public float y_scale;
604 public float x_offset;
605 public float y_offset;
606 }
607
608 [StructLayout(LayoutKind.Sequential, Pack = 1)]
609 public struct LEAP_IMAGE {
611 public UInt64 matrix_version;
612
613 //LEAP_DISTORTION_MATRIX*
614 //The struct LEAP_DISTORTION_MATRIX cannot exist in c# without using unsafe code
615 //This is ok though, since it is just an array of floats
616 //so you need to manually marshal this pointer to the correct size and type
617 //See LeapC.h for details
618 public IntPtr distortionMatrix;
619 public IntPtr data; // void* of an allocator-supplied buffer
620 public UInt32 offset; // Offset, in bytes, from beginning of buffer to start of image data
621 }
622
623 [StructLayout(LayoutKind.Sequential, Pack = 1)]
624 public struct LEAP_IMAGE_EVENT {
628 public IntPtr calib; //LEAP_CALIBRATION
629 }
630
631 [StructLayout(LayoutKind.Sequential, Pack = 1)]
632 public struct LEAP_VECTOR {
633 public float x;
634 public float y;
635 public float z;
636
638 return new Leap.Vector(x, y, z);
639 }
640
641 public LEAP_VECTOR(Leap.Vector leap) {
642 x = leap.x;
643 y = leap.y;
644 z = leap.z;
645 }
646 }
647
648 [StructLayout(LayoutKind.Sequential, Pack = 1)]
649 public struct LEAP_QUATERNION {
650 public float x;
651 public float y;
652 public float z;
653 public float w;
654
656 return new Leap.LeapQuaternion(x, y, z, w);
657 }
658
660 x = q.x;
661 y = q.y;
662 z = q.z;
663 w = q.w;
664 }
665 }
666
667 [StructLayout(LayoutKind.Sequential, Pack = 1)]
668 public struct LEAP_MATRIX_3x3 {
672 }
673
674 [StructLayout(LayoutKind.Sequential, Pack = 1)]
675 public struct LEAP_BONE {
678 public float width;
680 }
681
682 [StructLayout(LayoutKind.Sequential, Pack = 1)]
683 public struct LEAP_DIGIT {
684 public Int32 finger_id;
689 public Int32 is_extended;
690 }
691
692 [StructLayout(LayoutKind.Sequential, Pack = 1)]
693 public struct LEAP_PALM {
698 public float width;
701 }
702
703 [StructLayout(LayoutKind.Sequential, Pack = 1)]
704 public struct LEAP_HAND {
705 public UInt32 id;
706 public UInt32 flags;
708 public float confidence;
709 public UInt64 visible_time;
710 public float pinch_distance;
711 public float grab_angle;
712 public float pinch_strength;
713 public float grab_strength;
721 }
722
723
724 [StructLayout(LayoutKind.Sequential, Pack = 1)]
725 public struct LEAP_TIP {
727 public float radius;
728 }
729
730 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
731 public struct LEAP_LOG_EVENT {
733 public Int64 timestamp;
734 public IntPtr message; //char*
735 }
736
737 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
738 public struct LEAP_POLICY_EVENT {
739 public UInt32 reserved;
740 public UInt32 current_policy;
741 }
742
743 [StructLayout(LayoutKind.Explicit, Pack = 1)]
745 [FieldOffset(0)]
747 [FieldOffset(4)]
748 public Int32 boolValue;
749 [FieldOffset(4)]
750 public Int32 intValue;
751 [FieldOffset(4)]
752 public float floatValue;
753 }
754
755 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
756 public struct LEAP_VARIANT_REF_TYPE {
758 public string stringValue;
759 }
760
761 [StructLayout(LayoutKind.Sequential, Pack = 1)]
763 public UInt32 requestId;
765 }
766
767 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
769 public UInt32 requestId;
771 }
772
773 [StructLayout(LayoutKind.Sequential, Pack = 1)]
775 public UInt32 requestId;
776 public bool status;
777 }
778
779 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
780 public struct LEAP_TELEMETRY_DATA {
781 public UInt32 threadId;
782 public UInt64 startTime;
783 public UInt64 endTime;
784 public UInt32 zoneDepth;
785 public string fileName;
786 public UInt32 lineNumber;
787 public string zoneName;
788 }
789
790 public class LeapC {
791 private LeapC() { }
792 public static int DistortionSize = 64;
793
794 [DllImport("LeapC", EntryPoint = "LeapGetNow")]
795 public static extern long GetNow();
796
797 [DllImport("LeapC", EntryPoint = "LeapCreateClockRebaser")]
798 public static extern eLeapRS CreateClockRebaser(out IntPtr phClockRebaser);
799
800 [DllImport("LeapC", EntryPoint = "LeapDestroyClockRebaser")]
801 public static extern eLeapRS DestroyClockRebaser(IntPtr hClockRebaser);
802
803 [DllImport("LeapC", EntryPoint = "LeapUpdateRebase")]
804 public static extern eLeapRS UpdateRebase(IntPtr hClockRebaser, Int64 userClock, Int64 leapClock);
805
806 [DllImport("LeapC", EntryPoint = "LeapRebaseClock")]
807 public static extern eLeapRS RebaseClock(IntPtr hClockRebaser, Int64 userClock, out Int64 leapClock);
808
809 [DllImport("LeapC", EntryPoint = "LeapCreateConnection")]
810 public static extern eLeapRS CreateConnection(ref LEAP_CONNECTION_CONFIG pConfig, out IntPtr pConnection);
811
812 //Overrides to allow config to be set to null to use default config
813 [DllImport("LeapC", EntryPoint = "LeapCreateConnection")]
814 private static extern eLeapRS CreateConnection(IntPtr nulled, out IntPtr pConnection);
815 public static eLeapRS CreateConnection(out IntPtr pConnection) {
816 return CreateConnection(IntPtr.Zero, out pConnection);
817 }
818
819 [DllImport("LeapC", EntryPoint = "LeapGetConnectionInfo")]
820 public static extern eLeapRS GetConnectionInfo(IntPtr hConnection, ref LEAP_CONNECTION_INFO pInfo);
821
822 [DllImport("LeapC", EntryPoint = "LeapOpenConnection")]
823 public static extern eLeapRS OpenConnection(IntPtr hConnection);
824
825 [DllImport("LeapC", EntryPoint = "LeapSetAllocator")]
826 public static extern eLeapRS SetAllocator(IntPtr hConnection, ref LEAP_ALLOCATOR pAllocator);
827
828 [DllImport("LeapC", EntryPoint = "LeapGetDeviceList")]
829 public static extern eLeapRS GetDeviceList(IntPtr hConnection, [In, Out] LEAP_DEVICE_REF[] pArray, out UInt32 pnArray);
830
831 [DllImport("LeapC", EntryPoint = "LeapGetDeviceList")]
832 private static extern eLeapRS GetDeviceList(IntPtr hConnection, [In, Out] IntPtr pArray, out UInt32 pnArray);
833 //Override to allow pArray argument to be set to null (IntPtr.Zero) in order to get the device count
834 public static eLeapRS GetDeviceCount(IntPtr hConnection, out UInt32 deviceCount) {
835 return GetDeviceList(hConnection, IntPtr.Zero, out deviceCount);
836 }
837
838 [DllImport("LeapC", EntryPoint = "LeapOpenDevice")]
839 public static extern eLeapRS OpenDevice(LEAP_DEVICE_REF rDevice, out IntPtr pDevice);
840
841 [DllImport("LeapC", EntryPoint = "LeapGetDeviceInfo", CharSet = CharSet.Ansi)]
842 public static extern eLeapRS GetDeviceInfo(IntPtr hDevice, ref LEAP_DEVICE_INFO info);
843
844 [DllImport("LeapC", EntryPoint = "LeapSetPolicyFlags")]
845 public static extern eLeapRS SetPolicyFlags(IntPtr hConnection, UInt64 set, UInt64 clear);
846
847 [DllImport("LeapC", EntryPoint = "LeapSetPause")]
848 public static extern eLeapRS LeapSetPause(IntPtr hConnection, bool pause);
849
850 [DllImport("LeapC", EntryPoint = "LeapPollConnection")]
851 public static extern eLeapRS PollConnection(IntPtr hConnection, UInt32 timeout, ref LEAP_CONNECTION_MESSAGE msg);
852
853 [DllImport("LeapC", EntryPoint = "LeapGetFrameSize")]
854 public static extern eLeapRS GetFrameSize(IntPtr hConnection, Int64 timestamp, out UInt64 pncbEvent);
855
856 [DllImport("LeapC", EntryPoint = "LeapInterpolateFrame")]
857 public static extern eLeapRS InterpolateFrame(IntPtr hConnection, Int64 timestamp, IntPtr pEvent, UInt64 ncbEvent);
858
859 [DllImport("LeapC", EntryPoint = "LeapInterpolateFrameFromTime")]
860 public static extern eLeapRS InterpolateFrameFromTime(IntPtr hConnection, Int64 timestamp, Int64 sourceTimestamp, IntPtr pEvent, UInt64 ncbEvent);
861
862 [DllImport("LeapC", EntryPoint = "LeapInterpolateHeadPose")]
863 public static extern eLeapRS InterpolateHeadPose(IntPtr hConnection, Int64 timestamp, ref LEAP_HEAD_POSE_EVENT headPose);
864
865 [DllImport("LeapC", EntryPoint = "LeapPixelToRectilinear")]
866 public static extern LEAP_VECTOR LeapPixelToRectilinear(IntPtr hConnection, eLeapPerspectiveType camera, LEAP_VECTOR pixel);
867
868 [DllImport("LeapC", EntryPoint = "LeapRectilinearToPixel")]
869 public static extern LEAP_VECTOR LeapRectilinearToPixel(IntPtr hConnection, eLeapPerspectiveType camera, LEAP_VECTOR rectilinear);
870
871 [DllImport("LeapC", EntryPoint = "LeapCloseDevice")]
872 public static extern void CloseDevice(IntPtr pDevice);
873
874 [DllImport("LeapC", EntryPoint = "LeapCloseConnection")]
875 public static extern eLeapRS CloseConnection(IntPtr hConnection);
876
877 [DllImport("LeapC", EntryPoint = "LeapDestroyConnection")]
878 public static extern void DestroyConnection(IntPtr connection);
879
880 [DllImport("LeapC", EntryPoint = "LeapSaveConfigValue")]
881 private static extern eLeapRS SaveConfigValue(IntPtr hConnection, string key, IntPtr value, out UInt32 requestId);
882
883 [DllImport("LeapC", EntryPoint = "LeapRequestConfigValue")]
884 public static extern eLeapRS RequestConfigValue(IntPtr hConnection, string name, out UInt32 request_id);
885
886 public static eLeapRS SaveConfigValue(IntPtr hConnection, string key, bool value, out UInt32 requestId) {
887 LEAP_VARIANT_VALUE_TYPE valueStruct = new LEAP_VARIANT_VALUE_TYPE(); //This is a C# approximation of a C union
888 valueStruct.type = eLeapValueType.eLeapValueType_Boolean;
889 valueStruct.boolValue = value ? 1 : 0;
890 return SaveConfigWithValueType(hConnection, key, valueStruct, out requestId);
891 }
892 public static eLeapRS SaveConfigValue(IntPtr hConnection, string key, Int32 value, out UInt32 requestId) {
894 valueStruct.type = eLeapValueType.eLeapValueType_Int32;
895 valueStruct.intValue = value;
896 return SaveConfigWithValueType(hConnection, key, valueStruct, out requestId);
897 }
898 public static eLeapRS SaveConfigValue(IntPtr hConnection, string key, float value, out UInt32 requestId) {
900 valueStruct.type = eLeapValueType.eLeapValueType_Float;
901 valueStruct.floatValue = value;
902 return SaveConfigWithValueType(hConnection, key, valueStruct, out requestId);
903 }
904 public static eLeapRS SaveConfigValue(IntPtr hConnection, string key, string value, out UInt32 requestId) {
905 LEAP_VARIANT_REF_TYPE valueStruct;
906 valueStruct.type = eLeapValueType.eLeapValueType_String;
907 valueStruct.stringValue = value;
908 return SaveConfigWithRefType(hConnection, key, valueStruct, out requestId);
909 }
910 private static eLeapRS SaveConfigWithValueType(IntPtr hConnection, string key, LEAP_VARIANT_VALUE_TYPE valueStruct, out UInt32 requestId) {
911 IntPtr configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct));
912 eLeapRS callResult = eLeapRS.eLeapRS_UnknownError;
913 try {
914 Marshal.StructureToPtr(valueStruct, configValue, false);
915 callResult = SaveConfigValue(hConnection, key, configValue, out requestId);
916 } finally {
917 Marshal.FreeHGlobal(configValue);
918 }
919 return callResult;
920 }
921 private static eLeapRS SaveConfigWithRefType(IntPtr hConnection, string key, LEAP_VARIANT_REF_TYPE valueStruct, out UInt32 requestId) {
922 IntPtr configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct));
923 eLeapRS callResult = eLeapRS.eLeapRS_UnknownError;
924 try {
925 Marshal.StructureToPtr(valueStruct, configValue, false);
926 callResult = SaveConfigValue(hConnection, key, configValue, out requestId);
927 } finally {
928 Marshal.FreeHGlobal(configValue);
929 }
930 return callResult;
931 }
932
933 [DllImport("LeapC", EntryPoint = "LeapGetPointMappingSize")]
934 public static extern eLeapRS GetPointMappingSize(IntPtr hConnection, ref ulong pSize);
935
936 [DllImport("LeapC", EntryPoint = "LeapGetPointMapping")]
937 public static extern eLeapRS GetPointMapping(IntPtr hConnection, IntPtr pointMapping, ref ulong pSize);
938
939 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
941 public UInt32 mode;
942 }
943 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
944 public struct LEAP_RECORDING_STATUS {
945 public UInt32 mode;
946 }
947
948 [DllImport("LeapC", EntryPoint = "LeapRecordingOpen")]
949 public static extern eLeapRS RecordingOpen(ref IntPtr ppRecording, string userPath, LEAP_RECORDING_PARAMETERS parameters);
950
951 [DllImport("LeapC", EntryPoint = "LeapRecordingClose")]
952 public static extern eLeapRS RecordingClose(ref IntPtr ppRecording);
953
954 [DllImport("LeapC", EntryPoint = "LeapRecordingGetStatus")]
955 public static extern eLeapRS LeapRecordingGetStatus(IntPtr pRecording, ref LEAP_RECORDING_STATUS status);
956
957 [DllImport("LeapC", EntryPoint = "LeapRecordingReadSize")]
958 public static extern eLeapRS RecordingReadSize(IntPtr pRecording, ref UInt64 pncbEvent);
959
960 [DllImport("LeapC", EntryPoint = "LeapRecordingRead")]
961 public static extern eLeapRS RecordingRead(IntPtr pRecording, ref LEAP_TRACKING_EVENT pEvent, UInt64 ncbEvent);
962
963 [DllImport("LeapC", EntryPoint = "LeapRecordingWrite")]
964 public static extern eLeapRS RecordingWrite(IntPtr pRecording, ref LEAP_TRACKING_EVENT pEvent, ref UInt64 pnBytesWritten);
965
966 [DllImport("LeapC", EntryPoint = "LeapTelemetryProfiling")]
967 public static extern eLeapRS LeapTelemetryProfiling(IntPtr hConnection, ref LEAP_TELEMETRY_DATA telemetryData);
968
969 [DllImport("LeapC", EntryPoint = "LeapTelemetryGetNow")]
970 public static extern UInt64 TelemetryGetNow();
971 }
972}
static eLeapRS RecordingClose(ref IntPtr ppRecording)
static eLeapRS RecordingOpen(ref IntPtr ppRecording, string userPath, LEAP_RECORDING_PARAMETERS parameters)
static void CloseDevice(IntPtr pDevice)
static eLeapRS OpenConnection(IntPtr hConnection)
static eLeapRS UpdateRebase(IntPtr hClockRebaser, Int64 userClock, Int64 leapClock)
static eLeapRS CreateConnection(ref LEAP_CONNECTION_CONFIG pConfig, out IntPtr pConnection)
static eLeapRS GetDeviceInfo(IntPtr hDevice, ref LEAP_DEVICE_INFO info)
static eLeapRS SaveConfigValue(IntPtr hConnection, string key, string value, out UInt32 requestId)
Definition: LeapC.cs:904
static eLeapRS InterpolateFrame(IntPtr hConnection, Int64 timestamp, IntPtr pEvent, UInt64 ncbEvent)
static eLeapRS GetPointMapping(IntPtr hConnection, IntPtr pointMapping, ref ulong pSize)
static eLeapRS InterpolateHeadPose(IntPtr hConnection, Int64 timestamp, ref LEAP_HEAD_POSE_EVENT headPose)
static UInt64 TelemetryGetNow()
static eLeapRS PollConnection(IntPtr hConnection, UInt32 timeout, ref LEAP_CONNECTION_MESSAGE msg)
static eLeapRS RebaseClock(IntPtr hClockRebaser, Int64 userClock, out Int64 leapClock)
static eLeapRS GetPointMappingSize(IntPtr hConnection, ref ulong pSize)
static eLeapRS GetDeviceList(IntPtr hConnection, [In, Out] LEAP_DEVICE_REF[] pArray, out UInt32 pnArray)
static LEAP_VECTOR LeapRectilinearToPixel(IntPtr hConnection, eLeapPerspectiveType camera, LEAP_VECTOR rectilinear)
static eLeapRS SaveConfigValue(IntPtr hConnection, string key, Int32 value, out UInt32 requestId)
Definition: LeapC.cs:892
static eLeapRS LeapRecordingGetStatus(IntPtr pRecording, ref LEAP_RECORDING_STATUS status)
static eLeapRS CreateConnection(out IntPtr pConnection)
Definition: LeapC.cs:815
static eLeapRS DestroyClockRebaser(IntPtr hClockRebaser)
static eLeapRS SaveConfigValue(IntPtr hConnection, string key, bool value, out UInt32 requestId)
Definition: LeapC.cs:886
static int DistortionSize
Definition: LeapC.cs:792
static eLeapRS SaveConfigValue(IntPtr hConnection, string key, float value, out UInt32 requestId)
Definition: LeapC.cs:898
static eLeapRS LeapTelemetryProfiling(IntPtr hConnection, ref LEAP_TELEMETRY_DATA telemetryData)
static long GetNow()
static eLeapRS RequestConfigValue(IntPtr hConnection, string name, out UInt32 request_id)
static void DestroyConnection(IntPtr connection)
static LEAP_VECTOR LeapPixelToRectilinear(IntPtr hConnection, eLeapPerspectiveType camera, LEAP_VECTOR pixel)
static eLeapRS GetDeviceCount(IntPtr hConnection, out UInt32 deviceCount)
Definition: LeapC.cs:834
static eLeapRS GetConnectionInfo(IntPtr hConnection, ref LEAP_CONNECTION_INFO pInfo)
static eLeapRS OpenDevice(LEAP_DEVICE_REF rDevice, out IntPtr pDevice)
static eLeapRS InterpolateFrameFromTime(IntPtr hConnection, Int64 timestamp, Int64 sourceTimestamp, IntPtr pEvent, UInt64 ncbEvent)
static eLeapRS RecordingReadSize(IntPtr pRecording, ref UInt64 pncbEvent)
static eLeapRS SetPolicyFlags(IntPtr hConnection, UInt64 set, UInt64 clear)
static eLeapRS RecordingWrite(IntPtr pRecording, ref LEAP_TRACKING_EVENT pEvent, ref UInt64 pnBytesWritten)
static eLeapRS RecordingRead(IntPtr pRecording, ref LEAP_TRACKING_EVENT pEvent, UInt64 ncbEvent)
static eLeapRS GetFrameSize(IntPtr hConnection, Int64 timestamp, out UInt64 pncbEvent)
static eLeapRS CloseConnection(IntPtr hConnection)
static eLeapRS LeapSetPause(IntPtr hConnection, bool pause)
static eLeapRS CreateClockRebaser(out IntPtr phClockRebaser)
static eLeapRS SetAllocator(IntPtr hConnection, ref LEAP_ALLOCATOR pAllocator)
eLeapAllocatorType
Definition: LeapC.cs:233
eLeapDeviceStatus
Definition: LeapC.cs:108
@ eLeapDeviceStatus_BadFirmware
Corrupt firmware and/or cannot receive a required firmware update.
@ eLeapDeviceStatus_LowResource
The device has entered low-resource mode.
@ eLeapDeviceStatus_Robust
There are known sources of infrared interference. Device has transitioned to robust mode in order to ...
@ eLeapDeviceStatus_BadTransport
Exhibiting USB communications issues.
@ eLeapDeviceStatus_Paused
Device streaming has been paused.
@ eLeapDeviceStatus_UnknownFailure
The device has failed, but the failure reason is not known.
@ eLeapDeviceStatus_Streaming
Presently sending frames to all clients that have requested them.
@ eLeapDeviceStatus_BadCalibration
Bad calibration, cannot send frames.
@ eLeapDeviceStatus_Smudged
The device's window is smudged, tracking may be degraded.
@ eLeapDeviceStatus_BadControl
Missing critical control interfaces needed for communication.
eDistortionMatrixType
Definition: LeapC.cs:73
@ eDistortionMatrixType_64x64
A 64x64 matrix of pairs of points.
eLeapDeviceType
Definition: LeapC.cs:40
@ eLeapDeviceType_Dragonfly
Internal research product codename "Dragonfly".
@ eLeapDevicePID_Rigel
Research product codename "Rigel".
@ eLeapDeviceType_Nightcrawler
Internal research product codename "Nightcrawler".
@ eLeapDeviceType_Peripheral
The Leap Motion consumer peripheral
delegate void Deallocate(IntPtr buffer, IntPtr state)
eLeapConnectionStatus
Definition: LeapC.cs:14
@ eLeapConnectionStatus_HandshakeIncomplete
The connection handshake has not completed.
@ eLeapConnectionStatus_NotConnected
A connection has been established.
@ eLeapConnectionStatus_Connected
The connection has not been completed. Call OpenConnection.
@ eLeapConnectionStatus_NotRunning
A connection could not be established because the server does not appear to be running.
eLeapValueType
Definition: LeapC.cs:222
@ eLeapValueType_Unknown
The type is unknown (which is an abnormal condition).
eLeapEventType
Definition: LeapC.cs:347
@ eLeapEventType_ImageRequestError
The request for an image has failed. The message contains information about the failure....
@ eLeapEventType_HeadPose
A new head pose is available.
@ eLeapEventType_Policy
A policy change has occurred. This can be due to setting a policy with LeapSetPolicyFlags() or due to...
@ eLeapEventType_PointMappingChange
Notification that point mapping has changed.
@ eLeapEventType_Connection
A connection to the Leap Motion service has been established.
@ eLeapEventType_ConnectionLost
The connection to the Leap Motion service has been lost.
@ eLeapEventType_None
No event has occurred within the timeout period specified when calling LeapPollConnection().
@ eLeapEventType_ImageComplete
The request for an image is complete. The image data has been completely written to the application-p...
@ eLeapEventType_Tracking
A tracking frame. The message contains the tracking data for the frame.
@ eLeapEventType_DroppedFrame
A tracking frame has been dropped by the service.
@ eLeapEventType_LogEvent
A system message.
@ eLeapEventType_ConfigResponse
The asynchronous response to a call to LeapRequestConfigValue(). Contains the value of requested conf...
@ eLeapEventType_DeviceStatusChange
Notification that a status change has been detected on an attached device.
@ eLeapEventType_ConfigChange
The asynchronous response to a call to LeapSaveConfigValue(). Reports whether the change succeeded or...
@ eLeapEventType_LogEvents
An array of system messages.
@ eLeapEventType_DeviceFailure
Note that unplugging a device generates an eLeapEventType_DeviceLost event message,...
@ eLeapEventType_Image
Notification that an unrequested stereo image pair is available.
@ eLeapEventType_DeviceLost
The device connection has been lost.
@ eLeapEventType_Device
A device has been detected or plugged-in. A device event is dispatched after a connection is establis...
eLeapImageType
Definition: LeapC.cs:152
@ eLeapImageType_Default
Default processed IR image
@ eLeapImageType_Raw
Image from raw sensor values
eLeapServiceDisposition
Definition: LeapC.cs:59
@ eLeapServiceState_PoorPerformancePause
The service has paused itself due to an insufficient frame rate from the hardware.
@ eLeapServiceState_LowFpsDetected
The service cannot receive frames fast enough from the underlying hardware.
eLeapDeviceCaps
Definition: LeapC.cs:33
@ eLeapDeviceCaps_Color
The device can send color images.
delegate IntPtr Allocate(UInt32 size, eLeapAllocatorType typeHint, IntPtr state)
eLeapPolicyFlag
Definition: LeapC.cs:80
@ eLeapPolicyFlag_MapPoints
Allows streaming map points.
@ eLeapPolicyFlag_AllowPauseResume
Modifies the security token to allow calls to LeapPauseDevice to succeed
@ eLeapPolicyFlag_Images
Allow streaming images
@ eLeapPolicyFlag_BackgroundFrames
Allows frame receipt even when this application is not the foreground application.
@ eLeapPolicyFlag_OptimizeHMD
Optimize HMD Policy Flag.
@ eLeapPolicyFlag_ScreenTop
The policy specifying whether to optimize tracking for screen-top device.
eLeapDeviceFlag
Definition: LeapC.cs:444
@ eLeapDeviceFlag_Stream
Flag set if the device is presently streaming frames
eLeapImageFormat
Definition: LeapC.cs:164
@ eLeapImageType_IR
An infrared image.
@ eLeapImageFormat_UNKNOWN
An invalid or unknown format.
@ eLeapImageType_RGBIr_Bayer
A Bayer RGBIr image with uncorrected RGB channels
eLeapLogSeverity
Definition: LeapC.cs:203
@ eLeapLogSeverity_Information
A system status message.
@ eLeapLogSeverity_Critical
A message about a fault that could render the software or device non-functional.
@ eLeapLogSeverity_Warning
A message warning about a condition that could degrade device capabilities.
@ eLeapLogSeverity_Unknown
The message severity is not known or was not specified.
@ eLeapRS_UnexpectedClosed
The connection to the service was unexpectedly closed while reading or writing a message....
@ eLeapRS_UnknownTrackingFrameID
The specified frame ID is not valid or is no longer valid
@ eLeapRS_Success
The operation completed successfully.
@ eLeapRS_NotAvailable
A connection to the Leap Motion service could not be established.
@ eLeapRS_BufferSizeOverflow
The specified buffer size is too large.
@ eLeapRS_ProtocolError
A communications protocol error occurred.
@ eLeapRS_RoutineIsNotSeer
The specified timestamp references a future point in time
@ eLeapRS_InvalidArgument
An invalid argument was specified.
@ eLeapRS_InvalidClientID
The server incorrectly specified zero as a client ID.
@ eLeapRS_UnknownImageFrameRequest
The specified request token does not appear to be valid
@ eLeapRS_InsufficientResources
Insufficient resources existed to complete the request.
@ eLeapRS_UnknownError
An undetermined error has occurred. This is usually the result of an abnormal operating condition in ...
@ eLeapRS_CannotOpenDevice
The specified device could not be opened. It is possible that the device identifier is invalid,...
@ eLeapRS_Timeout
The requested operation has timed out.
@ eLeapRS_InsufficientBuffer
The specified buffer was not large enough to complete the request.
@ eLeapRS_NotStreaming
The requested operation can only be performed while the device is sending data.
@ eLeapRS_ConcurrentPoll
LeapPollConnection is called concurrently.
@ eLeapRS_TimestampTooEarly
The specified timestamp references a point too far in the past
@ eLeapRS_HandshakeIncomplete
The operation is invalid because the connection is not complete.
@ eLeapRS_NotConnected
The operation is invalid because there is no current connection.
eLeapPerspectiveType
Definition: LeapC.cs:179
@ eLeapPerspectiveType_invalid
An unknown or invalid type.
@ eLeapPerspectiveType_stereo_left
A canonically left image.
@ eLeapPerspectiveType_mono
Reserved for future use.
@ eLeapPerspectiveType_stereo_right
A canonically right image.
eLeapDroppedFrameType
Definition: LeapC.cs:455
The LeapQuaternion struct represents a rotation in three-dimensional space.
The Vector struct represents a three-component mathematical vector or point such as a direction or po...
Definition: Vector.cs:36
LEAP_QUATERNION rotation
Definition: LeapC.cs:679
LEAP_VECTOR prev_joint
Definition: LeapC.cs:676
LEAP_VECTOR next_joint
Definition: LeapC.cs:677
LEAP_VARIANT_VALUE_TYPE value
Definition: LeapC.cs:764
eLeapServiceDisposition flags
Definition: LeapC.cs:481
eLeapConnectionStatus status
Definition: LeapC.cs:476
eLeapDeviceStatus status
Definition: LeapC.cs:508
LEAP_DEVICE_REF device
Definition: LeapC.cs:507
eLeapDeviceType type
Definition: LeapC.cs:579
eLeapDeviceCaps caps
Definition: LeapC.cs:578
LEAP_BONE proximal
Definition: LeapC.cs:686
LEAP_BONE distal
Definition: LeapC.cs:688
LEAP_BONE intermediate
Definition: LeapC.cs:687
LEAP_BONE metacarpal
Definition: LeapC.cs:685
eLeapDroppedFrameType reason
Definition: LeapC.cs:536
LEAP_DIGIT middle
Definition: LeapC.cs:717
LEAP_DIGIT pinky
Definition: LeapC.cs:719
LEAP_PALM palm
Definition: LeapC.cs:714
LEAP_DIGIT thumb
Definition: LeapC.cs:715
LEAP_DIGIT ring
Definition: LeapC.cs:718
eLeapHandType type
Definition: LeapC.cs:707
LEAP_DIGIT index
Definition: LeapC.cs:716
LEAP_QUATERNION head_orientation
Definition: LeapC.cs:559
LEAP_FRAME_HEADER info
Definition: LeapC.cs:625
LEAP_IMAGE_PROPERTIES properties
Definition: LeapC.cs:610
IntPtr distortionMatrix
Definition: LeapC.cs:618
eLeapLogSeverity severity
Definition: LeapC.cs:732
LEAP_VECTOR direction
Definition: LeapC.cs:699
LEAP_VECTOR position
Definition: LeapC.cs:694
LEAP_QUATERNION orientation
Definition: LeapC.cs:700
LEAP_VECTOR normal
Definition: LeapC.cs:697
LEAP_VECTOR stabilized_position
Definition: LeapC.cs:695
LEAP_VECTOR velocity
Definition: LeapC.cs:696
LEAP_QUATERNION(Leap.LeapQuaternion q)
Definition: LeapC.cs:659
Leap.LeapQuaternion ToLeapQuaternion()
Definition: LeapC.cs:655
LEAP_VECTOR position
Definition: LeapC.cs:726
LEAP_FRAME_HEADER info
Definition: LeapC.cs:526
Leap.Vector ToLeapVector()
Definition: LeapC.cs:637
LEAP_VECTOR(Leap.Vector leap)
Definition: LeapC.cs:641