-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworker.cpp
More file actions
56 lines (45 loc) · 1.38 KB
/
worker.cpp
File metadata and controls
56 lines (45 loc) · 1.38 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
#include "worker.h"
#include <QThread>
#include <QColor>
#include <QDebug>
#include <QTime>
Worker::Worker(int band)
{
this->bandNumber = band;
}
void Worker::process()
{
qDebug() << "in thread for band" << bandNumber;
QThread::sleep(1);
emit finished();
/*octave_value_list input;
int matrixRows, matrixCols;
QByteArray ba = this->filename.toLatin1();
const char *fileNameChar = ba.data();
input(0) = octave_value(fileNameChar);
octave_value_list output = feval("readMat", input);
Matrix outputMatrix = output(0).matrix_value();
matrixRows = outputMatrix.rows();
matrixCols = outputMatrix.columns();
int numberChannels = matrixCols / output(0).columns();
matrixCols = matrixCols / numberChannels;
//QImage bandImage(QSize(matrixRows, matrixCols), QImage::Format_RGB888);
int hValue;
int sValue = 100;
int lValue = 100;
QColor color;
for(int k = 0; k < numberChannels; k++)
{
for(int i = 0; i < matrixRows; i++)
{
for(int j = 0; j < matrixCols; j++)
{
// Value range: {0, 4096}
hValue = 360 * ( outputMatrix.elem(i, (matrixCols * k) + j) / 4096);
color.setHsv(hValue, sValue, lValue);
//bandImage.setPixelColor(QPoint(i, j), color);
}
}
//imageVector.append(bandImage);
}*/
}