pcl_visualization::ImageWidgetWX Class Reference

#include <image_widget_wx.h>

Inheritance diagram for pcl_visualization::ImageWidgetWX:
Inheritance graph
[legend]

List of all members.

Classes

class  ImageFrame
struct  ImageLine
class  ImagePanel
struct  ImagePoint

Public Types

typedef void(* PixelClickedHandler )(float pixel_x, float pixel_y)

Public Member Functions

void addPixelClickedHandler (PixelClickedHandler pixel_clicked_handler)
 Save a snapshot of the widget to disc as a png.
 ImageWidgetWX ()
 Constructor.
void informAboutImageFrameDestruction ()
 Just ignore this function. For internal use only.
bool isShown () const
 Returns false if the widget is still active and true if it was closed.
void markLine (float x1, float y1, float x2, float y2, const wxPen *color=wxGREEN_PEN)
 Marks a line in the image by.
void markPoint (float x, float y, const wxPen *color=wxGREEN_PEN, const wxBrush *background=wxTRANSPARENT_BRUSH)
 Marks a point in the image by drawing a small circle around it.
void OnClose (wxCloseEvent &event)
 Do not call this! For internal use only.
void setAngleImage (const float *angle_image, unsigned int width, unsigned int height, const char *name="angle image")
 Visualize an angle image (values in rad!).
void setFloatImage (const float *float_image, unsigned int width, unsigned int height, const char *name="float image", float min_value=-INFINITY, float max_value=INFINITY, bool grayscale=false)
 Visualize a float image.
void setHalfAngleImage (const float *angle_image, unsigned int width, unsigned int height, const char *name="angle image")
 Visualize an angle image with a -90,90deg wrap-around (values in rad!).
void setName (const std::string &name)
 Set the name (caption) of the widget.
void setRGBImage (const unsigned char *data, unsigned int width, unsigned int height, const char *name="RGB image")
 Visualize a RGB image.
void setSize (int width=-1, int height=-1)
void show (bool show_widget=true)
 Show or hide the widget.
 ~ImageWidgetWX ()
 Destructor.

Static Public Member Functions

static void spin ()
static void spinOnce ()

Public Attributes

bool keepAspectRatio
 Set this to false if you want to scale your window without keeping the original aspect ratio of the image.
float last_clicked_point_x
float last_clicked_point_y
bool mouse_click_happened
bool print_selected_point
bool visualize_selected_point

Protected Member Functions

void reset ()

Protected Attributes

unsigned char * image_data
ImageFrameimage_frame

Detailed Description

This class encapsulate a wxWidget to visualize an image. Warning: This header calls IMPLEMENT_APP_NO_MAIN(wxApp). If you do not want this (because you handle the wxApp yourself) include the header like this: define DO_NOT_CALL_WX_IMPLEMENT_APP 0 include "range_image_visualizer.h" undef DO_NOT_CALL_WX_IMPLEMENT_APP Please call wxEntryCleanup(); when you do not need the wxApp anymore.

Author:
Bastian Steder

Definition at line 56 of file image_widget_wx.h.


Member Typedef Documentation

typedef void(* pcl_visualization::ImageWidgetWX::PixelClickedHandler)(float pixel_x, float pixel_y)

Definition at line 72 of file image_widget_wx.h.


Constructor & Destructor Documentation

pcl_visualization::ImageWidgetWX::ImageWidgetWX (  ) 

Constructor.

Definition at line 67 of file image_widget_wx.cpp.

pcl_visualization::ImageWidgetWX::~ImageWidgetWX (  ) 

Destructor.

Definition at line 85 of file image_widget_wx.cpp.


Member Function Documentation

void pcl_visualization::ImageWidgetWX::addPixelClickedHandler ( PixelClickedHandler  pixel_clicked_handler  ) 

Save a snapshot of the widget to disc as a png.

Subscribe a handler that will be called, when a point in the image is (left) clicked. The E.g.: void pixelClickedHandler(float pixel_x, float pixel_y) { doSomething(); } The pixel is in the original image, not in the scaled one!

Definition at line 225 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::informAboutImageFrameDestruction (  ) 

Just ignore this function. For internal use only.

Definition at line 199 of file image_widget_wx.cpp.

bool pcl_visualization::ImageWidgetWX::isShown (  )  const

Returns false if the widget is still active and true if it was closed.

Definition at line 218 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::markLine ( float  x1,
float  y1,
float  x2,
float  y2,
const wxPen *  color = wxGREEN_PEN 
)

Marks a line in the image by.

Definition at line 212 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::markPoint ( float  x,
float  y,
const wxPen *  color = wxGREEN_PEN,
const wxBrush *  background = wxTRANSPARENT_BRUSH 
)

Marks a point in the image by drawing a small circle around it.

Definition at line 206 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::OnClose ( wxCloseEvent &  event  ) 

Do not call this! For internal use only.

void pcl_visualization::ImageWidgetWX::reset (  )  [protected]

Definition at line 98 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::setAngleImage ( const float *  angle_image,
unsigned int  width,
unsigned int  height,
const char *  name = "angle image" 
)

Visualize an angle image (values in rad!).

Definition at line 181 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::setFloatImage ( const float *  float_image,
unsigned int  width,
unsigned int  height,
const char *  name = "float image",
float  min_value = -INFINITY,
float  max_value = INFINITY,
bool  grayscale = false 
)

Visualize a float image.

Definition at line 171 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::setHalfAngleImage ( const float *  angle_image,
unsigned int  width,
unsigned int  height,
const char *  name = "angle image" 
)

Visualize an angle image with a -90,90deg wrap-around (values in rad!).

Definition at line 190 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::setName ( const std::string &  name  ) 

Set the name (caption) of the widget.

Definition at line 164 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::setRGBImage ( const unsigned char *  data,
unsigned int  width,
unsigned int  height,
const char *  name = "RGB image" 
)

Visualize a RGB image.

Definition at line 138 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::setSize ( int  width = -1,
int  height = -1 
)

Set the size of the window. If you give no values it will resize to the original image size and if you leave one value -1 it will keep the aspect ratio (The latter will always be the case if keepAspectRatio is true)

Definition at line 115 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::show ( bool  show_widget = true  ) 

Show or hide the widget.

Definition at line 231 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::spin (  )  [static]

Definition at line 62 of file image_widget_wx.cpp.

void pcl_visualization::ImageWidgetWX::spinOnce (  )  [static]

Definition at line 50 of file image_widget_wx.cpp.


Member Data Documentation

Definition at line 233 of file image_widget_wx.h.

Definition at line 232 of file image_widget_wx.h.

Set this to false if you want to scale your window without keeping the original aspect ratio of the image.

Definition at line 121 of file image_widget_wx.h.

Definition at line 127 of file image_widget_wx.h.

Definition at line 127 of file image_widget_wx.h.

This value is set to true every time the image was clicked. The pixel position (in the original image, not the scaled one!) is written into last_clicked_point_x, last_clicked_point_y. You can use this if you don't want to register a handler function by setting it to false manually, after you handled a mouse event.

Definition at line 126 of file image_widget_wx.h.

Definition at line 129 of file image_widget_wx.h.

Definition at line 128 of file image_widget_wx.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


pcl_visualization
Author(s): Radu Bogdan Rusu, Bastian Steder, Ethan Rublee
autogenerated on Fri Jan 11 09:59:19 2013