@@ -42,7 +42,37 @@ QString RtiParameters::summary() {
42
42
return txt;
43
43
}
44
44
45
- RtiTask::RtiTask (const Project &_project): Task(), project(_project) {}
45
+ RtiTask::RtiTask (): Task() {
46
+ builder = new RtiBuilder;
47
+ }
48
+
49
+ void RtiTask::setProject (Project &project) {
50
+ builder->imageset .pixel_size = project.pixelSize ;
51
+
52
+ builder->nworkers = QSettings ().value (" nworkers" , 8 ).toInt ();
53
+ builder->samplingram = QSettings ().value (" ram" , 512 ).toInt ();
54
+
55
+
56
+ ImageSet &imageset = builder->imageset ;
57
+
58
+ imageset.images = project.getImages ();
59
+ imageset.initImages (project.dir .absolutePath ().toStdString ().c_str ());
60
+
61
+ imageset.initFromDome (project.dome ); // lights after images
62
+ imageset.setCrop (crop, project.offsets );
63
+ imageset.pixel_size = project.pixelSize ;
64
+
65
+ // TODO too many crop locations!
66
+ if (!crop.isNull ()) {
67
+ builder->crop [0 ] = imageset.left ;
68
+ builder->crop [1 ] = imageset.top ;
69
+ builder->crop [2 ] = imageset.width ;
70
+ builder->crop [3 ] = imageset.height ;
71
+ }
72
+
73
+ builder->width = imageset.width ;
74
+ builder->height = imageset.height ;
75
+ }
46
76
47
77
RtiTask::~RtiTask () {
48
78
if (builder)
@@ -52,20 +82,6 @@ RtiTask::~RtiTask() {
52
82
void RtiTask::setParameters (RtiParameters &p) {
53
83
parameters = p;
54
84
label = parameters.summary ();
55
- }
56
-
57
- void RtiTask::run () {
58
- label = parameters.summary ();
59
-
60
- status = RUNNING;
61
- std::function<bool (QString s, int d)> callback = [this ](QString s, int n)->bool { return this ->progressed (s, n); };
62
-
63
- // TODO mnove all this to the constructor (except what parameters can set.
64
- builder = new RtiBuilder;
65
- builder->imageset .pixel_size = project.pixelSize ;
66
-
67
- builder->nworkers = QSettings ().value (" nworkers" , 8 ).toInt ();
68
- builder->samplingram = QSettings ().value (" ram" , 512 ).toInt ();
69
85
70
86
builder->type = parameters.basis ;
71
87
builder->colorspace = parameters.colorspace ;
@@ -81,24 +97,12 @@ void RtiTask::run() {
81
97
if (parameters.format == RtiParameters::RTI)
82
98
builder->commonMinMax = true ;
83
99
84
- ImageSet &imageset = builder->imageset ;
85
- imageset.images = project.getImages ();
86
- imageset.pixel_size = project.pixelSize ;
87
- imageset.initImages (input_folder.toStdString ().c_str ());
88
-
89
- imageset.initFromDome (project.dome ); // lights after images
90
- imageset.setCrop (crop, project.offsets );
100
+ }
91
101
92
- // TODO too many crop locations!
93
- if (!crop.isNull ()) {
94
- builder->crop [0 ] = imageset.left ;
95
- builder->crop [1 ] = imageset.top ;
96
- builder->crop [2 ] = imageset.width ;
97
- builder->crop [3 ] = imageset.height ;
98
- }
102
+ void RtiTask::run () {
99
103
100
- builder-> width = imageset. width ;
101
- builder-> height = imageset. height ;
104
+ status = RUNNING;
105
+ std::function< bool (QString s, int d)> callback = [ this ](QString s, int n)-> bool { return this -> progressed (s, n); } ;
102
106
103
107
QString output = parameters.path ; // masking Task::output.
104
108
try {
0 commit comments