1 #ifndef __ImageCanvas_hh__
2 #define __ImageCanvas_hh__
11 #include <wx/dcbuffer.h>
12 #include <wx/thread.h>
14 #include <bias_config.h>
15 #include <Base/Common/BIASpragmaStart.hh>
16 #include <Base/Common/BIASpragmaEnd.hh>
17 #include <Base/Debug/Debug.hh>
18 #include <Base/Image/Image.hh>
22 #define D_IC_IM (1<<0)
29 class ImageLegendFrame;
43 int sbarid=0, wxWindowID
id = -1,
44 const wxPoint& pos = wxDefaultPosition,
45 const wxSize& size = wxSize(320, 240),
46 long style = ( (wxHSCROLL | wxVSCROLL) & wxTRANSPARENT),
47 const wxString& name = wxT(
"ScrolledWindow"));
57 wxPoint GetHistoPos();
59 wxSize GetHistoSize();
61 wxPoint GetValueBarPos();
63 wxSize GetValueBarSize();
66 void ShowHistogramm(wxPoint pos = wxPoint(10,10),
67 wxSize size = wxSize(100,100));
69 wxPoint pos = wxPoint(10,10),
70 wxSize size = wxSize(100,100));
72 void ShowImageValueBar(wxPoint pos = wxPoint(10,10),
73 wxSize size = wxSize(100,100));
75 wxPoint pos = wxPoint(10,10),
76 wxSize size = wxSize(100,100));
77 void HideImageValueBar();
80 virtual bool Show(
bool show=
true) {
return wxScrolledWindow::Show(show);}
86 bool GetMousePos(
int &x,
int &y);
96 { ClearDrawingContext_=clear; }
104 ScaledImageSizeX_ = width;
105 ScaledImageSizeY_ = height;
116 UseHighScaleQuality_ = on;
119 bool HistogrammIsShown();
120 bool ImageValueBarIsShown();
121 void KeepScrollPosition(
bool flag);
124 void SetRoiColor(
unsigned char red,
unsigned char green,
125 unsigned char blue,
unsigned alpha = 128);
126 inline void DrawRoi(
bool enable){ DrawRoi_ = enable; Refresh();}
129 void RaiseZoomWindow(
const bool raise_or_lower);
132 void InitHisto(wxPoint pos = wxPoint(10,10),
133 wxSize size = wxSize(100,100));
134 void InitImageValueBar(wxPoint pos = wxPoint(10,10),
135 wxSize size = wxSize(100,100));
137 void UpdateStatusBar(
unsigned x,
unsigned y);
138 void Zoom(
unsigned x,
unsigned y);
140 virtual void OnPaint(wxPaintEvent& event);
141 virtual void OnErase(wxEraseEvent& event);
142 virtual void OnSize(wxSizeEvent& event);
143 virtual void OnMouseMove(wxMouseEvent &event);
144 virtual void OnMouseLeave(wxMouseEvent &event);
145 virtual void OnMouseEnter(wxMouseEvent &event);
146 virtual void OnMouseWheel(wxMouseEvent &event);
147 virtual void OnRightMouseButton(wxMouseEvent &event);
148 virtual void OnLeftMouseButton(wxMouseEvent &event);
149 virtual void OnKeyPress(wxKeyEvent &event);
150 virtual void PaintRoiOnDc_(wxBufferedPaintDC& dc);
188 DECLARE_EVENT_TABLE()
192 #endif // __ImageCanvas_hh__
bool ClearDrawingContext_
bool UseHighScaleQuality_
It's a Frame used to have a Histogramm Canvas, which describes a histogramm of current image...
void SetScaledImageSize(int width, int height)
Sets the size of the scaled image.
display image in wx application, provides zoom and investigation functionality
BIAS::ImageBase * GetOrigImage()
Frame to display a Image legend, for example in biasviewwx.
used by ImageCanvas and ScaledImageCanvas, should not be used directly
void SetShowScaled(bool on)
void DrawRoi(bool enable)
ImageLegendFrame * MyValueBarFrame_
Class for holding multiple downsampled images.
BIAS::Image< unsigned char > roimask_
BIAS::Image< unsigned char > rgbim_
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 ...
BIAS::Image< unsigned char > * GetImageShown()
virtual bool Show(bool show=true)
This is the base class for images in BIAS.
void SetClearDrawingContext(bool clear)
Canvas now uses double buffering to avoid flickering, so it should be ok to always clear the canvas...