Skip to content

Commit

Permalink
added labelbutton, recent rtis, changing rti export interface again.
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Apr 23, 2024
1 parent 4b7852d commit 714b5b6
Show file tree
Hide file tree
Showing 18 changed files with 399 additions and 19 deletions.
22 changes: 21 additions & 1 deletion relight/rtitask.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "task.h"
#include "../src/project.h"
#include "../src/rti.h"
#include <QMutex>

class RtiBuilder;
Expand All @@ -17,10 +18,29 @@ class RtiBuilder;
* openlime: add openlime js css, html for viewer
*/

class RtiParameters {
public:

enum Format { RTI = 0, RELIGHT = 1, DEEPZOOM = 2, TARZOOM = 3, ITARZOOM = 4, TIFF = 5};
Rti::Type basis;
Rti::ColorSpace colorspace;
int nplanes;
int nchroma;

Format format;

bool lossless = false; //used only for RTI format;

bool iiif_manifest = false; //TODO
bool openlime; //include openlime viewer //TODO: might want different interfaces.

QString path;
};

class RtiTask: public Task {
Q_OBJECT
public:
enum Steps { RELIGHT, DEEPZOOM, TARZOOM, ITARZOOM };
enum Steps { RTI, RTIJPEG, RELIGHT, DEEPZOOM, TARZOOM, ITARZOOM };
Project project;

RtiTask(const Project &_project);
Expand Down
2 changes: 2 additions & 0 deletions relightlab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ set (RELIGHT_HEADERS
markerdialog.h
domepanel.h
directionsview.h
rtiexportdialog.h
spherepanel.h
spherepicking.h
spheredialog.h
Expand Down Expand Up @@ -116,6 +117,7 @@ set (RELIGHTLAB_SOURCES
cropframe.cpp
rtiframe.cpp
rticard.cpp
rtiexportdialog.cpp
../relight/imagecropper.cpp
)

Expand Down
5 changes: 5 additions & 0 deletions relightlab/docs/formats/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
# Cache


# Defaults

Defaults will be usually overwritten when value is changed in a dialog.

Jpeg Quality (95).

Web format (deep zoom)

1 change: 1 addition & 0 deletions relightlab/helpbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public slots:
};

class QLabel;

class HelpLabel: public QWidget {
public:
HelpLabel(QString txt, QString help_id, QWidget *parent = nullptr);
Expand Down
2 changes: 2 additions & 0 deletions relightlab/qlabelbutton.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "qlabelbutton.h"

26 changes: 26 additions & 0 deletions relightlab/qlabelbutton.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef QLABELBUTTON_H
#define QLABELBUTTON_H

#include <QPushButton>
#include <QLabel>

class QLabelButton: public QPushButton {
public:
QLabelButton(QString text, QWidget *parent = nullptr): QPushButton(parent) {
init(text, QRect(10, 10, 130, 80));
}
QLabelButton(QString text, QRect rect, QWidget *parent = nullptr): QPushButton(parent) {
init(text, rect);
}
void init(QString text, QRect rect) {
setGeometry(rect);
setFixedSize(150, 100);
label = new QLabel(this);
label->setGeometry(rect);
label->setText(text);
}
private:
QLabel *label = nullptr;
};

#endif // QLABELBUTTON_H
3 changes: 0 additions & 3 deletions relightlab/recentprojects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include <QList>
#include "recentprojects.h"



QStringList recentProjects() {
return QSettings().value("recent-projects", QStringList()).toStringList();
}
Expand All @@ -25,4 +23,3 @@ void clearRecentProjects() {
}



3 changes: 0 additions & 3 deletions relightlab/recentprojects.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
#define RECENTPROJECTS_H

#include <QStringList>
#include <vector>


QStringList recentProjects();
void addRecentProject(const QString &filename);
void clearRecentProjects();


#endif // RECENTPROJECTS_H
6 changes: 6 additions & 0 deletions relightlab/relightlab.pro
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ SOURCES += main.cpp \
mainwindow.cpp \
markerdialog.cpp \
preferences.cpp \
qlabelbutton.cpp \
recentprojects.cpp \
reflectionview.cpp \
relightapp.cpp \
rticard.cpp \
rtiframe.cpp \
rtiplan.cpp \
rtirecents.cpp \
rtirow.cpp \
spherepicking.cpp \
sphererow.cpp \
Expand Down Expand Up @@ -111,11 +114,14 @@ HEADERS += \
mainwindow.h \
markerdialog.h \
preferences.h \
qlabelbutton.h \
recentprojects.h \
reflectionview.h \
relightapp.h \
rticard.h \
rtiframe.h \
rtiplan.h \
rtirecents.h \
rtirow.h \
spherepicking.h \
sphererow.h \
Expand Down
9 changes: 6 additions & 3 deletions relightlab/rticard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ RtiCard::RtiCard(Rti::Type _type, Rti::ColorSpace _colorspace, int _nplanes, int



connect(create, &QPushButton::clicked, [&]() {
RtiExportDialog
})
connect(create, SIGNAL(clicked()), this, SLOT(rtiExport()));

setFrameStyle(QFrame::StyledPanel);
setAutoFillBackground(true);
Expand Down Expand Up @@ -111,6 +109,11 @@ void RtiCard::updateTitle() {
title_label->label->setText(title);
}

void RtiCard::rtiExport() {
RtiExportDialog *dialog = new RtiExportDialog(this);
dialog->exec();
}

void RtiCard::mousePressEvent(QMouseEvent *event) {
if(checkable) {
setChecked(!checked);
Expand Down
2 changes: 1 addition & 1 deletion relightlab/rticard.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class RtiCard: public QFrame {
public slots:
void setChecked(bool);
void updateTitle();

void rtiExport();
signals:
void toggled(bool checked);

Expand Down
22 changes: 15 additions & 7 deletions relightlab/rtiexportdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "rtiexportdialog.h"
#include "helpbutton.h"

#include <QVBoxLayout>
#include <QHBoxLayout>
Expand All @@ -18,11 +19,11 @@ RtiExportDialog::RtiExportDialog(QWidget *parent): QDialog(parent) {
QGroupBox *format = new QGroupBox("Format");
content->addWidget(format);
QVBoxLayout *format_layout = new QVBoxLayout(format);
format_layout->addWidget(new QRadioButton("Plain images"));
format_layout->addWidget(new QRadioButton("Deepzoom"));
format_layout->addWidget(new QRadioButton("Tarzoom"));
format_layout->addWidget(new QRadioButton("Interleaved Tarzoom"));
format_layout->addWidget(new HelpRadio("Plain images", "format/relight"));
format_layout->addWidget(new HelpRadio("Deepzoom", "format/deepzoom"));
format_layout->addWidget(new HelpRadio("Tarzoom", "format/tarzoom"));
format_layout->addWidget(new HelpRadio("Interleaved Tarzoom", "format/itarzoom"));

QHBoxLayout *quality_box = new QHBoxLayout;
content->addLayout(quality_box);
quality_box->addWidget(new QLabel("Jpeg quality"));
Expand All @@ -43,6 +44,13 @@ RtiExportDialog::RtiExportDialog(QWidget *parent): QDialog(parent) {
buttons->addStretch();
buttons->addWidget(new QPushButton("Create"));
buttons->addWidget(new QPushButton("Cancel"));

//seupt connections
//connect(buttons->itemAt(1)->widget(), &QPushButton::clicked, this, &RtiExportDialog::accept);
//connect(buttons->itemAt(2)->widget(), &QPushButton::clicked, this, &RtiExportDialog::reject);

//init values from settings
//int quality = QSettings().value("rti/defaults/quality", 95).toInt();
}

LegacyExportDialog::LegacyExportDialog(QWidget *parent): QDialog(parent) {
Expand All @@ -51,8 +59,8 @@ LegacyExportDialog::LegacyExportDialog(QWidget *parent): QDialog(parent) {

QVBoxLayout *content = new QVBoxLayout(this);

content->addWidget(new QRadioButton("Uncompressed"));
content->addWidget(new QRadioButton("JPEG"));
content->addWidget(new HelpRadio("Uncompressed", "format/compression"));
content->addWidget(new HelpRadio("JPEG", "format/compressiob"));

QHBoxLayout *quality_box = new QHBoxLayout;
content->addLayout(quality_box);
Expand Down
12 changes: 11 additions & 1 deletion relightlab/rtiframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
#include "relightapp.h"
#include "rticard.h"
#include "flowlayout.h"
#include "rtiplan.h"
#include "rtirow.h"
#include "rtirecents.h"
#include "qlabelbutton.h"

#include <QVBoxLayout>
#include <QHBoxLayout>
Expand All @@ -16,12 +19,19 @@
#include <QLabel>
#include <QScrollArea>



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

content->addWidget(new QLabel("<h2>Relightable images</h2>"));
content->addWidget(new QLabel("<h2>Build relightable images</h2>"));
content->addSpacing(20);

content->addWidget(recents = new RtiRecents);

content->addWidget(new RtiPlan, 1);
return;

/* content->addWidget(new PtmRow());
content->addWidget(new HshRow());
content->addWidget(new RbfRow()); */
Expand Down
2 changes: 2 additions & 0 deletions relightlab/rtiframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "../src/rti.h"

class RtiCard;
class RtiRecents;

class RtiFrame: public QFrame {
Q_OBJECT
Expand All @@ -20,6 +21,7 @@ public slots:
Rti::Type current_basis;
Rti::ColorSpace current_colorspace;
RtiCard *basis_cards[4];
RtiRecents *recents;
};

#endif // RTIFRAME_H
Loading

0 comments on commit 714b5b6

Please sign in to comment.