-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathl10printimage.cpp
More file actions
40 lines (32 loc) · 1.13 KB
/
l10printimage.cpp
File metadata and controls
40 lines (32 loc) · 1.13 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
#include "l10printimage.h"
#include <QDebug>
L10PrintImage::L10PrintImage(int width, int height, int rotate, QString filePath, L10ImageProvider* l10imageProvider) :
PrintImageControl (width,height,rotate), _l10imageProvider(l10imageProvider), _filePath(filePath)
{
}
L10PrintImage::~L10PrintImage()
{
}
void L10PrintImage::imageChange(int number)
{
qDebug() << "L10";
_imageWrote = false;
if(number == 0){
requestTransImage(0);
emit sendToQmlChangeImage(_imageTransfuture.get());
requestTransImage(1);
}else{
emit sendToQmlChangeImage(_imageTransfuture.get());
requestTransImage(number + 1);
}
// emit sendToQmlChangeImage(_rootPath + QString::number(number));
}
void L10PrintImage::requestTransImage(int number){
_imageTransfuture = std::async([this](int number) {
QString imagePath = _rootPath + QString::number(number);
QString filePath = _filePath + QString::number(number) + ".png";
Logger::GetInstance()->write("print image path : " + imagePath);
_l10imageProvider->transImage(filePath,number);
return imagePath;
},number);
}