Leap Motion C API  4.0.0
The API to the LeapC library.
Data Structures

Structs passed to and received from LeapC functions. More...

Data Structures

struct  LEAP_DEVICE_REF
 A reference to a Leap device. More...
 
struct  LEAP_CONNECTION_CONFIG
 Specifies the configuration for a connection. More...
 
struct  LEAP_ALLOCATOR
 Specifies the allocator/deallocator functions to be used when the library needs to dynamically manage memory. More...
 
struct  LEAP_CONNECTION_EVENT
 Received from LeapPollConnection() when a connection to the Leap Motion service is established. More...
 
struct  LEAP_CONNECTION_LOST_EVENT
 Received from LeapPollConnection() when a connection to the Leap Motion service is lost. More...
 
struct  LEAP_CONNECTION_INFO
 Information about a connection. More...
 
struct  LEAP_POLICY_EVENT
 The response from a request to get or set a policy. More...
 
struct  LEAP_VARIANT
 A variant data type used to get and set service configuration values. More...
 
struct  LEAP_CONFIG_RESPONSE_EVENT
 Contains the response to a configuration value request. More...
 
struct  LEAP_CONFIG_CHANGE_EVENT
 The result of a configuration change request. More...
 
struct  LEAP_DEVICE_INFO
 Properties of a Leap device. More...
 
struct  LEAP_DEVICE_EVENT
 Device event information. More...
 
struct  LEAP_DEVICE_FAILURE_EVENT
 Device failure information. More...
 
struct  LEAP_FRAME_HEADER
 Identifying information for a frame of tracking data. More...
 
struct  LEAP_IMAGE_PROPERTIES
 Properties of a sensor image. More...
 
struct  LEAP_DISTORTION_MATRIX
 A matrix containing lens distortion correction coordinates. More...
 
struct  LEAP_IMAGE_FRAME_DESCRIPTION
 Describes the image to request. More...
 
struct  LEAP_VECTOR
 A three element, floating-point vector. More...
 
struct  LEAP_QUATERNION
 A four element, floating point quaternion. More...
 
struct  LEAP_BONE
 Describes a bone's position and orientation. More...
 
struct  LEAP_DIGIT
 Describes the digit of a hand. More...
 
struct  LEAP_PALM
 Properties associated with the palm of the hand. More...
 
struct  LEAP_HAND
 Describes a tracked hand. More...
 
struct  LEAP_TRACKING_EVENT
 A snapshot, or frame of data, containing the tracking data for a single moment in time. More...
 
struct  LEAP_LOG_EVENT
 A system log message. More...
 
struct  LEAP_DEVICE_STATUS_CHANGE_EVENT
 A notification that a device's status has changed. More...
 
struct  LEAP_POINT_MAPPING_CHANGE_EVENT
 A notification that a device's point mapping has changed. More...
 
struct  LEAP_POINT_MAPPING
 A notification that a device's point mapping has changed. More...
 
struct  LEAP_IMAGE_EVENT
 Streaming stereo image pairs from the device. More...
 
struct  LEAP_CONNECTION_MESSAGE
 Defines a basic message from the LeapC message queue. More...
 
struct  LEAP_RECORDING_PARAMETERS
 Read/Write mode for opening a LEAP_RECORDING. More...
 
struct  LEAP_RECORDING_STATUS
 Information about a current LEAP_RECORDING. More...
 
struct  LEAP_CONNECTION
 A handle to the Leap connection object. More...
 
struct  LEAP_DEVICE
 A handle to a Leap device object. More...
 
struct  LEAP_CLOCK_REBASER
 An opaque clock rebase state structure. More...
 

Typedefs

typedef struct _LEAP_CALIBRATION * LEAP_CALIBRATION
 Represents a calibration object. More...
 
typedef struct _LEAP_RECORDING * LEAP_RECORDING
 A Leap recording. More...
 

Detailed Description

Structs passed to and received from LeapC functions.


Data Structure Documentation

struct LEAP_DEVICE_REF

A reference to a Leap device.

Get a LEAP_DEVICE_REF by calling LeapGetDeviceList(). Access a device by calling LeapOpenDevice() with this reference. LeapOpenDevice() provides a LEAP_DEVICE struct, which is a handle to an open device.

Data Fields

void * handle
 An opaque handle. More...
 
uint32_t id
 a generic identifier. More...
 

Field Documentation

void* LEAP_DEVICE_REF::handle

An opaque handle.

Since
3.0.0
uint32_t LEAP_DEVICE_REF::id

a generic identifier.

Since
3.0.0
struct LEAP_CONNECTION_CONFIG

Specifies the configuration for a connection.

Currently, there are no externally useful configuration options.

Since
3.0.0

Data Fields

uint32_t size
 Set to the final size of the structure. More...
 
uint32_t flags
 The connection configuration flags. More...
 
const char * server_namespace
 For internal use. More...
 

Field Documentation

uint32_t LEAP_CONNECTION_CONFIG::flags

The connection configuration flags.

