20 #ifndef FRAMECONVERTER_HPP 21 #define FRAMECONVERTER_HPP 23 #include <QBasicTimer> 27 #include "ColorSpace.hpp" 29 #include <opencv2/core/mat.hpp> 51 static void matDeleter(
void *mat) {
delete static_cast<cv::Mat*
>(mat); }
66 void processFrame(
const cv::Mat &frame,
enum ColorSpace);
73 void queue(
const cv::Mat & frame, ColorSpace cs);
75 void process(cv::Mat frame, ColorSpace cs);
80 #endif // FRAMECONVERTER_HPP void process(cv::Mat frame, ColorSpace cs)
Actually process a frame.
Definition: FrameConverter.cpp:61
void timerEvent(QTimerEvent *ev)
Called each time that mTimer ticks...
Definition: FrameConverter.cpp:77
QBasicTimer mTimer
Process a frame at each tick of this timer.
Definition: FrameConverter.hpp:40
void setFrameSize(QSize size)
Set the resolution of the frames we are processing.
Definition: FrameConverter.cpp:47
void queue(const cv::Mat &frame, ColorSpace cs)
Queue a new frame to be processed (depends on processAll if it gets processed).
Definition: FrameConverter.cpp:52
void processFrame(const cv::Mat &frame, enum ColorSpace)
Add a new frame to be processed; if not processAll this frame may yet be dropped. ...
Definition: FrameConverter.cpp:38
cv::Mat currentFrame
The current frame to process into a QImage.
Definition: FrameConverter.hpp:42
ColorSpace currentCS
The current ColorSpace of the frame we are processing.
Definition: FrameConverter.hpp:44
void setProcessAll(bool all)
Set whether we should process all frames, or drop some.
Definition: FrameConverter.hpp:57
static void matDeleter(void *mat)
Delete a cv::Mat object.
Definition: FrameConverter.hpp:51
QSize frameSize
The resolution of the frames that we are processing.
Definition: FrameConverter.hpp:48
void stop()
Stop processing frames.
Definition: FrameConverter.cpp:87
bool processAll
Whether we should process all frames, or drop some to keep framerate.
Definition: FrameConverter.hpp:46
void imageReady(const QImage &)
Emitted when we have a QImage from processing ready for display.
Recieves frames (as cv::Mat), processes them (ideally asynchronously) and emits them as a QImage (i...
Definition: FrameConverter.hpp:35