-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprintimagecontrol.cpp
More file actions
50 lines (41 loc) · 1012 Bytes
/
printimagecontrol.cpp
File metadata and controls
50 lines (41 loc) · 1012 Bytes
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
#include "printimagecontrol.h"
#include <QDebug>
PrintImageControl::PrintImageControl(int width, int height, int rotate) :
_width(width), _height(height), _rotate(rotate)
{
reset();
}
PrintImageControl::~PrintImageControl()
{
}
void PrintImageControl::imageWrote()
{
qDebug() << "image worte";
_imageWrote = true;
_cv_image.notify_all();
}
void PrintImageControl::imageScale(double scale)
{
_scale = scale;
emit sendToQmlImageScale(_scale);
}
void PrintImageControl::waitImageWrote()
{
std::unique_lock<std::mutex> lk(_cv_image_m);
_cv_image.wait(lk,[this]{return this->_imageWrote;});
}
void PrintImageControl::setRootPath(QString path)
{
_rootPath = path;
}
void PrintImageControl::imageSetBlack()
{
_imageWrote = false;
emit sendToQmlChangeImage("qrc:/image/defaultBlackImage.png");
}
void PrintImageControl::reset()
{
emit sendToQmlImageScale(_scale);
emit sendToQmlImageRotate(_rotate);
emit sendToQmlImageWidhtHeight(_width,_height);
}