added settings for bit depth

This commit is contained in:
itsmattkc
2019-03-20 16:05:10 +11:00
parent 9b2b7bc949
commit 9c920cfcc3
5 changed files with 122 additions and 2 deletions
+21
View File
@@ -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;i<olive::rendering::bit_depths.size();i++) {
playback_bit_depth->addItem(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;i<olive::rendering::bit_depths.size();i++) {
rendering_bit_depth->addItem(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);
+4
View File
@@ -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()));
+4 -2
View File
@@ -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 +=
+51
View File
@@ -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 <http://www.gnu.org/licenses/>.
***/
#include "bitdepths.h"
#include <QCoreApplication>
namespace olive {
namespace rendering {
QVector<BitDepthInfo> 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);
}
}
}
+42
View File
@@ -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 <http://www.gnu.org/licenses/>.
***/
#ifndef BITDEPTHS_H
#define BITDEPTHS_H
#include <QString>
#include <QVector>
#include <QOpenGLExtraFunctions>
namespace olive {
namespace rendering {
struct BitDepthInfo {
QString name;
GLuint pixel_type;
GLuint internal_format;
};
extern QVector<BitDepthInfo> bit_depths;
void InitializeBitDepths();
}
}
#endif // BITDEPTHS_H