iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::DisplayImageSink Class Reference

#include <nrt/ImageProc/IO/ImageSink/DisplayImageSink.H>

An ImageSink that can display Images in Gtk various Gtk windows.

Passing in different strings to the label parameter of out() will divert the Images to different windows (creating those windows if they don't yet exist).

tests/test-ImageReader.C, and tests/test-Pyramid.C.

Definition at line 48 of file DisplayImageSink.H.

Inheritance diagram for nrt::DisplayImageSink:
nrt::ImageSinkType nrt::Component nrt::ParameterRegistry

Public Member Functions

 DisplayImageSink (std::string const &instanceName="display")
void postInit ()
 Start Gtk in a new thread.
void postUninit ()
 Kill Gtk.
void out (GenericImage img, std::string label="")
 Display the given image in a window.
void setClickCallback (std::function< void(Point2D< int32 >, int32)> callback)
 Set a callback that will be called whenever a mouse button is pressed.
void setKeyCallback (std::function< void(int32)>)
 Set a callback that will be called whenever a keyboard key is pressed.
void setMotionCallback (std::function< void(Point2D< int32 >, int32)>=std::function< void(Point2D< int32 >, int32)>())
 Set a callback that will be called whenever a the mouse is moved in the window. More...

Static Public Member Functions

static std::string id ()
 Get the name associated with our –out type.
static std::string description ()
 Get a description to show for –help.

Additional Inherited Members

- Protected Member Functions inherited from nrt::Component
virtual void preInit ()
 Called before all sub-Components are init()ed.
virtual void preStart ()
 Called before all sub-Components are start()ed.
virtual void postStart ()
 Called after all sub-Components are start()ed.
virtual void run ()
 Called in its own thread after all Components have been start()ed. More...
virtual void preStop ()
 Called before all sub-Components are stop()ed.
virtual void postStop ()
 Called after all sub-Components are stop()ed.
virtual void preUninit ()
 Called before all sub-Components are uninit()ed.
virtual void notifyParamChanged (nrt::ParameterState const state, ParameterBase const *const param) const
 This method is called by a Parameter when it has been changed. Users should never overload this method.
void populateHelpMessage (std::string const &cname, std::unordered_map< std::string, std::unordered_map< std::string, std::vector< std::pair< std::string, std::string > > > > &helplist) const
- Protected Attributes inherited from nrt::Component
boost::shared_mutex itsMtx
 Mutex used to protect our internals other than subcomponents and parameters.
std::vector< std::shared_ptr
< Component > > 
boost::shared_mutex itsSubMtx
Component *const nrt_component_this

Member Function Documentation

void nrt::DisplayImageSink::setMotionCallback ( std::function< void(Point2D< int32 >, int32)>  = std::function< void(Point2D< int32 >, int32)>())

Set a callback that will be called whenever a the mouse is moved in the window.

See the gtk documentation for GdkModifierType for more info on this buttonMask. Calling this method with an empty std::function (which is the default argument) will unset the callback mechanisms, saving significant CPU power.

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