inverted macro so OCIO support is enabled by default

This commit is contained in:
itsmattkc
2019-03-11 02:45:02 +11:00
parent 938224214c
commit a800904580
11 changed files with 188 additions and 162 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ extern "C" {
#include <QDesktopWidget>
#include <QDebug>
#ifdef OLIVE_OCIO
#ifndef NO_OCIO
#include <OpenColorIO/OpenColorIO.h>
namespace OCIO = OCIO_NAMESPACE;
#endif
@@ -376,7 +376,7 @@ GLuint compose_sequence(ComposeSequenceParams &params) {
fbo_switcher = !fbo_switcher;
}
#ifdef OLIVE_OCIO
#ifndef NO_OCIO
// convert to linear colorspace
if (olive::CurrentConfig.enable_color_management)
{
+2
View File
@@ -193,6 +193,7 @@ struct ComposeSequenceParams {
*/
GLuint backend_attachment2;
#ifndef NO_OCIO
/**
* @brief OpenGL shader containing OpenColorIO shader information
*/
@@ -202,6 +203,7 @@ struct ComposeSequenceParams {
* @brief OpenGL texture containing LUT obtained form OpenColorIO
*/
GLuint ocio_lut_texture;
#endif
};
/**
+9 -1
View File
@@ -26,7 +26,7 @@
#include <QFileInfo>
#include <QDebug>
#ifdef OLIVE_OCIO
#ifndef NO_OCIO
#include <OpenColorIO/OpenColorIO.h>
namespace OCIO = OCIO_NAMESPACE;
#endif
@@ -107,6 +107,7 @@ void RenderThread::run() {
blend_mode_program->link();
}
#ifndef NO_OCIO
// If there's no OpenColorIO shader, create it now
if (olive::CurrentConfig.enable_color_management
&& (ocio_shader == nullptr || ocio_loaded_config != olive::CurrentConfig.ocio_config_path)) {
@@ -114,6 +115,7 @@ void RenderThread::run() {
set_up_ocio();
}
#endif
// draw frame
paint();
@@ -153,6 +155,7 @@ const char * g_fragShaderText = ""
" gl_FragColor = OCIODisplay(col, tex2);\n"
"}\n";
#ifndef NO_OCIO
void RenderThread::set_up_ocio()
{
functions.initializeOpenGLFunctions();
@@ -254,6 +257,7 @@ void RenderThread::destroy_ocio()
delete ocio_shader;
ocio_shader = nullptr;
}
#endif
void RenderThread::paint() {
// set up compose_sequence() parameters
@@ -266,7 +270,9 @@ void RenderThread::paint() {
params.wait_for_mutexes = true;
params.playback_speed = 1;
params.blend_mode_program = blend_mode_program;
#ifndef NO_OCIO
params.ocio_shader = ocio_shader;
#endif
params.backend_buffer1 = back_buffer_1.buffer();
params.backend_buffer2 = back_buffer_2.buffer();
params.backend_attachment1 = back_buffer_1.texture();
@@ -400,7 +406,9 @@ void RenderThread::delete_ctx() {
delete_shaders();
delete_buffers();
#ifndef NO_OCIO
destroy_ocio();
#endif
}
delete ctx;
+9 -6
View File
@@ -72,9 +72,18 @@ private:
void delete_buffers();
void delete_shaders();
#ifndef NO_OCIO
// OpenColorIO functions
void set_up_ocio();
void destroy_ocio();
// OpenColorIO variables
float ocio_lut_data[OCIO_NUM_3D_ENTRIES];
GLuint ocio_lut_texture;
QOpenGLShaderProgram* ocio_shader;
QString ocio_loaded_config;
#endif
FramebufferObject front_buffer_1;
QMutex front_mutex1;
@@ -97,12 +106,6 @@ private:
FramebufferObject back_buffer_1;
FramebufferObject back_buffer_2;
// OpenColorIO variables
float ocio_lut_data[OCIO_NUM_3D_ENTRIES];
GLuint ocio_lut_texture;
QOpenGLShaderProgram* ocio_shader;
QString ocio_loaded_config;
SequencePtr seq;
int divider;
int tex_width;