-
Notifications
You must be signed in to change notification settings - Fork 0
/
workers.h
50 lines (38 loc) · 1.06 KB
/
workers.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
//
// Created by Danila Belous on 27.01.2023 at 06:36.
//
#pragma once
// #include "perf_helper.h"
#include "coloring.h"
#include "render_layout.h"
#include <QImage>
#include <QObject>
#include <atomic>
class workers : public QObject {
Q_OBJECT
public:
workers();
public slots:
void render_image(render_layout const& lay, double scale_factor);
void set_style(coloring style);
signals:
void image_ready(QImage const& image);
public:
std::atomic<unsigned int> m_max_version{0};
void set_nthreads(unsigned int nthreads);
private:
constexpr static ushort NSTEPS = 8;
constexpr static ushort STOP = 5000;
constexpr static ushort MIN_ITER_INIT = 100;
constexpr static ushort MAX_ITER_INIT = 5000;
ushort iter_start = 100;
ushort iter_step = 100;
unsigned int m_nthreads;
coloring m_style{coloring::fiery};
constexpr static ushort NCOLORS = 16;
uint m_mapping[NCOLORS];
// perf_helper m_perf_helper;
std::atomic<uint32_t> m_cur_version{0};
std::atomic<uint8_t> m_failed{false};
void fill_image(QImage& image, render_layout const& lay);
};