Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::ImageCanvas Class Reference

display image in wx application, provides zoom and investigation functionality More...

#include <Gui/ImageCanvas.hh>

+ Inheritance diagram for BIAS::ImageCanvas:
+ Collaboration diagram for BIAS::ImageCanvas:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
void DrawRoi (bool enable)
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
wxPoint GetHistoPos ()
 
wxSize GetHistoSize ()
 
BIAS::Image< unsigned char > * GetImageShown ()
 
bool GetMousePos (int &x, int &y)
 
BIAS::ImageBaseGetOrigImage ()
 
bool GetShowScaled ()
 
wxPoint GetValueBarPos ()
 
wxSize GetValueBarSize ()
 
void HideImageValueBar ()
 
bool HistogrammIsShown ()
 
 ImageCanvas (wxWindow *parent, wxStatusBar *sbar=NULL, int sbarid=0, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(320, 240), long style=((wxHSCROLL|wxVSCROLL)&wxTRANSPARENT), const wxString &name=wxT("ScrolledWindow"))
 
bool ImageValueBarIsShown ()
 
bool IsRoiDrawn ()
 
void KeepScrollPosition (bool flag)
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RaiseZoomWindow (const bool raise_or_lower)
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetClearDrawingContext (bool clear)
 Canvas now uses double buffering to avoid flickering, so it should be ok to always clear the canvas. More...
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void SetDefaultZoom (unsigned z)
 
void SetHighScaleQuality (bool on)
 Set the quality used for image size rescaling false: Uses the normal default scaling method of pixel replication true: Uses bicubic and box averaging resampling methods for upsampling and downsampling respectively. More...
 
void SetRoiColor (unsigned char red, unsigned char green, unsigned char blue, unsigned alpha=128)
 Set the color which is used to draw the roi. More...
 
void SetScaledImageSize (int width, int height)
 Sets the size of the scaled image. More...
 
void SetShowScaled (bool on)
 
virtual void Show (BIAS::Image< unsigned char > &im, std::string name="")
 
virtual void Show (BIAS::ImageBase &origim, BIAS::Image< unsigned char > &scaledrgbim, std::string name="")
 
virtual void Show (BIAS::PyramidImage< unsigned char > &pim, std::string name="")
 
virtual bool Show (bool show=true)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
void ShowHistogramm (wxPoint pos=wxPoint(10, 10), wxSize size=wxSize(100, 100))
 
void ShowHistogramm (ImageBase &image, wxPoint pos=wxPoint(10, 10), wxSize size=wxSize(100, 100))
 
void ShowImageValueBar (wxPoint pos=wxPoint(10, 10), wxSize size=wxSize(100, 100))
 
void ShowImageValueBar (ImageBase &image, wxPoint pos=wxPoint(10, 10), wxSize size=wxSize(100, 100))
 
 ~ImageCanvas ()
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
void InitHisto (wxPoint pos=wxPoint(10, 10), wxSize size=wxSize(100, 100))
 
void InitImageValueBar (wxPoint pos=wxPoint(10, 10), wxSize size=wxSize(100, 100))
 
virtual void OnErase (wxEraseEvent &event)
 
virtual void OnKeyPress (wxKeyEvent &event)
 
virtual void OnLeftMouseButton (wxMouseEvent &event)
 
virtual void OnMouseEnter (wxMouseEvent &event)
 
virtual void OnMouseLeave (wxMouseEvent &event)
 
virtual void OnMouseMove (wxMouseEvent &event)
 
virtual void OnMouseWheel (wxMouseEvent &event)
 
virtual void OnPaint (wxPaintEvent &event)
 
virtual void OnRightMouseButton (wxMouseEvent &event)
 
virtual void OnSize (wxSizeEvent &event)
 
virtual void PaintRoiOnDc_ (wxBufferedPaintDC &dc)
 
void UpdateStatusBar (unsigned x, unsigned y)
 
void Zoom (unsigned x, unsigned y)
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 
wxBitmap * Bitmap_
 
bool ClearDrawingContext_
 
unsigned DefaultZoom_
 
bool DrawRoi_
 
unsigned height_
 
std::string ImageName_
 
bool KeepScrollPosition_
 
unsigned lastheight_
 
unsigned lastwidth_
 