(currently there are none.

Since
3.0.0
const char* LEAP_CONNECTION_CONFIG::server_namespace

For internal use.

Since
3.0.0
uint32_t LEAP_CONNECTION_CONFIG::size

Set to the final size of the structure.

Since
3.0.0
struct LEAP_ALLOCATOR

Specifies the allocator/deallocator functions to be used when the library needs to dynamically manage memory.

Since
4.0.0

Data Fields

void *(* allocate )(uint32_t size, eLeapAllocatorType typeHint, void *state)
 Function pointer to an allocator function that is expected to return a pointer to memory of at least the specified size in bytes. More...
 
void(* deallocate )(void *ptr, void *state)
 Function pointer to a deallocator function. More...
 
void * state
 Pointer to state to be passed to the allocate and deallocate functions.
 

Field Documentation

void*(* LEAP_ALLOCATOR::allocate) (uint32_t size, eLeapAllocatorType typeHint, void *state)

Function pointer to an allocator function that is expected to return a pointer to memory of at least the specified size in bytes.

This will be called when the library needs a block of memory that will be provided back to the client in a subsequent event or response. A type hint is provided in the case where the underlying buffer type needs to be known at allocation time.

void(* LEAP_ALLOCATOR::deallocate) (void *ptr, void *state)

Function pointer to a deallocator function.

The function receives the address of a previously allocated block of memory from the allocate function pointer. The caller is not required to deallocate the memory, but rather this call is used by the library to indicate to the client that it will no longer reference the memory at this address, and that the callee may deallocate the memory when it is ready to do so.

struct LEAP_CONNECTION_EVENT

Received from LeapPollConnection() when a connection to the Leap Motion service is established.

Since
3.0.0

Data Fields

uint32_t flags
 A combination of eLeapServiceDisposition flags. More...
 

Field Documentation

uint32_t LEAP_CONNECTION_EVENT::flags

A combination of eLeapServiceDisposition flags.

Since
3.1.3
struct LEAP_CONNECTION_LOST_EVENT

Received from LeapPollConnection() when a connection to the Leap Motion service is lost.

If a LeapC function that performs a transaction with the Leap Motion service is called after the connection is lost, the next call to LeapPollConnection() will return this event. Otherwise, it can take up to 5 seconds of polling the connection to receive this event.

Since
3.0.0

Data Fields

uint32_t flags
 Reserved for future use. More...
 

Field Documentation

uint32_t LEAP_CONNECTION_LOST_EVENT::flags

Reserved for future use.

Since
3.0.0
struct LEAP_CONNECTION_INFO

Information about a connection.

Call LeapCreateConnection() to generate the handle for the connection; call LeapOpenConnection() to establish the connection; then call LeapGetConnectionInfo(), which creates this struct, to check the connection status.

Since
3.0.0

Data Fields

uint32_t size
 The size of this structure. More...
 
eLeapConnectionStatus status
 The current status of this connection. More...
 

Field Documentation

uint32_t LEAP_CONNECTION_INFO::size

The size of this structure.

Since
3.0.0
eLeapConnectionStatus LEAP_CONNECTION_INFO::status

The current status of this connection.

Since
3.0.0
struct LEAP_POLICY_EVENT

The response from a request to get or set a policy.

LeapPollConnection() creates this struct when the response becomes available.

Since
3.0.0

Data Fields

uint32_t reserved
 Reserved for future use. More...
 
uint32_t current_policy
 A bitfield containing the policies effective at the time the policy event was processed. More...
 

Field Documentation

uint32_t LEAP_POLICY_EVENT::current_policy

A bitfield containing the policies effective at the time the policy event was processed.

Since
3.0.0
uint32_t LEAP_POLICY_EVENT::reserved

Reserved for future use.

Since
3.0.0
struct LEAP_VARIANT

A variant data type used to get and set service configuration values.

Since
3.0.0

Data Fields

eLeapValueType type
 The active data type in this instance. More...
 
bool boolValue
 A Boolean value. More...
 
int32_t iValue
 An integer value. More...
 
float fValue
 A floating point value. More...
 
const char * strValue
 A pointer to a string buffer. More...
 

Field Documentation

bool LEAP_VARIANT::boolValue

A Boolean value.

Since
3.0.0
float LEAP_VARIANT::fValue

A floating point value.

Since
3.0.0
int32_t LEAP_VARIANT::iValue

An integer value.

Since
3.0.0
const char* LEAP_VARIANT::strValue

A pointer to a string buffer.

Since
3.0.0
eLeapValueType LEAP_VARIANT::type

The active data type in this instance.

Since
3.0.0
struct LEAP_CONFIG_RESPONSE_EVENT

Contains the response to a configuration value request.

Call LeapRequestConfigValue() to request a service config value. The value is fetched asynchronously since it requires a service transaction. LeapPollConnection() returns this event structure when the request has been processed. Use the requestID value to correlate the response to the originating request.

Since
3.0.0

Data Fields

uint32_t requestID
 An identifier for correlating the request and response. More...
 
LEAP_VARIANT value
 The configuration value retrieved from the service. More...
 

Field Documentation

uint32_t LEAP_CONFIG_RESPONSE_EVENT::requestID

An identifier for correlating the request and response.

Since
3.0.0
LEAP_VARIANT LEAP_CONFIG_RESPONSE_EVENT::value

The configuration value retrieved from the service.

Do not free any memory pointed to by this member. The value held is only valid until the next call to LeapPollConnection().

Since
3.0.0
struct LEAP_CONFIG_CHANGE_EVENT

The result of a configuration change request.

Contains a status of true for a successful change. Call LeapSaveConfigValue() to request a service config change. The change is performed asynchronously – and may fail. LeapPollConnection() returns this event structure when the request has been processed. Use the requestID value to correlate the response to the originating request.

Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0

Data Fields

uint32_t requestID
 An identifier for correlating the request and response. More...
 
bool status
 The result of the change operation: true on success; false on failure. More...
 

Field Documentation

uint32_t LEAP_CONFIG_CHANGE_EVENT::requestID

An identifier for correlating the request and response.

Since
3.0.0
bool LEAP_CONFIG_CHANGE_EVENT::status

The result of the change operation: true on success; false on failure.

Since
3.0.0
struct LEAP_DEVICE_INFO

Properties of a Leap device.

Get a LEAP_DEVICE_INFO by calling LeapGetDeviceInfo() with the handle for device. The device must be open.

Since
3.0.0

Data Fields

uint32_t size
 Size of this structure. More...
 
uint32_t status
 A combination of eLeapDeviceStatus flags. More...
 
uint32_t caps
 A combination of eLeapDeviceCaps flags. More...
 
eLeapDevicePID pid
 One of the eLeapDevicePID members. More...
 
uint32_t baseline
 The device baseline, in micrometers. More...
 
uint32_t serial_length
 The required length of the serial number char buffer including the null character. More...
 
char * serial
 A pointer to the null-terminated device serial number string. More...
 
float h_fov
 The horizontal field of view of this device in radians. More...
 
float v_fov
 The vertical field of view of this device in radians. More...
 
uint32_t range
 The maximum range for this device, in micrometers. More...
 

Field Documentation

uint32_t LEAP_DEVICE_INFO::baseline

The device baseline, in micrometers.

The baseline is defined as the distance between the center axis of each lens in a stereo camera system. For other camera systems, this value is set to zero.

Since
3.0.0
uint32_t LEAP_DEVICE_INFO::caps

A combination of eLeapDeviceCaps flags.

Since
3.0.0
float LEAP_DEVICE_INFO::h_fov

The horizontal field of view of this device in radians.

Since
3.0.0
eLeapDevicePID LEAP_DEVICE_INFO::pid

One of the eLeapDevicePID members.

Since
3.0.0
uint32_t LEAP_DEVICE_INFO::range

The maximum range for this device, in micrometers.

Since
3.0.0
char* LEAP_DEVICE_INFO::serial

A pointer to the null-terminated device serial number string.

Since
3.0.0
uint32_t LEAP_DEVICE_INFO::serial_length

The required length of the serial number char buffer including the null character.

Since
3.0.0
uint32_t LEAP_DEVICE_INFO::size

Size of this structure.

Since
3.0.0
uint32_t LEAP_DEVICE_INFO::status

A combination of eLeapDeviceStatus flags.

Since
3.0.0
float LEAP_DEVICE_INFO::v_fov

The vertical field of view of this device in radians.

Since
3.0.0
struct LEAP_DEVICE_EVENT

Device event information.

LeapPollConnection() produces a message containing this event when a new device is detected. You can use the handle provided by the device filed to open a device so that you can access its properties.

Since
3.0.0

Data Fields

uint32_t flags
 Reserved for future use. More...
 
LEAP_DEVICE_REF device
 The handle reference of to the newly attached device. More...
 
uint32_t status
 The status of the connected device. More...
 

Field Documentation

LEAP_DEVICE_REF LEAP_DEVICE_EVENT::device

The handle reference of to the newly attached device.

Since
3.0.0
uint32_t LEAP_DEVICE_EVENT::flags

Reserved for future use.

Since
3.0.0
uint32_t LEAP_DEVICE_EVENT::status

The status of the connected device.

A combination of flags from the eLeapDeviceStatus collection.

struct LEAP_DEVICE_FAILURE_EVENT

Device failure information.

LeapPollConnection() produces a message containing this event when a device fails. Only partial information may be available. If hDevice is non-null, then you can use it to identify the failed device with a known, open device.

Since
3.0.0

Data Fields

eLeapDeviceStatus status
 The status of this failure event. More...
 
LEAP_DEVICE hDevice
 A handle to the device generating this failure event, if available, otherwise NULL. More...
 

Field Documentation

LEAP_DEVICE LEAP_DEVICE_FAILURE_EVENT::hDevice

A handle to the device generating this failure event, if available, otherwise NULL.

You are not responsible for closing this handle.

Since
3.0.0
eLeapDeviceStatus LEAP_DEVICE_FAILURE_EVENT::status

The status of this failure event.

Since
3.0.0
struct LEAP_FRAME_HEADER

Identifying information for a frame of tracking data.

Since
3.0.0

Data Fields

void * reserved
 Reserved, set to zero. More...
 
int64_t frame_id
 A unique identifier for this frame. More...
 
int64_t timestamp
 The timestamp for this image, in microseconds, referenced against LeapGetNow(). More...
 

Field Documentation

int64_t LEAP_FRAME_HEADER::frame_id

A unique identifier for this frame.

All frames carrying this frame ID are part of the same unit of processing. This counter is generally an increasing counter, but may reset to another value if the user stops and restarts streaming.

For interpolated frames, this value corresponds to the identifier of the frame upper bound.

Since
3.0.0
void* LEAP_FRAME_HEADER::reserved

Reserved, set to zero.

Since
3.0.0
int64_t LEAP_FRAME_HEADER::timestamp

The timestamp for this image, in microseconds, referenced against LeapGetNow().

Since
3.0.0
struct LEAP_IMAGE_PROPERTIES

Properties of a sensor image.

Since
3.0.0

Data Fields

eLeapImageType type
 The type of this image. More...
 
eLeapImageFormat format
 The format of this image. More...
 
uint32_t bpp
 The number of bytes per image pixel. More...
 
uint32_t width
 The number of horizontal pixels in the image. More...
 
uint32_t height
 The number of rows of pixels in the image. More...
 
float x_scale
 Reserved for future use. More...
 
float y_scale
 Reserved for future use. More...
 
float x_offset
 Reserved for future use. More...
 
float y_offset
 Reserved for future use. More...
 

Field Documentation

uint32_t LEAP_IMAGE_PROPERTIES::bpp

The number of bytes per image pixel.

Since
3.0.0
eLeapImageFormat LEAP_IMAGE_PROPERTIES::format

The format of this image.

Since
3.0.0
uint32_t LEAP_IMAGE_PROPERTIES::height

The number of rows of pixels in the image.

Since
3.0.0
eLeapImageType LEAP_IMAGE_PROPERTIES::type

The type of this image.

Since
3.0.0
uint32_t LEAP_IMAGE_PROPERTIES::width

The number of horizontal pixels in the image.

Since
3.0.0
float LEAP_IMAGE_PROPERTIES::x_offset

Reserved for future use.

Since
3.0.0
float LEAP_IMAGE_PROPERTIES::x_scale

Reserved for future use.

Since
3.0.0
float LEAP_IMAGE_PROPERTIES::y_offset

Reserved for future use.

Since
3.0.0
float LEAP_IMAGE_PROPERTIES::y_scale

Reserved for future use.

Since
3.0.0
struct LEAP_DISTORTION_MATRIX

A matrix containing lens distortion correction coordinates.

Each point in the grid contains the coordinates of the pixel in the image buffer that contains the data for the pixel in the undistorted image corresponding to that point in the grid. Interpolate between points in the matrix to correct image pixels that don't fall directly underneath a point in the distortion grid.

Current devices use a 64x64 point distortion grid.

Since
3.0.0

Data Fields

struct {
   float   x
 The x-pixel coordinate. More...
 
   float   y
 The y-pixel coordinate. More...
 
matrix [64][64]
 A point in the distortion grid. More...
 

Field Documentation

struct { ... } LEAP_DISTORTION_MATRIX::matrix[ 64 ][ 64 ]

A point in the distortion grid.

Since
3.0.0 A grid of 2D points.
3.0.0
float LEAP_DISTORTION_MATRIX::x

The x-pixel coordinate.

Since
3.0.0
float LEAP_DISTORTION_MATRIX::y

The y-pixel coordinate.

Since
3.0.0
struct LEAP_IMAGE_FRAME_DESCRIPTION

Describes the image to request.

Pass this struct to the LeapImageRequest() function.

Since
3.0.0

Data Fields

int64_t frame_id
 The ID of the frame corresponding to the desired image. More...
 
eLeapImageType type
 The type of the desired image. More...
 
uint64_t buffer_len
 Length of your image buffer. More...
 
void * pBuffer
 An allocated buffer large enough to contain the requested image. More...
 

Field Documentation

uint64_t LEAP_IMAGE_FRAME_DESCRIPTION::buffer_len

Length of your image buffer.

The buffer must be large enough to hold the request image.

int64_t LEAP_IMAGE_FRAME_DESCRIPTION::frame_id

The ID of the frame corresponding to the desired image.

Since
3.0.0
void* LEAP_IMAGE_FRAME_DESCRIPTION::pBuffer

An allocated buffer large enough to contain the requested image.

The buffer must remain valid until the image request completes or fails.

Since
3.0.0
eLeapImageType LEAP_IMAGE_FRAME_DESCRIPTION::type

The type of the desired image.

Since
3.0.0
struct LEAP_VECTOR

A three element, floating-point vector.

Since
3.0.0

Data Fields

union {
   float   v [3]
 The vector as an array. More...
 
}; 
 You can access the vector members as either an array or individual float values. More...
 
float x
 The x spatial coordinate. More...
 
float y
 The y spatial coordinate. More...
 
float z
 The z spatial coordinate. More...
 

Field Documentation

union { ... }

You can access the vector members as either an array or individual float values.

float LEAP_VECTOR::v[3]

The vector as an array.

Since
3.0.0
float LEAP_VECTOR::x

The x spatial coordinate.

Since
3.0.0
float LEAP_VECTOR::y

The y spatial coordinate.

Since
3.0.0
float LEAP_VECTOR::z

The z spatial coordinate.

Since
3.0.0
struct LEAP_QUATERNION

A four element, floating point quaternion.

Since
3.1.2

Field Documentation

float LEAP_QUATERNION::v[4]

The quaternion as an array.

Since
3.1.3
float LEAP_QUATERNION::w

The scalar portion of the quaternion.

Since
3.1.2
float LEAP_QUATERNION::x

The x coefficient of the vector portion of the quaternion.

Since
3.1.2
float LEAP_QUATERNION::y

The y coefficient of the vector portion of the quaternion.

Since
3.1.2
float LEAP_QUATERNION::z

The z coefficient of the vector portion of the quaternion.

Since
3.1.2
struct LEAP_BONE

Describes a bone's position and orientation.

Bones are members of the LEAP_DIGIT struct.

Since
3.0.0

Data Fields

LEAP_VECTOR prev_joint
 The base of the bone, closer to the heart. More...
 
LEAP_VECTOR next_joint
 The end of the bone, further from the heart. More...
 
float width
 The average width of the flesh around the bone in millimeters. More...
 
LEAP_QUATERNION rotation
 Rotation in world space from the forward direction. More...
 

Field Documentation

LEAP_VECTOR LEAP_BONE::next_joint

The end of the bone, further from the heart.

Since
3.0.0
LEAP_VECTOR LEAP_BONE::prev_joint

The base of the bone, closer to the heart.

The bones origin.

Since
3.0.0
LEAP_QUATERNION LEAP_BONE::rotation

Rotation in world space from the forward direction.

Convert the quaternion to a matrix to derive the basis vectors.

Since
3.1.2
float LEAP_BONE::width

The average width of the flesh around the bone in millimeters.

Since
3.0.0
struct LEAP_DIGIT

Describes the digit of a hand.

Digits are members of the LEAP_HAND struct.

Since
3.0.0

Data Fields

int32_t finger_id
 The Leap identifier of this finger. More...
 
uint32_t is_extended
 Reports whether the finger is more or less straight. More...
 
LEAP_BONE bones [4]
 All the bones of a digit as an iterable collection. More...
 
LEAP_BONE metacarpal
 The finger bone wholly inside the hand. More...
 
LEAP_BONE proximal
 The phalange extending from the knuckle. More...
 
LEAP_BONE intermediate
 The bone between the proximal phalange and the distal phalange. More...
 
LEAP_BONE distal
 The distal phalange terminating at the finger tip. More...
 

Field Documentation

LEAP_BONE LEAP_DIGIT::bones[4]

All the bones of a digit as an iterable collection.

Since
3.0.0
LEAP_BONE LEAP_DIGIT::distal

The distal phalange terminating at the finger tip.

Since
3.0.0
int32_t LEAP_DIGIT::finger_id

The Leap identifier of this finger.

Since
3.0.0
LEAP_BONE LEAP_DIGIT::intermediate

The bone between the proximal phalange and the distal phalange.

Since
3.0.0
uint32_t LEAP_DIGIT::is_extended

Reports whether the finger is more or less straight.

Since
3.0.0
LEAP_BONE LEAP_DIGIT::metacarpal

The finger bone wholly inside the hand.

For thumbs, this bone is set to have zero length and width, an identity basis matrix, and its joint positions are equal. Note that this is anatomically incorrect; in anatomical terms, the intermediate phalange is absent in a real thumb, rather than the metacarpal bone. In the Leap Motion model, however, we use a "zero" metacarpal bone instead for ease of programming.

Since
3.0.0
LEAP_BONE LEAP_DIGIT::proximal

The phalange extending from the knuckle.

Since
3.0.0
struct LEAP_PALM

Properties associated with the palm of the hand.

The Palm is a member of the LEAP_HAND struct.

Since
3.0.0

Data Fields

LEAP_VECTOR position
 The center position of the palm in millimeters from the Leap Motion origin. More...
 
LEAP_VECTOR stabilized_position
 The time-filtered and stabilized position of the palm. More...
 
LEAP_VECTOR velocity
 The rate of change of the palm position in millimeters per second. More...
 
LEAP_VECTOR normal
 The normal vector to the palm. More...
 
float width
 The estimated width of the palm when the hand is in a flat position. More...
 
LEAP_VECTOR direction
 The unit direction vector pointing from the palm position toward the fingers. More...
 
LEAP_QUATERNION orientation
 The quaternion representing the palm's orientation corresponding to the basis {normal x direction, -normal, -direction}. More...
 

Field Documentation

LEAP_VECTOR LEAP_PALM::direction

The unit direction vector pointing from the palm position toward the fingers.

Since
3.0.0
LEAP_VECTOR LEAP_PALM::normal

The normal vector to the palm.

If your hand is flat, this vector will point downward, or "out" of the front surface of your palm.

Since
3.0.0
LEAP_QUATERNION LEAP_PALM::orientation

The quaternion representing the palm's orientation corresponding to the basis {normal x direction, -normal, -direction}.

Since
3.1.3
LEAP_VECTOR LEAP_PALM::position

The center position of the palm in millimeters from the Leap Motion origin.

Since
3.0.0
LEAP_VECTOR LEAP_PALM::stabilized_position

The time-filtered and stabilized position of the palm.

Smoothing and stabilization is performed in order to make this value more suitable for interaction with 2D content. The stabilized position lags behind the palm position by a variable amount, depending primarily on the speed of movement.

Since
3.0.0
LEAP_VECTOR LEAP_PALM::velocity

The rate of change of the palm position in millimeters per second.

Since
3.0.0
float LEAP_PALM::width

The estimated width of the palm when the hand is in a flat position.

Since
3.0.0
struct LEAP_HAND

Describes a tracked hand.

Since
3.0.0

Data Fields

uint32_t id
 A unique ID for a hand tracked across frames. More...
 
uint32_t flags
 Reserved for future use. More...
 
eLeapHandType type
 Identifies the chirality of this hand. More...
 
float confidence
 How confident we are with a given hand pose. More...
 
uint64_t visible_time
 The total amount of time this hand has been tracked, in microseconds. More...
 
float pinch_distance
 The distance between index finger and thumb. More...
 
float grab_angle
 The average angle of fingers to palm. More...
 
float pinch_strength
 The normalized estimate of the pinch pose. More...
 
float grab_strength
 The normalized estimate of the grab hand pose. More...
 
LEAP_PALM palm
 Additional information associated with the palm. More...
 
union {
   LEAP_DIGIT   digits [5]
 The fingers of the hand as an array. More...
 
}; 
 The fingers of this hand. More...
 
LEAP_BONE arm
 The arm to which this hand is attached. More...
 
LEAP_DIGIT thumb
 The thumb. More...
 
LEAP_DIGIT index
 The index finger. More...
 
LEAP_DIGIT middle
 The middle finger. More...
 
LEAP_DIGIT ring
 The ring finger. More...
 
LEAP_DIGIT pinky
 The pinky finger. More...
 

Field Documentation

union { ... }

The fingers of this hand.

Since
3.0.0
LEAP_BONE LEAP_HAND::arm

The arm to which this hand is attached.

An arm consists of a single LEAP_BONE struct.

Since
3.0.0
float LEAP_HAND::confidence

How confident we are with a given hand pose.

Not currently used (always 1.0).

Since
3.0.0
LEAP_DIGIT LEAP_HAND::digits[5]

The fingers of the hand as an array.

Since
3.0.0
uint32_t LEAP_HAND::flags

Reserved for future use.

Since
3.0.0
float LEAP_HAND::grab_angle

The average angle of fingers to palm.

Since
3.0.0
float LEAP_HAND::grab_strength

The normalized estimate of the grab hand pose.

Zero is not grabbing; one is fully grabbing.

Since
3.0.0
uint32_t LEAP_HAND::id

A unique ID for a hand tracked across frames.

If tracking of a physical hand is lost, a new ID is assigned when tracking is reacquired.

Since
3.0.0
LEAP_DIGIT LEAP_HAND::index

The index finger.

Since
3.0.0
LEAP_DIGIT LEAP_HAND::middle

The middle finger.

Since
3.0.0
LEAP_PALM LEAP_HAND::palm

Additional information associated with the palm.

Since
3.0.0
float LEAP_HAND::pinch_distance

The distance between index finger and thumb.

Since
3.0.0
float LEAP_HAND::pinch_strength

The normalized estimate of the pinch pose.

Zero is not pinching; one is fully pinched.

Since
3.0.0
LEAP_DIGIT LEAP_HAND::pinky

The pinky finger.

Since
3.0.0
LEAP_DIGIT LEAP_HAND::ring

The ring finger.

Since
3.0.0
LEAP_DIGIT LEAP_HAND::thumb

The thumb.

Since
3.0.0
eLeapHandType LEAP_HAND::type

Identifies the chirality of this hand.

Since
3.0.0
uint64_t LEAP_HAND::visible_time

The total amount of time this hand has been tracked, in microseconds.

Since
3.0.0
struct LEAP_TRACKING_EVENT

A snapshot, or frame of data, containing the tracking data for a single moment in time.

The LEAP_FRAME struct is the container for all the tracking data.

Since
3.0.0

Data Fields

LEAP_FRAME_HEADER info
 A universal frame identification header. More...
 
int64_t tracking_frame_id
 An identifier for this tracking frame. More...
 
uint32_t nHands
 The number of hands tracked in this frame, i.e. More...
 
LEAP_HANDpHands
 A pointer to the array of hands tracked in this frame. More...
 
float framerate
 Current tracking frame rate in hertz. More...
 

Field Documentation

float LEAP_TRACKING_EVENT::framerate

Current tracking frame rate in hertz.

This frame rate is distinct from the image frame rate, which is the rate that images are being read from the device. Depending on host CPU limitations, the tracking frame rate may be substantially less than the device frame rate.

This number is generally equal to or less than the device frame rate, but there is one case where this number may be higher than the device frame rate: When the device rate drops. In this case, the device frame rate will fall sooner than the tracking frame rate.

This number is equal to zero if there are not enough frames to estimate frame rate.

This number cannot be negative.

Since
3.0.0
LEAP_FRAME_HEADER LEAP_TRACKING_EVENT::info

A universal frame identification header.

Since
3.0.0
uint32_t LEAP_TRACKING_EVENT::nHands

The number of hands tracked in this frame, i.e.

the number of elements in the pHands array.

Since
3.0.0
LEAP_HAND* LEAP_TRACKING_EVENT::pHands

A pointer to the array of hands tracked in this frame.

Since
3.0.0
int64_t LEAP_TRACKING_EVENT::tracking_frame_id

An identifier for this tracking frame.

This identifier is meant to be monotonically increasing, but values may be skipped if the client application does not poll for messages fast enough. This number also generally increases at the same rate as info.frame_id, but if the server cannot process every image received from the device cameras, the info.frame_id identifier may increase faster.

Since
3.0.0
struct LEAP_LOG_EVENT

A system log message.

Since
3.0.0

Data Fields

eLeapLogSeverity severity
 The type of message. More...
 
int64_t timestamp
 The timestamp of the message in microseconds. More...
 
const char * message
 A pointer to a null-terminated string containing the current log message. More...
 

Field Documentation

const char* LEAP_LOG_EVENT::message

A pointer to a null-terminated string containing the current log message.

Since
4.0.0
eLeapLogSeverity LEAP_LOG_EVENT::severity

The type of message.

Since
4.0.0
int64_t LEAP_LOG_EVENT::timestamp

The timestamp of the message in microseconds.

Compare with the current values of LeapGetNow() and the system clock to calculate the absolute time of the message.

Since
4.0.0
struct LEAP_DEVICE_STATUS_CHANGE_EVENT

A notification that a device's status has changed.

One of these messages is received by the client as soon as the service is connected, or when a new device is attached.

Since
3.1.3

Data Fields

LEAP_DEVICE_REF device
 A reference to the device whose status has changed.
 
uint32_t last_status
 The last known status of the device. More...
 
uint32_t status
 The current status of the device. More...
 

Field Documentation

uint32_t LEAP_DEVICE_STATUS_CHANGE_EVENT::last_status

The last known status of the device.

This is a combination of eLeapDeviceStatus flags.

Since
3.1.3
uint32_t LEAP_DEVICE_STATUS_CHANGE_EVENT::status

The current status of the device.

This is a combination of eLeapDeviceStatus flags.

Since
3.1.3
struct LEAP_POINT_MAPPING_CHANGE_EVENT

A notification that a device's point mapping has changed.

Since
4.0.0

Data Fields

int64_t frame_id
 The ID of the frame corresponding to the source of the currently tracked points. More...
 
int64_t timestamp
 The timestamp of the frame, in microseconds, referenced against LeapGetNow(). More...
 
uint32_t nPoints
 The number of points being tracked. More...
 

Field Documentation

int64_t LEAP_POINT_MAPPING_CHANGE_EVENT::frame_id

The ID of the frame corresponding to the source of the currently tracked points.

Since
4.0.0
uint32_t LEAP_POINT_MAPPING_CHANGE_EVENT::nPoints

The number of points being tracked.

Since
4.0.0
int64_t LEAP_POINT_MAPPING_CHANGE_EVENT::timestamp

The timestamp of the frame, in microseconds, referenced against LeapGetNow().

Since
4.0.0
struct LEAP_POINT_MAPPING

A notification that a device's point mapping has changed.

It contains the entire set of points being mapped.

Since
4.0.0

Data Fields

int64_t frame_id
 The ID of the frame corresponding to the source of the currently tracked points. More...
 
int64_t timestamp
 The timestamp of the frame, in microseconds, referenced against LeapGetNow(). More...
 
uint32_t nPoints
 The number of points being tracked. More...
 
LEAP_VECTORpPoints
 The 3D points being mapped. More...
 
uint32_t * pIDs
 The IDs of the 3D points being mapped. More...
 

Field Documentation

int64_t LEAP_POINT_MAPPING::frame_id

The ID of the frame corresponding to the source of the currently tracked points.

Since
4.0.0
uint32_t LEAP_POINT_MAPPING::nPoints

The number of points being tracked.

Since
4.0.0
uint32_t* LEAP_POINT_MAPPING::pIDs

The IDs of the 3D points being mapped.

Since
4.0.0
LEAP_VECTOR* LEAP_POINT_MAPPING::pPoints

The 3D points being mapped.

Since
4.0.0
int64_t LEAP_POINT_MAPPING::timestamp

The timestamp of the frame, in microseconds, referenced against LeapGetNow().

Since
4.0.0
struct LEAP_IMAGE_EVENT

Streaming stereo image pairs from the device.

LeapPollConnection() produces this message when an image is available. The struct contains image properties, the distortion grid, and a pointer to the buffer containing the image data – which was allocated using the allocator function passed to LeapC using the LeapSetAllocator.

Since
4.0.0

Data Fields

LEAP_FRAME_HEADER info
 The information header identifying the images tracking frame. More...
 
LEAP_IMAGE image [2]
 The left and right images. More...
 
LEAP_CALIBRATION calib
 For internal use only. More...
 

Field Documentation

LEAP_CALIBRATION LEAP_IMAGE_EVENT::calib

For internal use only.

LEAP_IMAGE LEAP_IMAGE_EVENT::image[2]

The left and right images.

LEAP_FRAME_HEADER LEAP_IMAGE_EVENT::info

The information header identifying the images tracking frame.

struct LEAP_CONNECTION_MESSAGE

Defines a basic message from the LeapC message queue.

Set by calling LeapPollConnection().

Since
3.0.0

Data Fields

uint32_t size
 The size of this message struct. More...
 
eLeapEventType type
 The message type. More...
 
union {
   const void *   pointer
 An untyped pointer. More...
 
   const LEAP_CONNECTION_EVENT *   connection_event
 A connection message. More...
 
   const LEAP_CONNECTION_LOST_EVENT *   connection_lost_event
 A connection lost. More...
 
   const LEAP_DEVICE_EVENT *   device_event
 A device detected message. More...
 
   const LEAP_DEVICE_STATUS_CHANGE_EVENT *   device_status_change_event
 A device's status has changed. More...
 
   const LEAP_POLICY_EVENT *   policy_event
 A policy message. More...
 
   const LEAP_DEVICE_FAILURE_EVENT *   device_failure_event
 A device failure message. More...
 
   const LEAP_TRACKING_EVENT *   tracking_event
 A tracking message. More...
 
   const LEAP_LOG_EVENT *   log_event
 A log message. More...
 
   const LEAP_LOG_EVENTS *   log_events
 A log messages. More...
 
   const LEAP_CONFIG_RESPONSE_EVENT *   config_response_event
 A get config value message. More...
 
   const LEAP_CONFIG_CHANGE_EVENT *   config_change_event
 A set config value message. More...
 
   const LEAP_IMAGE_EVENT *   image_event
 A streaming image message. More...
 
   const LEAP_POINT_MAPPING_CHANGE_EVENT *   point_mapping_change_event
 A point mapping message. More...
 
}; 
 A pointer to the event data for the current type of message. More...
 

Field Documentation

union { ... }

A pointer to the event data for the current type of message.

Since
3.0.0
const LEAP_CONFIG_CHANGE_EVENT* LEAP_CONNECTION_MESSAGE::config_change_event

A set config value message.

Since
3.0.0
const LEAP_CONFIG_RESPONSE_EVENT* LEAP_CONNECTION_MESSAGE::config_response_event

A get config value message.

Since
3.0.0
const LEAP_CONNECTION_EVENT* LEAP_CONNECTION_MESSAGE::connection_event

A connection message.

Since
3.0.0
const LEAP_CONNECTION_LOST_EVENT* LEAP_CONNECTION_MESSAGE::connection_lost_event

A connection lost.

Since
3.0.0
const LEAP_DEVICE_EVENT* LEAP_CONNECTION_MESSAGE::device_event

A device detected message.

Since
3.0.0
const LEAP_DEVICE_FAILURE_EVENT* LEAP_CONNECTION_MESSAGE::device_failure_event

A device failure message.

Since
3.0.0
const LEAP_DEVICE_STATUS_CHANGE_EVENT* LEAP_CONNECTION_MESSAGE::device_status_change_event

A device's status has changed.

Since
3.1.3
const LEAP_IMAGE_EVENT* LEAP_CONNECTION_MESSAGE::image_event

A streaming image message.

Since
4.0.0
const LEAP_LOG_EVENT* LEAP_CONNECTION_MESSAGE::log_event

A log message.

Since
3.0.0
const LEAP_LOG_EVENTS* LEAP_CONNECTION_MESSAGE::log_events

A log messages.

Since
4.0.0
const LEAP_POINT_MAPPING_CHANGE_EVENT* LEAP_CONNECTION_MESSAGE::point_mapping_change_event

A point mapping message.

Since
4.0.0
const void* LEAP_CONNECTION_MESSAGE::pointer

An untyped pointer.

Since
3.0.0
const LEAP_POLICY_EVENT* LEAP_CONNECTION_MESSAGE::policy_event

A policy message.

Since
3.0.0
uint32_t LEAP_CONNECTION_MESSAGE::size

The size of this message struct.

Since
3.0.0
const LEAP_TRACKING_EVENT* LEAP_CONNECTION_MESSAGE::tracking_event

A tracking message.

Since
3.0.0
eLeapEventType LEAP_CONNECTION_MESSAGE::type

The message type.

Since
3.0.0
struct LEAP_RECORDING_PARAMETERS

Read/Write mode for opening a LEAP_RECORDING.

since 3.2.0

Data Fields

uint32_t mode
 A combination of eLeapRecordingFlags indicating the desired operations. More...
 

Field Documentation

uint32_t LEAP_RECORDING_PARAMETERS::mode

A combination of eLeapRecordingFlags indicating the desired operations.

Since
3.2.0
struct LEAP_RECORDING_STATUS

Information about a current LEAP_RECORDING.

Filled in by a call to LeapRecordingGetStatus().

Since
3.2.0

Data Fields

uint32_t mode
 Some combination of eLeapRecordingFlags indicating the status of the recording. More...
 

Field Documentation

uint32_t LEAP_RECORDING_STATUS::mode

Some combination of eLeapRecordingFlags indicating the status of the recording.

Since
3.2.0
struct LEAP_CONNECTION

A handle to the Leap connection object.

Use this handle to specify the connection for an operation.

Since
3.0.0
struct LEAP_DEVICE

A handle to a Leap device object.

Use this handle to specify the device for an operation.

Since
3.0.0
struct LEAP_CLOCK_REBASER

An opaque clock rebase state structure.

Since
3.1.2

Typedef Documentation

typedef struct _LEAP_CALIBRATION* LEAP_CALIBRATION

Represents a calibration object.

Not currently of any particular use.

Since
3.0.0
typedef struct _LEAP_RECORDING* LEAP_RECORDING

A Leap recording.

Since
3.2.0