-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloopdata.h
53 lines (41 loc) · 1.05 KB
/
loopdata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef LOOPVIDEO_H
#define LOOPVIDEO_H
#include <QObject>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
class LoopData : public QObject
{
Q_OBJECT
public:
explicit LoopData(std::string filename, QObject *parent = nullptr);
~LoopData();
std::string filename;
std::vector<cv::Mat> loadData();
double getFPS();
int getWidth();
int getHeight();
void setCurrentFrameIndex(unsigned long index);
cv::Mat nextFrame();
std::vector<cv::Mat> getFrames();
void setFrames(std::vector<cv::Mat> newFrames);
void setWidth(int width);
void setHeight(int height);
void writeFile(std::vector<cv::Mat> frames, std::string filepath);
private:
/**
* @brief original file capture
*/
cv::VideoCapture capture;
/**
* @brief loop data
*/
std::vector<cv::Mat> frames;
int width = 0;
int height = 0;
unsigned long frameCount = 0;
unsigned long currentFrameIndex = 0;
signals:
public slots:
};
#endif // LOOPVIDEO_H