Library context to find and open devices.
More...
#include <libfreenect2/libfreenect2.hpp>
Library context to find and open devices.
You will first find existing devices by calling enumerateDevices().
Then you can openDevice() and control the devices with returned Freenect2Device object.
You may open devices with custom PacketPipeline. After passing a PacketPipeline object to libfreenect2 do not use or free the object, libfreenect2 will take care. If openDevice() fails the PacketPipeline object will get deleted. A new PacketPipeline object has to be created each time a device is opened.
- Parameters
-
usb_context | If the libusb context is provided, Freenect2 will use it instead of creating one. |
Must be called before doing anything else.
- Returns
- Number of devices, 0 if none
std::string getDeviceSerialNumber |
( |
int |
idx | ) |
|
- Parameters
-
- Returns
- Device serial number, or empty if the index is invalid.
std::string getDefaultDeviceSerialNumber |
( |
| ) |
|
- Returns
- Device serial number, or empty if no device exists.
Open device by index with default pipeline.
- Parameters
-
idx | Index number. Index numbers are not determinstic during enumeration. |
- Returns
- New device object, or NULL on failure
Open device by index.
- Parameters
-
idx | Index number. Index numbers are not determinstic during enumeration. |
factory | New PacketPipeline instance. This is always automatically freed. |
- Returns
- New device object, or NULL on failure
Open device by serial number with default pipeline.
- Parameters
-
- Returns
- New device object, or NULL on failure
Open device by serial number.
- Parameters
-
serial | Serial number |
factory | New PacketPipeline instance. This is always automatically freed. |
- Returns
- New device object, or NULL on failure
Open the first device with default pipeline.
- Returns
- New device object, or NULL on failure
Open the first device.
- Parameters
-
factory | New PacketPipeline instance. This is always automatically freed. |
- Returns
- New device object, or NULL on failure