4 #include <opencv2/highgui.hpp>
7 #include <wx/stattext.h>
24 wxWindowID
id = wxID_ANY,
25 const wxPoint &pos = wxDefaultPosition,
26 const wxSize &size = wxDefaultSize,
27 long style = wxTAB_TRAVERSAL,
28 const wxString &name = wxPanelNameStr
42 #pragma region control
45 virtual bool open(
const cv::String &filename);
48 virtual bool open(
int device);
55 std::function<
void(cv::Mat &)> callback,
56 std::function<
void(cv::Mat &)> postProcessCallback = [](cv::Mat &){});
65 virtual void seek(
int);
67 #pragma endregion control
69 #pragma region event handling
84 #pragma endregion event handling
88 template <
typename _Tp>
89 bool open_(
const _Tp &deviceOrFilename);
92 static const int LABEL_UPDATE_INTERVAL;
95 static const char* LABEL_DEFAULT_TEXT;
97 std::function<void(cv::Mat &)>
98 m_preProcessCallback = [](cv::Mat &){},
99 m_postProcessCallback = [](cv::Mat &){};
108 void sizeEvent(wxSizeEvent&);
109 void onTimer(wxTimerEvent&);
112 void showTimeLabel(wxStaticText* label,
int frame);
114 std::function<void(cv::Mat &)> m_processCallback = [](cv::Mat &){};
123 m_previousState = paused;
126 void setState(playbackState);
129 cv::VideoCapture* m_videoCapture = NULL;
131 wxButton* m_playButton;
139 class Thread :
public wxThread{
142 virtual void *Entry();
149 DECLARE_EVENT_TABLE()
virtual bool open(const cv::String &filename)
Try to open the named file.
virtual void onPlayClick(wxCommandEvent &)
The user clicked the playback control button.
virtual void onSliderClickUp(wxMouseEvent &)
The user released the mouse button after clicking the slider.
virtual void onSliderClickDown(wxMouseEvent &)
The user clicked the slider.
virtual void seek(int)
Move playback to frame.
virtual void play()
Start media loop.
Class used to display images and as container of widgets.
Definition: ImagePanel.hpp:32
Class to control the playback and processing of media obtained from VideoCapture. ...
Definition: VideoPlayer.hpp:18
virtual void onMouseMove(wxCommandEvent &evt)
The user moved the mouse.
virtual void onSliderMove(wxScrollEvent &)
The user dragged the slider.
ImagePanel & getImage()
Get the xv::Image instance used for rendering.
virtual void stop()
Stops the playback thread.
VideoPlayer(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxPanelNameStr)
Constructor inherited from wxPanel.
virtual void pause()
Pause media loop.
int getCurrentFrameIdx()
Returns the last frame number read from the media.