libfreenect2  0.2
Public Member Functions | List of all members
SyncMultiFrameListener Class Reference

Collect multiple types of frames. More...

#include <libfreenect2/frame_listener_impl.h>

Inheritance diagram for SyncMultiFrameListener:
FrameListener

Public Member Functions

 SyncMultiFrameListener (unsigned int frame_types)
 
virtual ~SyncMultiFrameListener ()
 
bool hasNewFrame () const
 Test if there are new frames. More...
 
bool waitForNewFrame (FrameMap &frame, int milliseconds)
 Wait milliseconds for new frames. More...
 
void waitForNewFrame (FrameMap &frame)
 Wait indefinitely for new frames. More...
 
void release (FrameMap &frame)
 Shortcut to delete all frames. More...
 
virtual bool onNewFrame (Frame::Type type, Frame *frame)
 libfreenect2 calls this function when a new frame is decoded. More...
 
- Public Member Functions inherited from FrameListener
virtual ~FrameListener ()
 

Detailed Description

Collect multiple types of frames.

Constructor & Destructor Documentation

SyncMultiFrameListener ( unsigned int  frame_types)
Parameters
frame_typesUse bitwise or to combine multiple types, e.g. Frame::Ir | Frame::Depth.
virtual ~SyncMultiFrameListener ( )
virtual

Member Function Documentation

bool hasNewFrame ( ) const

Test if there are new frames.

Non-blocking.

bool waitForNewFrame ( FrameMap frame,
int  milliseconds 
)

Wait milliseconds for new frames.

Parameters
[out]frameCaller is responsible to release the frames in frame.
millisecondsTimeout. This parameter is ignored if not built with C++11 threading support.
Returns
true if a frame is received; false if not.
void waitForNewFrame ( FrameMap frame)

Wait indefinitely for new frames.

Parameters
[out]frameCaller is responsible to release the frames in frame.
void release ( FrameMap frame)

Shortcut to delete all frames in frame.

virtual bool onNewFrame ( Frame::Type  type,
Frame frame 
)
virtual

libfreenect2 calls this function when a new frame is decoded.

Parameters
typeType of the new frame.
frameData of the frame.
Returns
true if you want to take ownership of the frame, i.e. reuse/delete it. Will be reused/deleted by caller otherwise.

Implements FrameListener.