-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideoprocesssing.h
More file actions
69 lines (61 loc) · 1.69 KB
/
videoprocesssing.h
File metadata and controls
69 lines (61 loc) · 1.69 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef VIDEOTREATMENT_H
#define VIDEOTREATMENT_H
#include <random>
#include <vector>
#include <map>
#include <opencv2/opencv.hpp>
#include <QImage>
#include <QFontDatabase>
#include <QLabel>
#include <QObject>
#include <QTextEdit>
#include <QLayout>
#include <QFont>
#include <QResource>
#include <QString>
#include <QPainter>
#include <iostream>
#include <QDir>
#include <limits.h>
#include <locale>
#include <codecvt>
#include <string>
#include <QColor>
#include <QPen>
#include <QLinearGradient>
#include <utility>
#include <QPoint>
#include <QGraphicsBlurEffect>
#include "mainwindow.h"
#include "raindrop.h"
class VideoProcessing : public QObject
{
Q_OBJECT
public:
explicit VideoProcessing(QObject *parent = nullptr);
std::pair<std::vector<std::wstring>, std::vector<wchar_t>> image_to_ascii(const cv::Mat& image);
public slots:
void processFrame(const QImage &camera_frame);
QImage applyEffectToImage(QImage src, QGraphicsEffect *effect);
signals:
void imageGenerated(const QImage& image);
void imageGeneratedWithoutBlur(const QImage& image);
private:
QLabel* label;
int len_array_width;
int len_array_height;
std::wstring characters;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
QFont mtx;
std::map<int, std::wstring> ascii_cache;
QTextEdit *textEdit;
QImage textImage;
QLabel *videoLabel;
class VideoProcessing *videoTreatmentObject;
std::vector<Raindrop*> raindrops;
QImage imageWithAscii;
QImage imageWithAscii2;
void update_ascii_image(const QImage &image);
void paintRainDrop(QPainter& painter, std::pair<std::vector<std::wstring>, std::vector<wchar_t>> ascii_image);
};
#endif // VIDEOTREATMENT_H