int mousex_
 
int mousey_
 
HistoFrameMyHistoWin_
 
ImageLegendFrameMyValueBarFrame_
 
ZoomFrameMyZoomWin_
 
BIAS::ImageBase origim_
 
wxMutex origim_mutex_
 
BIAS::Image< unsigned char > rgbim_
 
wxBitmap * RoiBitmap_
 
BIAS::Image< unsigned char > roimask_
 
wxStatusBar * SBar_
 
int SBarID_
 
int SBarWidths_ [2]
 
int ScaledImageSizeX_
 
int ScaledImageSizeY_
 
bool ShowScaled_
 
wxString Title_
 
bool UseHighScaleQuality_
 
unsigned width_
 
wxMutex wxbitmap_mutex_
 
wxImage * wximage_
 
wxImage * wxRoiImage_
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

display image in wx application, provides zoom and investigation functionality

Author
woelk
Examples:
ExampleImageCanvas.cpp, ExampleMixtureOfGaussians.cpp, ExampleV4L.cpp, and ExampleVideoSource_DShow.cpp.

Definition at line 38 of file ImageCanvas.hh.

Constructor & Destructor Documentation

ImageCanvas::ImageCanvas ( wxWindow parent,
wxStatusBar *  sbar = NULL,
int  sbarid = 0,
wxWindowID  id = -1,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxSize(320, 240),
long  style = ( (wxHSCROLL | wxVSCROLL) & wxTRANSPARENT),
const wxString &  name = wxT("ScrolledWindow") 
)

Definition at line 42 of file ImageCanvas.cpp.

ImageCanvas::~ImageCanvas ( )

Definition at line 86 of file ImageCanvas.cpp.

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

void BIAS::ImageCanvas::DrawRoi ( bool  enable)
inline

Definition at line 126 of file ImageCanvas.hh.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

wxPoint ImageCanvas::GetHistoPos ( )

Definition at line 288 of file ImageCanvas.cpp.

wxSize ImageCanvas::GetHistoSize ( )

Definition at line 297 of file ImageCanvas.cpp.

BIAS::Image<unsigned char>* BIAS::ImageCanvas::GetImageShown ( )
inline

Definition at line 84 of file ImageCanvas.hh.

Referenced by BIAS::ImageLegendFrame::OnSave().

bool ImageCanvas::GetMousePos ( int &  x,
int &  y 
)

Definition at line 449 of file ImageCanvas.cpp.

BIAS::ImageBase* BIAS::ImageCanvas::GetOrigImage ( )
inline

Definition at line 82 of file ImageCanvas.hh.

bool BIAS::ImageCanvas::GetShowScaled ( )
inline

Definition at line 99 of file ImageCanvas.hh.

wxPoint ImageCanvas::GetValueBarPos ( )

Definition at line 306 of file ImageCanvas.cpp.

wxSize ImageCanvas::GetValueBarSize ( )

Definition at line 315 of file ImageCanvas.cpp.

void ImageCanvas::HideImageValueBar ( )

Definition at line 477 of file ImageCanvas.cpp.

bool ImageCanvas::HistogrammIsShown ( )

Definition at line 457 of file ImageCanvas.cpp.

bool ImageCanvas::ImageValueBarIsShown ( )

Definition at line 467 of file ImageCanvas.cpp.

void ImageCanvas::InitHisto ( wxPoint  pos = wxPoint(10,10),
wxSize  size = wxSize(100,100) 
)
protected

Definition at line 96 of file ImageCanvas.cpp.

void ImageCanvas::InitImageValueBar ( wxPoint  pos = wxPoint(10,10),
wxSize  size = wxSize(100,100) 
)
protected

Definition at line 103 of file ImageCanvas.cpp.

bool BIAS::ImageCanvas::IsRoiDrawn ( )
inline

Definition at line 127 of file ImageCanvas.hh.

void ImageCanvas::KeepScrollPosition ( bool  flag)
long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void ImageCanvas::OnErase ( wxEraseEvent &  event)
protectedvirtual

Definition at line 503 of file ImageCanvas.cpp.

void ImageCanvas::OnKeyPress ( wxKeyEvent &  event)
protectedvirtual

Definition at line 734 of file ImageCanvas.cpp.

