29 #ifndef FREENECT_RGBD_HPP
30 #define FREENECT_RGBD_HPP
33 #include <libfreenect.hpp>
35 #if defined(__APPLE__) || defined(__MACOSX)
36 #include <OpenCL/cl.hpp>
46 class Kinect :
public Freenect::FreenectDevice
49 Kinect (freenect_context *ctx,
int idx);
55 void setBuffers (cl::CommandQueue &queue, cl::Buffer &rgb, cl::Buffer &depth);
57 bool deliverFrames (cl::CommandQueue &queue, cl::Buffer &rgb, cl::Buffer &depth);
60 std::mutex rgbMutex, depthMutex;
63 bool newRGBFrame, newDepthFrame;
64 unsigned int width, height;
68 #endif // FREENECT_RGBD_HPP
Kinect(freenect_context *ctx, int idx)
Definition: freenect_rgbd.cpp:37
void DepthCallback(void *depth, uint32_t timestamp)
Delivers the latest Depth frame.
Definition: freenect_rgbd.cpp:66
void VideoCallback(void *rgb, uint32_t timestamp)
Delivers the latest RGB frame.
Definition: freenect_rgbd.cpp:52
bool deliverFrames(cl::CommandQueue &queue, cl::Buffer &rgb, cl::Buffer &depth)
Transfers the RGB and Depth frames to the specified OpenCL buffers.
Definition: freenect_rgbd.cpp:100
A class that extends Freenect::FreenectDevice by defining the VideoCallback and DepthCallback functio...
Definition: freenect_rgbd.hpp:46
void setBuffers(cl::CommandQueue &queue, cl::Buffer &rgb, cl::Buffer &depth)
Sets the host buffers for the RGB and Depth frames.
Definition: freenect_rgbd.cpp:81