11 #include <opencv2/core.hpp>
12 #include <opencv2/highgui/highgui.hpp>
42 wxWindowID
id = wxID_ANY,
43 const wxPoint &pos = wxDefaultPosition,
44 const wxSize &size = wxDefaultSize,
45 long style = wxTAB_TRAVERSAL,
46 const wxString &name = wxPanelNameStr
50 #pragma region operators
59 operator cv::_InputOutputArray()
const {
return m_image.
m_cvMat; }
62 operator cv::Mat()
const {
return m_image.
m_cvMat; }
65 operator cv::Mat&() {
return m_image.
m_cvMat; }
69 #pragma endregion operators
72 void Refresh(
bool eraseBackground =
false,
const wxRect *rect = NULL);
79 #if defined(wxUSE_GUI)
80 void paintEvent(wxPaintEvent&);
81 void sizeEvent(wxSizeEvent&);
82 void onEraseBackground(wxEraseEvent&);
86 void render(
int ms=16);
88 std::function<void(cv::Mat &)>
89 m_preProcessCallback = [](cv::Mat &){},
90 m_postProcessCallback = [](cv::Mat &){};
92 void onMouseMove(wxMouseEvent& evt);
93 void onMouseDown(wxMouseEvent& evt);
94 void onMouseUp(wxMouseEvent& evt);
96 bool containsWidget(Widget*);
99 std::chrono::steady_clock::time_point m_lastPaintTime;
103 inline void createBitmap();
106 imagePanel.m_mutex.lock();
107 videoCapture >> imagePanel.m_image.m_cvMat;
108 imagePanel.m_mutex.unlock();
114 imagePanel.m_mutex.lock();
115 imagePanel.m_image.
m_cvMat = mat.clone();
116 imagePanel.m_mutex.unlock();
124 DECLARE_EVENT_TABLE()
ImagePanel()
Default constructor.
void operator<<(Widget &widget)
Simple rendering/display of widget without user input.
void Refresh(bool eraseBackground=false, const wxRect *rect=NULL)
Redraw an image optionally erasing background first or a limited area.
void operator>>(Widget &widget)
widgets for user input
Class used to display images and as container of widgets.
Definition: ImagePanel.hpp:32
cv::Mat m_cvMat
to-do: refactor
Definition: Image.hpp:59
float getScale()
The scale ratio of the image in relation to the original data.
Definition: ImagePanel.hpp:75
friend void operator<<(ImagePanel &imagePanel, cv::Mat &mat)
use the xv::Image to display a cv::Mat
Definition: ImagePanel.hpp:113