void ImageCanvas::OnLeftMouseButton ( wxMouseEvent &  event)
protectedvirtual
void ImageCanvas::OnMouseEnter ( wxMouseEvent &  event)
protectedvirtual

Definition at line 673 of file ImageCanvas.cpp.

void ImageCanvas::OnMouseLeave ( wxMouseEvent &  event)
protectedvirtual

Definition at line 664 of file ImageCanvas.cpp.

void ImageCanvas::OnMouseMove ( wxMouseEvent &  event)
protectedvirtual
void ImageCanvas::OnMouseWheel ( wxMouseEvent &  event)
protectedvirtual

Definition at line 645 of file ImageCanvas.cpp.

void ImageCanvas::OnPaint ( wxPaintEvent &  event)
protectedvirtual
void ImageCanvas::OnRightMouseButton ( wxMouseEvent &  event)
protectedvirtual
void ImageCanvas::OnSize ( wxSizeEvent &  event)
protectedvirtual

Definition at line 726 of file ImageCanvas.cpp.

void ImageCanvas::PaintRoiOnDc_ ( wxBufferedPaintDC &  dc)
protectedvirtual
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void ImageCanvas::RaiseZoomWindow ( const bool  raise_or_lower)

Definition at line 490 of file ImageCanvas.cpp.

Referenced by BIAS::ScaledImageCanvas::RaiseZoomWindow().

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void BIAS::ImageCanvas::SetClearDrawingContext ( bool  clear)
inline

Canvas now uses double buffering to avoid flickering, so it should be ok to always clear the canvas.

Definition at line 95 of file ImageCanvas.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

void BIAS::ImageCanvas::SetDefaultZoom ( unsigned  z)
inline

Definition at line 88 of file ImageCanvas.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::ImageCanvas::SetHighScaleQuality ( bool  on)
inline

Set the quality used for image size rescaling false: Uses the normal default scaling method of pixel replication true: Uses bicubic and box averaging resampling methods for upsampling and downsampling respectively.

Definition at line 114 of file ImageCanvas.hh.

void BIAS::ImageCanvas::SetRoiColor ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned  alpha = 128 
)

Set the color which is used to draw the roi.

void BIAS::ImageCanvas::SetScaledImageSize ( int  width,
int  height 
)
inline

Sets the size of the scaled image.

Only used if show scaled is on.

Definition at line 102 of file ImageCanvas.hh.

void BIAS::ImageCanvas::SetShowScaled ( bool  on)
inline

Definition at line 98 of file ImageCanvas.hh.

void ImageCanvas::Show ( BIAS::Image< unsigned char > &  im,
std::string  name = "" 
)
virtual
void ImageCanvas::Show ( BIAS::ImageBase origim,
BIAS::Image< unsigned char > &  scaledrgbim,
std::string  name = "" 
)
virtual

Definition at line 152 of file ImageCanvas.cpp.

References BIAS::AsciiToWx(), and BIAS::ROI_Mask.

void ImageCanvas::Show ( BIAS::PyramidImage< unsigned char > &  pim,
std::string  name = "" 
)
virtual

Definition at line 110 of file ImageCanvas.cpp.

References BIAS::PyramidImage< T >::GetSingleImage().

virtual bool BIAS::ImageCanvas::Show ( bool  show = true)
inlinevirtual

Definition at line 80 of file ImageCanvas.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

void ImageCanvas::ShowHistogramm ( wxPoint  pos = wxPoint(10,10),
wxSize  size = wxSize(100,100) 
)

Definition at line 341 of file ImageCanvas.cpp.

References BIAS::AsciiToWx().

void ImageCanvas::ShowHistogramm ( ImageBase image,
wxPoint  pos = wxPoint(10,10),
wxSize  size = wxSize(100,100) 
)

Definition at line 325 of file ImageCanvas.cpp.

References BIAS::AsciiToWx(), and BIAS::ImageBase::IsEmpty().

void ImageCanvas::ShowImageValueBar ( wxPoint  pos = wxPoint(10,10),
wxSize  size = wxSize(100,100) 
)

Definition at line 371 of file ImageCanvas.cpp.

void ImageCanvas::ShowImageValueBar ( ImageBase image,
wxPoint  pos = wxPoint(10,10),
wxSize  size = wxSize(100,100) 
)

