Nuitrack  1.4.0
3D Skeleton Tracking Middleware
tdv::nuitrack::ColorSensor Class Reference

Represents the interface to the capabilities of the Nuitrack Color Sensor module. More...

#include <ColorSensor.h>

Inheritance diagram for tdv::nuitrack::ColorSensor:
Inheritance graph

Public Types

typedef std::shared_ptr< ColorSensorPtr
 Smart pointer to access the ColorSensor instance. More...
 
typedef std::function< void(RGBFrame::Ptr)> OnNewFrame
 The callback type of the new color frame request. More...
 

Public Member Functions

 ColorSensor (NuitrackModule *pimpl)
 
const OutputMode getOutputMode () const
 Returns output mode of color sensor.
 
uint64_t connectOnNewFrame (const OnNewFrame &callback)
 Add a callback for the new color frame request. More...
 
void disconnectOnNewFrame (uint64_t handler)
 Remove a callback of the new color frame request. More...
 
RGBFrame::Ptr getColorFrame ()
 Returns smart pointer to the last available RGBFrame.
 
bool canUpdate () const
 
virtual uint64_t getTimestamp ()
 Returns the last processed data timestamp in microseconds. More...
 

Static Public Member Functions

static ColorSensor::Ptr create ()
 Create the ColorSensor module object. More...
 

Detailed Description

Represents the interface to the capabilities of the Nuitrack Color Sensor module.

To enable the module, you must create an instance of this class. To create the instance, use a special named constructor ColorSensor::create. This instance is called ColorSensor module object. To receive the new color frames, add an ColorSensor::OnNewFrame callback to the module object with ColorSensor::connectOnNewFrame method.

Member Typedef Documentation

typedef std::function<void (RGBFrame::Ptr)> tdv::nuitrack::ColorSensor::OnNewFrame

The callback type of the new color frame request.

See also
tdv::nuitrack::RGBFrame
connectOnNewFrame
typedef std::shared_ptr<ColorSensor> tdv::nuitrack::ColorSensor::Ptr

Smart pointer to access the ColorSensor instance.

See also
create

Constructor & Destructor Documentation

tdv::nuitrack::ColorSensor::ColorSensor ( NuitrackModule *  pimpl)
inline
Warning
For internal use only.

Member Function Documentation

uint64_t tdv::nuitrack::ColorSensor::connectOnNewFrame ( const OnNewFrame callback)
inline

Add a callback for the new color frame request.

Parameters
[in]callbackCallback to be invoked at the new color frame request.
Returns
Callback ID. You can use it to remove the callback.
See also
disconnectOnNewFrame
static ColorSensor::Ptr tdv::nuitrack::ColorSensor::create ( )
inlinestatic

Create the ColorSensor module object.

Returns
Smart pointer to a new ColorSensor instance.
Note
Do not call this method twice. Instead, use the previously received ColorSensor::Ptr.
void tdv::nuitrack::ColorSensor::disconnectOnNewFrame ( uint64_t  handler)
inline

Remove a callback of the new color frame request.

Parameters
[in]handlerID of the previously added callback.
See also
connectOnNewFrame
virtual uint64_t tdv::nuitrack::ColorSensor::getTimestamp ( )
inlinevirtual

Returns the last processed data timestamp in microseconds.

Returns timestamp corresponding to the last available color frame.

Note
The exact meaning of this value depends on the depth provider.