The LeapFrame class represents a set of hand and finger tracking data detected in a single frame. More...
Inherits NSObject.
Instance Methods | |
| (LeapFinger *) | - finger: |
| The LeapFinger object with the specified ID in this frame. More... | |
| (LeapGesture *) | - gesture: |
| The LeapGesture object with the specified ID in this frame. More... | |
| (NSArray *) | - gestures: |
| The gestures recognized or continuing since the specified frame. More... | |
| (LeapHand *) | - hand: |
| The LeapHand object with the specified ID in this frame. More... | |
| (LeapInteractionBox *) | - interactionBox |
| The current LeapInteractionBox for the frame. More... | |
| (LeapPointable *) | - pointable: |
| The LeapPointable object with the specified ID in this frame. More... | |
| (float) | - rotationAngle: |
| The angle of rotation around the rotation axis derived from the overall rotational motion between the current frame and the specified frame. More... | |
| (float) | - rotationAngle:axis: |
| The angle of rotation around the specified axis derived from the overall rotational motion between the current frame and the specified frame. More... | |
| (LeapVector *) | - rotationAxis: |
| The axis of rotation derived from the overall rotational motion between the current frame and the specified frame. More... | |
| (LeapMatrix *) | - rotationMatrix: |
| The transform matrix expressing the rotation derived from the overall rotational motion between the current frame and the specified frame. More... | |
| (float) | - rotationProbability: |
| The estimated probability that the overall motion between the current frame and the specified frame is intended to be a rotating motion. More... | |
| (float) | - scaleFactor: |
| The scale factor derived from the overall motion between the current frame and the specified frame. More... | |
| (float) | - scaleProbability: |
| The estimated probability that the overall motion between the current frame and the specified frame is intended to be a scaling motion. More... | |
| (NSData *) | - serialize |
| Encodes this Frame object as NSData object. More... | |
| (LeapTool *) | - tool: |
| The LeapTool object with the specified ID in this frame. More... | |
| (LeapVector *) | - translation: |
| The change of position derived from the overall linear motion between the current frame and the specified frame. More... | |
| (float) | - translationProbability: |
| The estimated probability that the overall motion between the current frame and the specified frame is intended to be a translating motion. More... | |
Class Methods | |
| (LeapFrame *) | + deserialize: |
| Decodes an NSData object representing frame data into a LeapFrame object. More... | |
| (LeapFrame *) | + invalid |
| Returns an invalid LeapFrame object. More... | |
Properties | |
| float | currentFramesPerSecond |
| The instantaneous framerate. More... | |
| NSArray * | fingers |
| The list of LeapFinger objects detected in this frame, given in arbitrary order. More... | |
| NSArray * | hands |
| The list of LeapHand objects detected in this frame, given in arbitrary order. More... | |
| int64_t | id |
| A unique ID for this LeapFrame. More... | |
| NSArray * | images |
| The list of images from the Leap Motion cameras. More... | |
| BOOL | isValid |
| Reports whether this LeapFrame instance is valid. More... | |
| NSArray * | pointables |
| The list of LeapPointable objects (fingers and tools) detected in this frame, given in arbitrary order. More... | |
| int64_t | timestamp |
| The frame capture time in microseconds elapsed since an arbitrary point in time in the past. More... | |
| NSArray * | tools |
| The list of LeapTool objects detected in this frame, given in arbitrary order. More... | |
The LeapFrame class represents a set of hand and finger tracking data detected in a single frame.
The Leap detects hands, fingers and tools within the tracking area, reporting their positions, orientations and motions in frames at the Leap frame rate.
Access LeapFrame objects through an instance of a LeapController.
Implement a LeapListener subclass to receive a callback event when a new LeapFrame is available.
A LeapFrame object maintains strong references to its child objects (hands, fingers, tools, etc). However, the child objects only maintain weak references to their parent objects. Thus, you can access the full hierarchy of objects while the LeapFrame object exists, but you can only access child objects once the LeapFrame object has been deleted.
| + (LeapFrame *) deserialize: | (NSData *) | serializedFrame |
Decodes an NSData object representing frame data into a LeapFrame object.
A LeapController object must be instantiated for this function to succeed, but it does not need to be connected.
Note: The behavior when calling functions which take another LeapFrame object as a parameter is undefined when either frame has been deserialized.
| serializedFrame | An NSData object containing the serialized bytes of a frame. |
| - (LeapFinger *) finger: | (int32_t) | fingerId |
The LeapFinger object with the specified ID in this frame.
Use the [LeapFrame finger:] function to retrieve the LeapFinger object from this frame using an ID value obtained from a previous frame. This function always returns a LeapFinger object, but if no finger with the specified ID is present, an invalid LeapFinger object is returned.
Note that ID values persist across frames, but only until tracking of a particular object is lost. If tracking of a finger is lost and subsequently regained, the new LeapFinger object representing that physical finger may have a different ID than that representing the finger in an earlier frame.
| fingerId | The ID value of a LeapFinger object from a previous frame. |
| - (LeapGesture *) gesture: | (int32_t) | gestureId |
The LeapGesture object with the specified ID in this frame.
| gestureId | The ID of a LeapGesture object from a previous frame. |
| - (NSArray *) gestures: | (const LeapFrame *) | sinceFrame |
The gestures recognized or continuing since the specified frame.
| sinceFrame | An earlier LeapFrame. Set to nil to get the gestures for the current LeapFrame only. |
| - (LeapHand *) hand: | (int32_t) | handId |
The LeapHand object with the specified ID in this frame.
Use the [LeapFrame hand:] function to retrieve the LeapHand object from this frame using an ID value obtained from a previous frame. This function always returns a LeapHand object, but if no hand with the specified ID is present, an invalid LeapHand object is returned.
Note that ID values persist across frames, but only until tracking of a particular object is lost. If tracking of a hand is lost and subsequently regained, the new LeapHand object representing that physical hand may have a different ID than that representing the physical hand in an earlier frame.
| handId | The ID value of a LeapHand object from a previous frame. |
| - (LeapInteractionBox *) interactionBox |
The current LeapInteractionBox for the frame.
See the LeapInteractionBox class documentation for more details on how this class should be used.
| + (LeapFrame *) invalid |
| - (LeapPointable *) pointable: | (int32_t) | pointableId |
The LeapPointable object with the specified ID in this frame.
Use the [LeapFrame pointable:] function to retrieve the LeapPointable object from this frame using an ID value obtained from a previous frame. This function always returns a LeapPointable object, but if no finger or tool with the specified ID is present, an invalid LeapPointable object is returned.
Note that ID values persist across frames, but only until tracking of a particular object is lost. If tracking of a finger or tool is lost and subsequently regained, the new LeapPointable object representing that finger or tool may have a different ID than that representing the finger or tool in an earlier frame.
| pointableId | The ID value of a LeapPointable object from a previous frame. |
| - (float) rotationAngle: | (const LeapFrame *) | sinceFrame |
The angle of rotation around the rotation axis derived from the overall rotational motion between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative rotation. |
| - (float) rotationAngle: | (const LeapFrame *) | sinceFrame | |
| axis: | (const LeapVector *) | axis | |
The angle of rotation around the specified axis derived from the overall rotational motion between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative rotation. |
| axis | The LeapVector representing the direction of the axis to measure rotation around. |
| - (LeapVector *) rotationAxis: | (const LeapFrame *) | sinceFrame |
The axis of rotation derived from the overall rotational motion between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative rotation. |
| - (LeapMatrix *) rotationMatrix: | (const LeapFrame *) | sinceFrame |
The transform matrix expressing the rotation derived from the overall rotational motion between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative rotation. |
| - (float) rotationProbability: | (const LeapFrame *) | sinceFrame |
The estimated probability that the overall motion between the current frame and the specified frame is intended to be a rotating motion.
| sinceFrame | The starting frame for computing the relative rotation. |
| - (float) scaleFactor: | (const LeapFrame *) | sinceFrame |
The scale factor derived from the overall motion between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative scaling. |
| - (float) scaleProbability: | (const LeapFrame *) | sinceFrame |
The estimated probability that the overall motion between the current frame and the specified frame is intended to be a scaling motion.
| sinceFrame | The starting frame for computing the relative scaling. |
| - (NSData *) serialize |
Encodes this Frame object as NSData object.
| - (LeapTool *) tool: | (int32_t) | toolId |
| - (LeapVector *) translation: | (const LeapFrame *) | sinceFrame |
The change of position derived from the overall linear motion between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative translation. |
| - (float) translationProbability: | (const LeapFrame *) | sinceFrame |
The estimated probability that the overall motion between the current frame and the specified frame is intended to be a translating motion.
| sinceFrame | The starting frame for computing the translation. |
|
readnonatomicassign |
The instantaneous framerate.
The rate at which the Leap Motion software is providing frames of data (in frames per second). The framerate can fluctuate depending on available computing resources, activity within the device field of view, software tracking settings, and other factors.
|
readnonatomicstrong |
The list of LeapFinger objects detected in this frame, given in arbitrary order.
The list can be empty if no fingers are detected.
|
readnonatomicstrong |
|
readnonatomicassign |
|
readnonatomicstrong |
The list of images from the Leap Motion cameras.
|
readnonatomicassign |
Reports whether this LeapFrame instance is valid.
A valid LeapFrame is one generated by the LeapController object that contains tracking data for all detected entities. An invalid LeapFrame contains no actual tracking data, but you can call its functions without risk of a null pointer exception. The invalid LeapFrame mechanism makes it more convenient to track individual data across the frame history. For example, you can invoke:
for an arbitrary LeapFrame history value, "n", without first checking whether frame: returned a null object. (You should still check that the returned LeapFinger instance is valid.)
|
readnonatomicstrong |
The list of LeapPointable objects (fingers and tools) detected in this frame, given in arbitrary order.
The list can be empty if no fingers or tools are detected.
|
readnonatomicassign |
The frame capture time in microseconds elapsed since an arbitrary point in time in the past.
Use [LeapController now] to calculate the age of the frame.
Objective-C