Skip to content

Commit

Permalink
fixed crop, deepzoom bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Jan 16, 2025
1 parent 8b58e50 commit 2021d41
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 34 deletions.
10 changes: 10 additions & 0 deletions relightlab/metadataframe.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#include "metadataframe.h"
#include "relightapp.h"

#include <QVBoxLayout>

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

}


void MetadataFrame::clear() {

}

void MetadataFrame::init() {
auto project = qRelightApp->project();
}
6 changes: 4 additions & 2 deletions relightlab/relightlab.pro
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ SOURCES += main.cpp \
normalsplan.cpp \
brdfframe.cpp \
metadataframe.cpp \
../src/fft_normal_integration.cpp
../src/fft_normal_integration.cpp \
../src/deepzoom.cpp

RESOURCES += \
res.qrc
Expand Down Expand Up @@ -201,7 +202,8 @@ HEADERS += \
brdfframe.h \
metadataframe.h \
../src/fft_normal_integration.h \
../src/pocketfft.h
../src/pocketfft.h \
../src/deepzoom.h

FORMS +=

Expand Down
4 changes: 3 additions & 1 deletion relightlab/rtiframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ void RtiFrame::init() {

void RtiFrame::exportRti() {

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

ProcessQueue &queue = ProcessQueue::instance();
queue.addTask(rti_task);
Expand Down
36 changes: 11 additions & 25 deletions relightlab/rtitask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,37 +118,23 @@ void RtiTask::run() {
if(parameters.openlime)
openlime();

if(parameters.web_layout != RtiParameters::PLAIN) {
deepZoom(output, output, parameters.quality, 0, 256, callback);
}
if(parameters.web_layout == RtiParameters::TARZOOM) {
tarZoom(output, output, callback);
}
if(parameters.web_layout == RtiParameters::ITARZOOM) {
itarZoom(output, output, callback);
}


} catch(std::string e) {
error = e.c_str();
status = STOPPED;
return;
}

/*
else if(step == "fromRTI")
fromRTI();
//TODO! deepZOOM should set error and status?
else if(step == "deepzoom") {
if ((err = deepZoom(output, output, 95, 0, 256, callback)).compare("OK") != 0) {
error = err;
status = FAILED;
}
}
else if(step == "tarzoom") {
if ((err = tarZoom(output, output, callback)).compare("OK") != 0) {
error = err;
status = FAILED;
}
}
else if(step == "itarzoom") {
if ((err = itarZoom(output, output, callback)).compare("OK") != 0) {
error = err;
status = FAILED;
}
}
else if(step == "openlime")
openlime();
} */
if(status != FAILED)
status = DONE;
}
Expand Down
16 changes: 10 additions & 6 deletions src/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,15 @@ void Project::checkImages() {

void Project::save(QString filename) {

QFile file(filename);
bool opened = file.open(QFile::WriteOnly | QFile::Truncate);
if(!opened) {
QString error = file.errorString();
throw error;
}

lastUpdated = QDateTime::currentDateTime();

QJsonObject project;
version = RELIGHT_STRINGIFY(RELIGHT_VERSION);

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


QFile file(filename);
bool opened = file.open(QFile::WriteOnly | QFile::Truncate);
if(!opened) {
QString error = file.errorString();
throw error;
}

file.write(doc.toJson());

needs_saving = false;
Expand Down

0 comments on commit 2021d41

Please sign in to comment.