diff --git a/dialogs/preferencesdialog.cpp b/dialogs/preferencesdialog.cpp index ad669341f..cd9d90baf 100644 --- a/dialogs/preferencesdialog.cpp +++ b/dialogs/preferencesdialog.cpp @@ -48,6 +48,7 @@ #include "global/config.h" #include "global/path.h" #include "rendering/audio.h" +#include "rendering/bitdepths.h" #include "panels/panels.h" #include "ui/mainwindow.h" @@ -942,6 +943,26 @@ void PreferencesDialog::setup_ui() { row++; + // COLOR MANAGEMENT -> Playback Bit Depth + QComboBox* playback_bit_depth = new QComboBox(); + for (int i=0;iaddItem(olive::rendering::bit_depths.at(i).name, i); + } + color_management_layout->addWidget(new QLabel("Playback Bit Depth:"), row, 0); + color_management_layout->addWidget(playback_bit_depth, row, 1); + + row++; + + // COLOR MANAGEMENT -> Rendering Bit Depth + QComboBox* rendering_bit_depth = new QComboBox(); + for (int i=0;iaddItem(olive::rendering::bit_depths.at(i).name, i); + } + color_management_layout->addWidget(new QLabel("Rendering Bit Depth:"), row, 0); + color_management_layout->addWidget(rendering_bit_depth, row, 1); + + row++; + #ifdef NO_OCIO enable_color_management->setEnabled(false); ocio_config_file->setEnabled(false); diff --git a/main.cpp b/main.cpp index 20c52026a..4a2e5fc4b 100644 --- a/main.cpp +++ b/main.cpp @@ -24,6 +24,7 @@ #include "global/config.h" #include "global/global.h" #include "panels/timeline.h" +#include "rendering/bitdepths.h" #include "ui/mediaiconservice.h" #include "ui/mainwindow.h" @@ -131,6 +132,9 @@ int main(int argc, char *argv[]) { // multiply track height constants by the current DPI scale olive::timeline::MultiplyTrackSizesByDPI(); + // set up rendering bit depths + olive::rendering::InitializeBitDepths(); + // connect main window's first paint to global's init finished function QObject::connect(&w, SIGNAL(finished_first_paint()), olive::Global.get(), SLOT(finished_initialize())); diff --git a/olive.pro b/olive.pro index f0f948fa0..3f04c492c 100644 --- a/olive.pro +++ b/olive.pro @@ -174,7 +174,8 @@ SOURCES += \ effects/internal/richtexteffect.cpp \ ui/blur.cpp \ ui/menu.cpp \ - rendering/qopenglshaderprogramptr.cpp + rendering/qopenglshaderprogramptr.cpp \ + rendering/bitdepths.cpp HEADERS += \ ui/mainwindow.h \ @@ -302,7 +303,8 @@ HEADERS += \ effects/internal/richtexteffect.h \ ui/blur.h \ ui/menu.h \ - rendering/qopenglshaderprogramptr.h + rendering/qopenglshaderprogramptr.h \ + rendering/bitdepths.h FORMS += diff --git a/rendering/bitdepths.cpp b/rendering/bitdepths.cpp new file mode 100644 index 000000000..b7bf217f3 --- /dev/null +++ b/rendering/bitdepths.cpp @@ -0,0 +1,51 @@ +/*** + + Olive - Non-Linear Video Editor + Copyright (C) 2019 Olive Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +***/ + +#include "bitdepths.h" + +#include + +namespace olive { +namespace rendering { + +QVector bit_depths; + +void InitializeBitDepths() { + BitDepthInfo bdi; + + bdi.name = QCoreApplication::translate("bitdepths", "8-bit"); + bdi.pixel_type = GL_UNSIGNED_BYTE; + bdi.internal_format = GL_RGBA8; + bit_depths.append(bdi); + + bdi.name = QCoreApplication::translate("bitdepths", "Half-Float (16-bit)"); + bdi.pixel_type = GL_HALF_FLOAT; + bdi.internal_format = GL_RGBA16F; + bit_depths.append(bdi); + + bdi.name = QCoreApplication::translate("bitdepths", "Full-Float (32-bit)"); + bdi.pixel_type = GL_FLOAT; + bdi.internal_format = GL_RGBA32F; + bit_depths.append(bdi); +} + +} +} + diff --git a/rendering/bitdepths.h b/rendering/bitdepths.h new file mode 100644 index 000000000..ab1b07e8a --- /dev/null +++ b/rendering/bitdepths.h @@ -0,0 +1,42 @@ +/*** + + Olive - Non-Linear Video Editor + Copyright (C) 2019 Olive Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +***/ + +#ifndef BITDEPTHS_H +#define BITDEPTHS_H + +#include +#include +#include + +namespace olive { + namespace rendering { + struct BitDepthInfo { + QString name; + GLuint pixel_type; + GLuint internal_format; + }; + + extern QVector bit_depths; + + void InitializeBitDepths(); + } +} + +#endif // BITDEPTHS_H