OCLSLAM  0.1.0
 Hosted by GitHub
Public Member Functions | List of all members
Kinect Class Reference

A class that extends Freenect::FreenectDevice by defining the VideoCallback and DepthCallback functions so we can be getting updates with the latest RGB and Depth frames. More...

#include <freenect_rgbd.hpp>

Inheritance diagram for Kinect:
Inheritance graph
[legend]
Collaboration diagram for Kinect:
Collaboration graph
[legend]

Public Member Functions

 Kinect (freenect_context *ctx, int idx)
 
void VideoCallback (void *rgb, uint32_t timestamp)
 Delivers the latest RGB frame. More...
 
void DepthCallback (void *depth, uint32_t timestamp)
 Delivers the latest Depth frame. More...
 
void setBuffers (cl::CommandQueue &queue, cl::Buffer &rgb, cl::Buffer &depth)
 Sets the host buffers for the RGB and Depth frames. More...
 
bool deliverFrames (cl::CommandQueue &queue, cl::Buffer &rgb, cl::Buffer &depth)
 Transfers the RGB and Depth frames to the specified OpenCL buffers. More...
 

Detailed Description

A class that extends Freenect::FreenectDevice by defining the VideoCallback and DepthCallback functions so we can be getting updates with the latest RGB and Depth frames.

Constructor & Destructor Documentation

Kinect::Kinect ( freenect_context *  ctx,
int  idx 
)
Note
The creation of the device is done through the Freenect class.
Parameters
[in]ctxcontext to open device through (handled by the library).
[in]idxindex of the device on the bus.

Member Function Documentation

bool Kinect::deliverFrames ( cl::CommandQueue &  queue,
cl::Buffer &  rgb,
cl::Buffer &  depth 
)

Transfers the RGB and Depth frames to the specified OpenCL buffers.

Note
Transfers the frames from the staging buffers to the provided device buffers.
Parameters
[in]queuecommand queue that will handle the frame transfers.
[out]rgbOpenCL buffer to which to transfer the RGB frame.
[out]depthOpenCL buffer to which to transfer the Depth frame.
Returns
A flag to indicate whether new frames were present and got transfered.
void Kinect::DepthCallback ( void *  depth,
uint32_t  timestamp 
)

Delivers the latest Depth frame.

Note
Do not call directly, it's only used by the library.
Parameters
[in]depthan array holding the depth frame.
[in]timestampa time stamp.
void Kinect::setBuffers ( cl::CommandQueue &  queue,
cl::Buffer &  hBufferRGB,
cl::Buffer &  hBufferD 
)

Sets the host buffers for the RGB and Depth frames.

It maps the buffers and works with the returned pointers.

Parameters
[in]queuecommand queue associated with the buffers.
[in]hBufferRGBOpenCL buffer for the RGB frame.
[in]hBufferDOpenCL buffer for the Depth frame.
void Kinect::VideoCallback ( void *  rgb,
uint32_t  timestamp 
)

Delivers the latest RGB frame.

Note
Do not call directly, it's only used by the library.
Parameters
[in]rgban array holding the rgb frame.
[in]timestampa time stamp.

The documentation for this class was generated from the following files: