Basic Image AlgorithmS Library 2.8.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

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:

List of all members.

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
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel
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.
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.
void SetRoiColor (unsigned char red, unsigned char green, unsigned char blue, unsigned alpha=128)
 Set the color which is used to draw the roi.
void SetScaledImageSize (int width, int height)
 Sets the size of the scaled image.
void SetShowScaled (bool on)
virtual bool Show (bool show=true)
virtual void Show (BIAS::PyramidImage< unsigned char > &pim, std::string name="")
virtual void Show (BIAS::ImageBase &origim, BIAS::Image< unsigned char > &scaledrgbim, std::string name="")
virtual void Show (BIAS::Image< unsigned char > &im, std::string name="")
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels
void ShowHistogramm (ImageBase &image, wxPoint pos=wxPoint(10, 10), wxSize size=wxSize(100, 100))
void ShowHistogramm (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
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
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) [inline, inherited]
void BIAS::Debug::AddDebugLevel ( const std::string &  name) [inline, inherited]

Definition at line 363 of file Debug.hh.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( ) [inline, protected, inherited]

returns the next available debuglevel

Author:
woelk 09/2006

Definition at line 522 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const [inline, inherited]
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const [inline, inherited]

Definition at line 351 of file Debug.hh.

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

Definition at line 126 of file ImageCanvas.hh.

int BIAS::Debug::GetDebugLevel ( ) const [inline, inherited]
void BIAS::Debug::GetDebugStream ( std::ostream &  os) const [inline, inherited]

Definition at line 415 of file Debug.hh.

std::ostream& BIAS::Debug::GetDebugStream ( ) const [inline, inherited]

Definition at line 406 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( ) [inline, static, inherited]

Definition at line 432 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 [inline, inherited]

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

Author:
woelk 09/2006

Definition at line 455 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name) [inline, inherited]
void ImageCanvas::OnErase ( wxEraseEvent &  event) [protected, virtual]

Definition at line 503 of file ImageCanvas.cpp.

void ImageCanvas::OnKeyPress ( wxKeyEvent &  event) [protected, virtual]

Definition at line 734 of file ImageCanvas.cpp.

void ImageCanvas::OnLeftMouseButton ( wxMouseEvent &  event) [protected, virtual]
void ImageCanvas::OnMouseEnter ( wxMouseEvent &  event) [protected, virtual]

Definition at line 673 of file ImageCanvas.cpp.

void ImageCanvas::OnMouseLeave ( wxMouseEvent &  event) [protected, virtual]

Definition at line 664 of file ImageCanvas.cpp.

void ImageCanvas::OnMouseMove ( wxMouseEvent &  event) [protected, virtual]
void ImageCanvas::OnMouseWheel ( wxMouseEvent &  event) [protected, virtual]

Definition at line 645 of file ImageCanvas.cpp.

void ImageCanvas::OnPaint ( wxPaintEvent &  event) [protected, virtual]
void ImageCanvas::OnRightMouseButton ( wxMouseEvent &  event) [protected, virtual]
void ImageCanvas::OnSize ( wxSizeEvent &  event) [protected, virtual]

Definition at line 726 of file ImageCanvas.cpp.

void ImageCanvas::PaintRoiOnDc_ ( wxBufferedPaintDC &  dc) [protected, virtual]
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const [inline, inherited]

Definition at line 384 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 std::string &  name) [inline, inherited]

Definition at line 377 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv) [inline, inherited]

Definition at line 370 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) [inline, inherited]
void BIAS::Debug::SetDebugLevel ( const std::string &  name) [inline, inherited]

Definition at line 326 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os) [inline, inherited]

Definition at line 399 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) [inline, static, inherited]

Definition at line 425 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.

void ImageCanvas::Show ( BIAS::PyramidImage< unsigned char > &  pim,
std::string  name = "" 
) [virtual]
virtual bool BIAS::ImageCanvas::Show ( bool  show = true) [inline, virtual]

Definition at line 80 of file ImageCanvas.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const [inline, inherited]

prints all internally known debuglevels

Author:
woelk 09/2006

Definition at line 497 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.

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::ImageBase::IsEmpty().

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::ShowImageValueBar ( wxPoint  pos = wxPoint(10,10),
wxSize  size = wxSize(100,100) 
)

Definition at line 371 of file ImageCanvas.cpp.

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

Definition at line 402 of file ImageCanvas.cpp.

References BIAS::ImageBase::PrintPixelValue().

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

Definition at line 385 of file ImageCanvas.cpp.


Member Data Documentation

long int BIAS::Debug::_liDebugLevel [protected, inherited]

Definition at line 511 of file Debug.hh.

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

long int BIAS::Debug::_liNextDebugLevel [protected, inherited]

new concept, debuglevel are managed here in the debug class

Definition at line 517 of file Debug.hh.

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

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel [protected, inherited]

Definition at line 518 of file Debug.hh.

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

std::ostream BIAS::Debug::_zDebugStream [static, protected, inherited]

Definition at line 512 of file Debug.hh.

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

wxBitmap* BIAS::ImageCanvas::Bitmap_ [protected]

Definition at line 161 of file ImageCanvas.hh.

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 [static, protected, inherited]

Definition at line 514 of file Debug.hh.

unsigned BIAS::ImageCanvas::height_ [protected]

Definition at line 182 of file ImageCanvas.hh.

std::string BIAS::ImageCanvas::ImageName_ [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.

Definition at line 153 of file ImageCanvas.hh.

Definition at line 154 of file ImageCanvas.hh.

Definition at line 152 of file ImageCanvas.hh.

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.

Definition at line 175 of file ImageCanvas.hh.

Definition at line 175 of file ImageCanvas.hh.

Definition at line 168 of file ImageCanvas.hh.

wxString BIAS::ImageCanvas::Title_ [protected]

Definition at line 186 of file ImageCanvas.hh.

Definition at line 176 of file ImageCanvas.hh.

unsigned BIAS::ImageCanvas::width_ [protected]

Definition at line 182 of file ImageCanvas.hh.

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:
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends