466 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
473 [StructLayout(LayoutKind.Sequential, Pack = 1)]
479 [StructLayout(LayoutKind.Sequential, Pack = 1)]
484 [StructLayout(LayoutKind.Sequential, Pack = 1)]
490 [StructLayout(LayoutKind.Sequential, Pack = 1)]
495 [StructLayout(LayoutKind.Sequential, Pack = 1)]
497 [MarshalAs(UnmanagedType.FunctionPtr)]
499 [MarshalAs(UnmanagedType.FunctionPtr)]
504 [StructLayout(LayoutKind.Sequential, Pack = 1)]
511 [StructLayout(LayoutKind.Sequential, Pack = 1)]
518 [StructLayout(LayoutKind.Sequential, Pack = 1)]
524 [StructLayout(LayoutKind.Sequential, Pack = 1)]
533 [StructLayout(LayoutKind.Sequential, Pack = 1)]
539 [StructLayout(LayoutKind.Sequential, Pack = 1)]
546 [StructLayout(LayoutKind.Sequential, Pack = 1)]
555 [StructLayout(LayoutKind.Sequential, Pack = 1)]
562 [StructLayout(LayoutKind.Sequential, Pack = 1)]
569 [StructLayout(LayoutKind.Sequential, Pack = 1)]
574 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
588 [StructLayout(LayoutKind.Sequential, Pack = 1)]
595 [StructLayout(LayoutKind.Sequential, Pack = 1)]
608 [StructLayout(LayoutKind.Sequential, Pack = 1)]
623 [StructLayout(LayoutKind.Sequential, Pack = 1)]
631 [StructLayout(LayoutKind.Sequential, Pack = 1)]
648 [StructLayout(LayoutKind.Sequential, Pack = 1)]
667 [StructLayout(LayoutKind.Sequential, Pack = 1)]
674 [StructLayout(LayoutKind.Sequential, Pack = 1)]
682 [StructLayout(LayoutKind.Sequential, Pack = 1)]
692 [StructLayout(LayoutKind.Sequential, Pack = 1)]
703 [StructLayout(LayoutKind.Sequential, Pack = 1)]
724 [StructLayout(LayoutKind.Sequential, Pack = 1)]
730 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
737 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
743 [StructLayout(LayoutKind.Explicit, Pack = 1)]
755 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
761 [StructLayout(LayoutKind.Sequential, Pack = 1)]
767 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
773 [StructLayout(LayoutKind.Sequential, Pack = 1)]
779 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
794 [DllImport(
"LeapC", EntryPoint =
"LeapGetNow")]
797 [DllImport(
"LeapC", EntryPoint =
"LeapCreateClockRebaser")]
800 [DllImport(
"LeapC", EntryPoint =
"LeapDestroyClockRebaser")]
803 [DllImport(
"LeapC", EntryPoint =
"LeapUpdateRebase")]
806 [DllImport(
"LeapC", EntryPoint =
"LeapRebaseClock")]
807 public static extern eLeapRS RebaseClock(IntPtr hClockRebaser, Int64 userClock, out Int64 leapClock);
809 [DllImport(
"LeapC", EntryPoint =
"LeapCreateConnection")]
813 [DllImport(
"LeapC", EntryPoint =
"LeapCreateConnection")]
819 [DllImport(
"LeapC", EntryPoint =
"LeapGetConnectionInfo")]
822 [DllImport(
"LeapC", EntryPoint =
"LeapOpenConnection")]
825 [DllImport(
"LeapC", EntryPoint =
"LeapSetAllocator")]
828 [DllImport(
"LeapC", EntryPoint =
"LeapGetDeviceList")]
831 [DllImport(
"LeapC", EntryPoint =
"LeapGetDeviceList")]
832 private static extern eLeapRS GetDeviceList(IntPtr hConnection, [In, Out] IntPtr pArray, out UInt32 pnArray);
835 return GetDeviceList(hConnection, IntPtr.Zero, out deviceCount);
838 [DllImport(
"LeapC", EntryPoint =
"LeapOpenDevice")]
841 [DllImport(
"LeapC", EntryPoint =
"LeapGetDeviceInfo", CharSet = CharSet.Ansi)]
844 [DllImport(
"LeapC", EntryPoint =
"LeapSetPolicyFlags")]
847 [DllImport(
"LeapC", EntryPoint =
"LeapSetPause")]
850 [DllImport(
"LeapC", EntryPoint =
"LeapPollConnection")]
853 [DllImport(
"LeapC", EntryPoint =
"LeapGetFrameSize")]
856 [DllImport(
"LeapC", EntryPoint =
"LeapInterpolateFrame")]
859 [DllImport(
"LeapC", EntryPoint =
"LeapInterpolateFrameFromTime")]
862 [DllImport(
"LeapC", EntryPoint =
"LeapInterpolateHeadPose")]
865 [DllImport(
"LeapC", EntryPoint =
"LeapPixelToRectilinear")]
868 [DllImport(
"LeapC", EntryPoint =
"LeapRectilinearToPixel")]
871 [DllImport(
"LeapC", EntryPoint =
"LeapCloseDevice")]
874 [DllImport(
"LeapC", EntryPoint =
"LeapCloseConnection")]
877 [DllImport(
"LeapC", EntryPoint =
"LeapDestroyConnection")]
880 [DllImport(
"LeapC", EntryPoint =
"LeapSaveConfigValue")]
881 private static extern eLeapRS SaveConfigValue(IntPtr hConnection,
string key, IntPtr value, out UInt32 requestId);
883 [DllImport(
"LeapC", EntryPoint =
"LeapRequestConfigValue")]
890 return SaveConfigWithValueType(hConnection, key, valueStruct, out requestId);
896 return SaveConfigWithValueType(hConnection, key, valueStruct, out requestId);
902 return SaveConfigWithValueType(hConnection, key, valueStruct, out requestId);
908 return SaveConfigWithRefType(hConnection, key, valueStruct, out requestId);
911 IntPtr configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct));
914 Marshal.StructureToPtr(valueStruct, configValue,
false);
915 callResult = SaveConfigValue(hConnection, key, configValue, out requestId);
917 Marshal.FreeHGlobal(configValue);
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));
925 Marshal.StructureToPtr(valueStruct, configValue,
false);
926 callResult = SaveConfigValue(hConnection, key, configValue, out requestId);
928 Marshal.FreeHGlobal(configValue);
933 [DllImport(
"LeapC", EntryPoint =
"LeapGetPointMappingSize")]
936 [DllImport(
"LeapC", EntryPoint =
"LeapGetPointMapping")]
939 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
943 [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
948 [DllImport(
"LeapC", EntryPoint =
"LeapRecordingOpen")]
951 [DllImport(
"LeapC", EntryPoint =
"LeapRecordingClose")]
954 [DllImport(
"LeapC", EntryPoint =
"LeapRecordingGetStatus")]
957 [DllImport(
"LeapC", EntryPoint =
"LeapRecordingReadSize")]
960 [DllImport(
"LeapC", EntryPoint =
"LeapRecordingRead")]
963 [DllImport(
"LeapC", EntryPoint =
"LeapRecordingWrite")]
966 [DllImport(
"LeapC", EntryPoint =
"LeapTelemetryProfiling")]
969 [DllImport(
"LeapC", EntryPoint =
"LeapTelemetryGetNow")]
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)
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)
static eLeapRS LeapRecordingGetStatus(IntPtr pRecording, ref LEAP_RECORDING_STATUS status)
static eLeapRS CreateConnection(out IntPtr pConnection)
static eLeapRS DestroyClockRebaser(IntPtr hClockRebaser)
static eLeapRS SaveConfigValue(IntPtr hConnection, string key, bool value, out UInt32 requestId)
static int DistortionSize
static eLeapRS SaveConfigValue(IntPtr hConnection, string key, float value, out UInt32 requestId)
static eLeapRS LeapTelemetryProfiling(IntPtr hConnection, ref LEAP_TELEMETRY_DATA telemetryData)
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)
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_UInt64
@ eLeapAllocatorType_Double
@ eLeapAllocatorType_Int64
@ eLeapAllocatorType_Int16
@ eLeapAllocatorType_Float
@ eLeapAllocatorType_UInt16
@ eLeapAllocatorType_Uint8
@ eLeapAllocatorType_UInt32
@ eLeapAllocatorType_Int32
@ eLeapAllocatorType_Int8
@ 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_64x64
A 64x64 matrix of pairs of points.
@ 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_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_Unknown
The type is unknown (which is an abnormal condition).
@ 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_Default
Default processed IR image
@ eLeapImageType_Raw
Image from raw sensor values
@ 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_Color
The device can send color images.
delegate IntPtr Allocate(UInt32 size, eLeapAllocatorType typeHint, IntPtr state)
@ 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_Stream
Flag set if the device is presently streaming frames
@ eLeapImageType_IR
An infrared image.
@ eLeapImageFormat_UNKNOWN
An invalid or unknown format.
@ eLeapImageType_RGBIr_Bayer
A Bayer RGBIr image with uncorrected RGB channels
@ 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_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_TrackingQueue
@ eLeapDroppedFrameType_PreprocessingQueue
@ eLeapDroppedFrameType_Other
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...
LEAP_VARIANT_REF_TYPE value
LEAP_VARIANT_VALUE_TYPE value
eLeapServiceDisposition flags
eLeapConnectionStatus status
eLeapDeviceStatus last_status
eLeapDroppedFrameType reason
LEAP_QUATERNION head_orientation
LEAP_VECTOR head_position
LEAP_IMAGE_PROPERTIES properties
eLeapLogSeverity severity
LEAP_QUATERNION orientation
LEAP_VECTOR stabilized_position
LEAP_QUATERNION(Leap.LeapQuaternion q)
Leap.LeapQuaternion ToLeapQuaternion()
Leap.Vector ToLeapVector()
LEAP_VECTOR(Leap.Vector leap)