Definition at line 357 of file ImageCanvas.cpp.

void ImageCanvas::UpdateStatusBar ( unsigned  x,
unsigned  y 
)
protected

Definition at line 402 of file ImageCanvas.cpp.

References BIAS::AsciiToWx(), and BIAS::ImageBase::PrintPixelValue().

void ImageCanvas::Zoom ( unsigned  x,
unsigned  y 
)
protected

Definition at line 385 of file ImageCanvas.cpp.

References BIAS::AsciiToWx().

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

wxBitmap* BIAS::ImageCanvas::Bitmap_
protected

Definition at line 161 of file ImageCanvas.hh.

bool BIAS::ImageCanvas::ClearDrawingContext_
protected

Definition at line 173 of file ImageCanvas.hh.

unsigned BIAS::ImageCanvas::DefaultZoom_
protected

Definition at line 181 of file ImageCanvas.hh.

bool BIAS::ImageCanvas::DrawRoi_
protected

Definition at line 169 of file ImageCanvas.hh.

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

unsigned BIAS::ImageCanvas::height_
protected

Definition at line 182 of file ImageCanvas.hh.

std::string BIAS::ImageCanvas::ImageName_
protected
bool BIAS::ImageCanvas::KeepScrollPosition_
protected

Definition at line 170 of file ImageCanvas.hh.

unsigned BIAS::ImageCanvas::lastheight_
protected

Definition at line 183 of file ImageCanvas.hh.

unsigned BIAS::ImageCanvas::lastwidth_
protected

Definition at line 183 of file ImageCanvas.hh.

int BIAS::ImageCanvas::mousex_
protected

Definition at line 179 of file ImageCanvas.hh.

int BIAS::ImageCanvas::mousey_
protected

Definition at line 179 of file ImageCanvas.hh.

HistoFrame* BIAS::ImageCanvas::MyHistoWin_
protected

Definition at line 153 of file ImageCanvas.hh.

ImageLegendFrame* BIAS::ImageCanvas::MyValueBarFrame_
protected

Definition at line 154 of file ImageCanvas.hh.

ZoomFrame* BIAS::ImageCanvas::MyZoomWin_
protected

Definition at line 152 of file ImageCanvas.hh.

BIAS::ImageBase BIAS::ImageCanvas::origim_
protected
wxMutex BIAS::ImageCanvas::origim_mutex_
protected
BIAS::Image<unsigned char> BIAS::ImageCanvas::rgbim_
protected
wxBitmap* BIAS::ImageCanvas::RoiBitmap_
protected

Definition at line 160 of file ImageCanvas.hh.

BIAS::Image<unsigned char> BIAS::ImageCanvas::roimask_
protected

Definition at line 158 of file ImageCanvas.hh.

wxStatusBar* BIAS::ImageCanvas::SBar_
protected

Definition at line 165 of file ImageCanvas.hh.

int BIAS::ImageCanvas::SBarID_
protected

Definition at line 177 of file ImageCanvas.hh.

int BIAS::ImageCanvas::SBarWidths_[2]
protected

Definition at line 178 of file ImageCanvas.hh.

int BIAS::ImageCanvas::ScaledImageSizeX_
protected

Definition at line 175 of file ImageCanvas.hh.

int BIAS::ImageCanvas::ScaledImageSizeY_
protected

Definition at line 175 of file ImageCanvas.hh.

bool BIAS::ImageCanvas::ShowScaled_
protected

Definition at line 168 of file ImageCanvas.hh.

wxString BIAS::ImageCanvas::Title_
protected

Definition at line 186 of file ImageCanvas.hh.

bool BIAS::ImageCanvas::UseHighScaleQuality_
protected

Definition at line 176 of file ImageCanvas.hh.

unsigned BIAS::ImageCanvas::width_
protected

Definition at line 182 of file ImageCanvas.hh.

wxMutex BIAS::ImageCanvas::wxbitmap_mutex_
protected

Definition at line 164 of file ImageCanvas.hh.

wxImage* BIAS::ImageCanvas::wximage_
protected

Definition at line 163 of file ImageCanvas.hh.

wxImage* BIAS::ImageCanvas::wxRoiImage_
protected

Definition at line 162 of file ImageCanvas.hh.


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