Skip to content

Commit 2021d41

Browse files
committed
fixed crop, deepzoom bugs
1 parent 8b58e50 commit 2021d41

File tree

5 files changed

+38
-34
lines changed

5 files changed

+38
-34
lines changed

relightlab/metadataframe.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
#include "metadataframe.h"
2+
#include "relightapp.h"
23

34
#include <QVBoxLayout>
45

56
MetadataFrame::MetadataFrame(QWidget *parent): QFrame(parent) {
67
QVBoxLayout *content = new QVBoxLayout;
78

89
}
10+
11+
12+
void MetadataFrame::clear() {
13+
14+
}
15+
16+
void MetadataFrame::init() {
17+
auto project = qRelightApp->project();
18+
}

relightlab/relightlab.pro

+4-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ SOURCES += main.cpp \
113113
normalsplan.cpp \
114114
brdfframe.cpp \
115115
metadataframe.cpp \
116-
../src/fft_normal_integration.cpp
116+
../src/fft_normal_integration.cpp \
117+
../src/deepzoom.cpp
117118

118119
RESOURCES += \
119120
res.qrc
@@ -201,7 +202,8 @@ HEADERS += \
201202
brdfframe.h \
202203
metadataframe.h \
203204
../src/fft_normal_integration.h \
204-
../src/pocketfft.h
205+
../src/pocketfft.h \
206+
../src/deepzoom.h
205207

206208
FORMS +=
207209

relightlab/rtiframe.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ void RtiFrame::init() {
104104

105105
void RtiFrame::exportRti() {
106106

107+
Project &project = qRelightApp->project();
107108
//check for lights
108-
if(qRelightApp->project().dome.directions.size() == 0) {
109+
if(project.dome.directions.size() == 0) {
109110
QMessageBox::warning(this, "Missing light directions.", "You need light directions for this dataset to build an RTI.\n"
110111
"You can either load a dome or .lp file or mark a reflective sphere in the 'Lights' tab.");
111112
return;
@@ -118,6 +119,7 @@ void RtiFrame::exportRti() {
118119
RtiTask *rti_task = new RtiTask(qRelightApp->project());
119120
rti_task->setParameters(parameters);
120121
rti_task->output = parameters.path;
122+
rti_task->crop = project.crop;
121123

122124
ProcessQueue &queue = ProcessQueue::instance();
123125
queue.addTask(rti_task);

relightlab/rtitask.cpp

+11-25
Original file line numberDiff line numberDiff line change
@@ -118,37 +118,23 @@ void RtiTask::run() {
118118
if(parameters.openlime)
119119
openlime();
120120

121+
if(parameters.web_layout != RtiParameters::PLAIN) {
122+
deepZoom(output, output, parameters.quality, 0, 256, callback);
123+
}
124+
if(parameters.web_layout == RtiParameters::TARZOOM) {
125+
tarZoom(output, output, callback);
126+
}
127+
if(parameters.web_layout == RtiParameters::ITARZOOM) {
128+
itarZoom(output, output, callback);
129+
}
130+
131+
121132
} catch(std::string e) {
122133
error = e.c_str();
123134
status = STOPPED;
124135
return;
125136
}
126137

127-
/*
128-
else if(step == "fromRTI")
129-
fromRTI();
130-
//TODO! deepZOOM should set error and status?
131-
else if(step == "deepzoom") {
132-
if ((err = deepZoom(output, output, 95, 0, 256, callback)).compare("OK") != 0) {
133-
error = err;
134-
status = FAILED;
135-
}
136-
}
137-
else if(step == "tarzoom") {
138-
if ((err = tarZoom(output, output, callback)).compare("OK") != 0) {
139-
error = err;
140-
status = FAILED;
141-
}
142-
}
143-
else if(step == "itarzoom") {
144-
if ((err = itarZoom(output, output, callback)).compare("OK") != 0) {
145-
error = err;
146-
status = FAILED;
147-
}
148-
}
149-
else if(step == "openlime")
150-
openlime();
151-
} */
152138
if(status != FAILED)
153139
status = DONE;
154140
}

src/project.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,15 @@ void Project::checkImages() {
381381

382382
void Project::save(QString filename) {
383383

384+
QFile file(filename);
385+
bool opened = file.open(QFile::WriteOnly | QFile::Truncate);
386+
if(!opened) {
387+
QString error = file.errorString();
388+
throw error;
389+
}
390+
391+
lastUpdated = QDateTime::currentDateTime();
392+
384393
QJsonObject project;
385394
version = RELIGHT_STRINGIFY(RELIGHT_VERSION);
386395

@@ -457,12 +466,7 @@ void Project::save(QString filename) {
457466
QJsonDocument doc(project);
458467

459468

460-
QFile file(filename);
461-
bool opened = file.open(QFile::WriteOnly | QFile::Truncate);
462-
if(!opened) {
463-
QString error = file.errorString();
464-
throw error;
465-
}
469+
466470
file.write(doc.toJson());
467471

468472
needs_saving = false;

0 commit comments

Comments
 (0)