forked from bartvdbraak/blender
Commit current patch needed for color pipeline investigation in Mango Project
This commit simply adds view transform option for image editor. This transform is being applied on original linear color when float buffer is being converted into sRGB byte buffer. Currently supports such transformations: - ACES ODT ToneCurve transform which shall preserve color ranges on such a conversion. - OCIO Raw, Log and RRT view transforms This commit also contains integration of OCIO backends to Blender, so now there's c-api and configuration file. Most of things were got from branch where Xavier Thomas and Lukas Toene were working. NOTE: This is just for testing our pipeline, please do not bother me with messages it's done wrong. It is done correct to support our own pipeline for now, and real design would be created later when current stoppers for the project are gone.
This commit is contained in:
parent
05153fb08d
commit
471627ba96
@ -130,6 +130,7 @@ option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effect
|
||||
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
option(WITH_PLAYER "Build Player" OFF)
|
||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON)
|
||||
|
||||
# GHOST Windowing Library Options
|
||||
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
|
||||
@ -665,6 +666,24 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
# use lib dir if available and nothing else specified
|
||||
if(LIBDIR AND NOT OPENCOLORIO_ROOT_DIR)
|
||||
set(OPENCOLORIO_ROOT_DIR ${LIBDIR}/ocio)
|
||||
endif()
|
||||
|
||||
find_package(OpenColorIO)
|
||||
|
||||
set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES})
|
||||
set(OPENCOLORIO_LIBPATH) # TODO, remove and reference the absolute path everywhere
|
||||
set(OPENCOLORIO_DEFINITIONS)
|
||||
|
||||
if(NOT OPENCOLORIO_FOUND)
|
||||
set(WITH_OPENCOLORIO OFF)
|
||||
message(STATUS "OpenColorIO not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
|
||||
set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
|
||||
|
||||
@ -1011,6 +1030,14 @@ elseif(WIN32)
|
||||
set(OPENIMAGEIO_DEFINITIONS)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
set(OPENCOLORIO ${LIBDIR}/opencolorio)
|
||||
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
|
||||
set(OPENCOLORIO_LIBRARIES OpenColorIO)
|
||||
set_lib_path(OPENCOLORIO_LIBPATH "opencolorio/lib")
|
||||
set(OPENCOLORIO_DEFINITIONS)
|
||||
endif()
|
||||
|
||||
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
|
||||
|
||||
# MSVC only, Mingw doesnt need
|
||||
@ -1180,6 +1207,14 @@ elseif(WIN32)
|
||||
set(OPENIMAGEIO_DEFINITIONS)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
set(OPENCOLORIO ${LIBDIR}/opencolorio)
|
||||
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
|
||||
set(OPENCOLORIO_LIBRARIES OpenColorIO)
|
||||
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
|
||||
set(OPENCOLORIO_DEFINITIONS)
|
||||
endif()
|
||||
|
||||
set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
|
||||
|
||||
## DISABLE - causes linking errors
|
||||
@ -1426,6 +1461,14 @@ elseif(APPLE)
|
||||
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
set(OPENCOLORIO ${LIBDIR}/opencolorio)
|
||||
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
|
||||
set(OPENCOLORIO_LIBRARIES OpenColorIO)
|
||||
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
|
||||
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
|
||||
endif()
|
||||
|
||||
set(EXETYPE MACOSX_BUNDLE)
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
||||
|
11
SConstruct
11
SConstruct
@ -609,6 +609,14 @@ if env['OURPLATFORM']!='darwin':
|
||||
cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch)
|
||||
scriptinstall.append(env.Install(dir=dir,source=cubin_file))
|
||||
|
||||
if env['WITH_BF_OCIO']:
|
||||
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'datafiles', 'colormanagement')
|
||||
source=os.listdir('release/datafiles/colormanagement')
|
||||
if '.svn' in source: source.remove('.svn')
|
||||
if '_svn' in source: source.remove('_svn')
|
||||
source=['release/datafiles/colormanagement/'+s for s in source]
|
||||
scriptinstall.append(env.Install(dir=dir,source=source))
|
||||
|
||||
if env['WITH_BF_INTERNATIONAL']:
|
||||
internationalpaths=['release' + os.sep + 'datafiles']
|
||||
|
||||
@ -741,6 +749,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
if env['WITH_BF_OIIO'] and env['OURPLATFORM'] != 'win32-mingw':
|
||||
dllsources.append('${LCGDIR}/openimageio/bin/OpenImageIO.dll')
|
||||
|
||||
if env['WITH_BF_OCIO'] and env['OURPLATFORM'] != 'win32-mingw':
|
||||
dllsources.append('${LCGDIR}/opencolorio/bin/OpenColorIO.dll')
|
||||
|
||||
dllsources.append('#source/icons/blender.exe.manifest')
|
||||
|
||||
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
|
||||
|
71
build_files/cmake/Modules/FindOpenColorIO.cmake
Normal file
71
build_files/cmake/Modules/FindOpenColorIO.cmake
Normal file
@ -0,0 +1,71 @@
|
||||
# - Find OpenColorIO library
|
||||
# Find the native OpenColorIO includes and library
|
||||
# This module defines
|
||||
# OPENCOLORIO_INCLUDE_DIRS, where to find OpenColorIO.h, Set when
|
||||
# OPENCOLORIO_INCLUDE_DIR is found.
|
||||
# OPENCOLORIO_LIBRARIES, libraries to link against to use OpenColorIO.
|
||||
# OPENCOLORIO_ROOT_DIR, The base directory to search for OpenColorIO.
|
||||
# This can also be an environment variable.
|
||||
# OPENCOLORIO_FOUND, If false, do not try to use OpenColorIO.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# OPENCOLORIO_LIBRARY, where to find the OpenColorIO library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2012 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If OPENCOLORIO_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT OPENCOLORIO_ROOT_DIR AND NOT $ENV{OPENCOLORIO_ROOT_DIR} STREQUAL "")
|
||||
SET(OPENCOLORIO_ROOT_DIR $ENV{OPENCOLORIO_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_opencolorio_SEARCH_DIRS
|
||||
${OPENCOLORIO_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(OPENCOLORIO_INCLUDE_DIR
|
||||
NAMES
|
||||
OpenColorIO/OpenColorIO.h
|
||||
HINTS
|
||||
${_opencolorio_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(OPENCOLORIO_LIBRARY
|
||||
NAMES
|
||||
OCIO OpenColorIO
|
||||
HINTS
|
||||
${_opencolorio_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenColorIO DEFAULT_MSG
|
||||
OPENCOLORIO_LIBRARY OPENCOLORIO_INCLUDE_DIR)
|
||||
|
||||
IF(OPENCOLORIO_FOUND)
|
||||
SET(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARY})
|
||||
SET(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_INCLUDE_DIR})
|
||||
ENDIF(OPENCOLORIO_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENCOLORIO_INCLUDE_DIR
|
||||
OPENCOLORIO_LIBRARY
|
||||
)
|
||||
|
@ -193,6 +193,9 @@ macro(SETUP_LIBDIRS)
|
||||
if(WITH_OPENIMAGEIO)
|
||||
link_directories(${OPENIMAGEIO_LIBPATH})
|
||||
endif()
|
||||
if(WITH_OPENCOLORIO)
|
||||
link_directories(${OPENCOLORIO_LIBPATH})
|
||||
endif()
|
||||
if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
|
||||
link_directories(${OPENJPEG_LIBPATH})
|
||||
endif()
|
||||
@ -289,6 +292,9 @@ macro(setup_liblinks
|
||||
if(WITH_OPENIMAGEIO)
|
||||
target_link_libraries(${target} ${OPENIMAGEIO_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_OPENCOLORIO)
|
||||
target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_BOOST)
|
||||
target_link_libraries(${target} ${BOOST_LIBRARIES})
|
||||
endif()
|
||||
|
@ -277,6 +277,12 @@ BF_OIIO_INC = BF_OIIO + '/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = BF_OIIO + '/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = LIBDIR + '/opencolorio'
|
||||
BF_OCIO_INC = BF_OCIO + '/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO'
|
||||
BF_OCIO_LIBPATH = BF_OCIO + '/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
BF_BOOST_INC = BF_BOOST + '/include'
|
||||
|
@ -210,6 +210,16 @@ BF_OIIO_INC = BF_OIIO + '/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = BF_OIIO + '/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
WITH_BF_STATICOCIO = False
|
||||
BF_OCIO = LIBDIR + '/ocio'
|
||||
if not os.path.exists(LCGDIR + '/ocio'):
|
||||
WITH_BF_OCIO = False
|
||||
BF_OCIO = '/usr'
|
||||
BF_OCIO_INC = BF_OCIO + '/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO yaml-cpp tinyxml'
|
||||
BF_OCIO_LIBPATH = BF_OCIO + '/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
WITH_BF_STATICBOOST = False
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
|
@ -159,6 +159,12 @@ BF_OIIO_INC = BF_OIIO + '/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = BF_OIIO + '/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = LIBDIR + '/opencolorio'
|
||||
BF_OCIO_INC = BF_OCIO + '/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO'
|
||||
BF_OCIO_LIBPATH = BF_OCIO + '/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
BF_BOOST_INC = BF_BOOST + '/include'
|
||||
|
@ -156,6 +156,12 @@ BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = '${LIBDIR}/opencolorio'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = '${LIBDIR}/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
|
@ -159,6 +159,12 @@ BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = LIBDIR + '/opencolorio'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
BF_BOOST_INC = BF_BOOST + '/include'
|
||||
|
@ -153,6 +153,13 @@ BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = '${LIBDIR}/opencolorio'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = '${LIBDIR}/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
|
@ -200,6 +200,11 @@ def setup_staticlibs(lenv):
|
||||
if lenv['WITH_BF_STATICOIIO']:
|
||||
statlibs += Split(lenv['BF_OIIO_LIB_STATIC'])
|
||||
|
||||
if lenv['WITH_BF_OCIO']:
|
||||
libincs += Split(lenv['BF_OCIO_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICOCIO']:
|
||||
statlibs += Split(lenv['BF_OCIO_LIB_STATIC'])
|
||||
|
||||
if lenv['WITH_BF_BOOST']:
|
||||
libincs += Split(lenv['BF_BOOST_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICBOOST']:
|
||||
@ -248,6 +253,10 @@ def setup_syslibs(lenv):
|
||||
if not lenv['WITH_BF_STATICOIIO']:
|
||||
syslibs += Split(lenv['BF_OIIO_LIB'])
|
||||
|
||||
if lenv['WITH_BF_OCIO']:
|
||||
if not lenv['WITH_BF_STATICOCIO']:
|
||||
syslibs += Split(lenv['BF_OCIO_LIB'])
|
||||
|
||||
if lenv['WITH_BF_OPENEXR'] and not lenv['WITH_BF_STATICOPENEXR']:
|
||||
syslibs += Split(lenv['BF_OPENEXR_LIB'])
|
||||
if lenv['WITH_BF_TIFF'] and not lenv['WITH_BF_STATICTIFF']:
|
||||
|
@ -162,6 +162,7 @@ def validate_arguments(args, bc):
|
||||
'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
|
||||
'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE',
|
||||
'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
|
||||
'WITH_BF_OCIO', 'WITH_BF_STATICOCIO', 'BF_OCIO', 'BF_OCIO_INC', 'BF_OCIO_LIB', 'BF_OCIO_LIB_STATIC', 'BF_OCIO_LIBPATH',
|
||||
'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
|
||||
'WITH_BF_LIBMV', 'WITH_BF_CARVE'
|
||||
]
|
||||
@ -566,6 +567,14 @@ def read_opts(env, cfg, args):
|
||||
('BF_OIIO_LIBPATH', 'OIIO library path', ''),
|
||||
('BF_OIIO_LIB_STATIC', 'OIIO static library', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OCIO', 'Build with OpenColorIO', False)),
|
||||
(BoolVariable('WITH_BF_STATICOCIO', 'Staticly link to OpenColorIO', False)),
|
||||
('BF_OCIO', 'OCIO root path', ''),
|
||||
('BF_OCIO_INC', 'OCIO include path', ''),
|
||||
('BF_OCIO_LIB', 'OCIO library', ''),
|
||||
('BF_OCIO_LIBPATH', 'OCIO library path', ''),
|
||||
('BF_OCIO_LIB_STATIC', 'OCIO static library', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_BOOST', 'Build with Boost', False)),
|
||||
(BoolVariable('WITH_BF_STATICBOOST', 'Staticly link to boost', False)),
|
||||
('BF_BOOST', 'Boost root path', ''),
|
||||
|
@ -71,3 +71,7 @@ endif()
|
||||
if(WIN32)
|
||||
add_subdirectory(utfconv)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
add_subdirectory(opencolorio)
|
||||
endif()
|
||||
|
@ -30,3 +30,6 @@ SConscript(['bsp/SConscript'])
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'):
|
||||
SConscript(['utfconv/SConscript'])
|
||||
|
||||
if env['WITH_BF_OCIO']:
|
||||
SConscript(['opencolorio/SConscript'])
|
||||
|
43
intern/opencolorio/CMakeLists.txt
Normal file
43
intern/opencolorio/CMakeLists.txt
Normal file
@ -0,0 +1,43 @@
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# 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 2
|
||||
# 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2012, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Sergey Sharybin.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(INC
|
||||
.
|
||||
${OPENCOLORIO_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
ocio_capi.cpp
|
||||
ocio_capi.h
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_opencolorio "${SRC}" "${INC}" "${INC_SYS}")
|
10
intern/opencolorio/SConscript
Normal file
10
intern/opencolorio/SConscript
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
Import('env')
|
||||
|
||||
sources = env.Glob('*.cpp')
|
||||
|
||||
incs = '.'
|
||||
incs += ' ' + env['BF_OCIO_INC']
|
||||
|
||||
env.BlenderLib( 'bf_intern_opencolorio', sources, Split(incs), [], libtype=['extern','player'], priority=[10, 185])
|
394
intern/opencolorio/ocio_capi.cpp
Normal file
394
intern/opencolorio/ocio_capi.cpp
Normal file
@ -0,0 +1,394 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* 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 2
|
||||
* 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, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2012 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Xavier Thomas
|
||||
* Lukas Toene
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <OpenColorIO/OpenColorIO.h>
|
||||
|
||||
|
||||
#define OCIO_CAPI_IMPLEMENTATION
|
||||
#include "ocio_capi.h"
|
||||
|
||||
ConstConfigRcPtr* OCIO_getCurrentConfig(void)
|
||||
{
|
||||
ConstConfigRcPtr* config = new ConstConfigRcPtr();
|
||||
try
|
||||
{
|
||||
*config = GetCurrentConfig();
|
||||
if(*config)
|
||||
return config;
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OCIO_setCurrentConfig(const ConstConfigRcPtr* config)
|
||||
{
|
||||
if(config)
|
||||
{
|
||||
try
|
||||
{
|
||||
SetCurrentConfig(*config);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConstConfigRcPtr* OCIO_configCreateFromEnv(void)
|
||||
{
|
||||
ConstConfigRcPtr* config = new ConstConfigRcPtr();
|
||||
try
|
||||
{
|
||||
*config = Config::CreateFromEnv();
|
||||
if(*config)
|
||||
return config;
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ConstConfigRcPtr* OCIO_configCreateFromFile(const char* filename)
|
||||
{
|
||||
ConstConfigRcPtr* config = new ConstConfigRcPtr();
|
||||
try
|
||||
{
|
||||
*config = Config::CreateFromFile(filename);
|
||||
if(*config)
|
||||
return config;
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OCIO_configRelease(ConstConfigRcPtr* config)
|
||||
{
|
||||
if(config){
|
||||
delete config;
|
||||
config =0;
|
||||
}
|
||||
}
|
||||
|
||||
int OCIO_configGetNumColorSpaces(ConstConfigRcPtr* config)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getNumColorSpaces();
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* OCIO_configGetColorSpaceNameByIndex(ConstConfigRcPtr* config, int index)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getColorSpaceNameByIndex(index);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ConstColorSpaceRcPtr* OCIO_configGetColorSpace(ConstConfigRcPtr* config, const char* name)
|
||||
{
|
||||
ConstColorSpaceRcPtr* cs = new ConstColorSpaceRcPtr();
|
||||
try
|
||||
{
|
||||
*cs = (*config)->getColorSpace(name);
|
||||
if(*cs)
|
||||
return cs;
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
delete cs;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int OCIO_configGetIndexForColorSpace(ConstConfigRcPtr* config, const char* name)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getIndexForColorSpace(name);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char* OCIO_configGetDefaultDisplay(ConstConfigRcPtr* config)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getDefaultDisplay();
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int OCIO_configGetNumDisplays(ConstConfigRcPtr* config)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getNumDisplays();
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* OCIO_configGetDisplay(ConstConfigRcPtr* config, int index)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getDisplay(index);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* OCIO_configGetDefaultView(ConstConfigRcPtr* config, const char* display)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getDefaultView(display);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int OCIO_configGetNumViews(ConstConfigRcPtr* config, const char* display)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getNumViews(display);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* OCIO_configGetView(ConstConfigRcPtr* config, const char* display, int index)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getView(display, index);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* OCIO_configGetDisplayColorSpaceName(ConstConfigRcPtr* config, const char* display, const char* view)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (*config)->getDisplayColorSpaceName(display, view);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void OCIO_colorSpaceRelease(ConstColorSpaceRcPtr* cs)
|
||||
{
|
||||
if(cs){
|
||||
delete cs;
|
||||
cs =0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ConstProcessorRcPtr* OCIO_configGetProcessorWithNames(ConstConfigRcPtr* config, const char* srcName, const char* dstName)
|
||||
{
|
||||
ConstProcessorRcPtr* p = new ConstProcessorRcPtr();
|
||||
try
|
||||
{
|
||||
*p = (*config)->getProcessor(srcName, dstName);
|
||||
if(*p)
|
||||
return p;
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern ConstProcessorRcPtr* OCIO_configGetProcessor(ConstConfigRcPtr* config, ConstTransformRcPtr* transform)
|
||||
{
|
||||
ConstProcessorRcPtr* p = new ConstProcessorRcPtr();
|
||||
try
|
||||
{
|
||||
*p = (*config)->getProcessor(*transform);
|
||||
if(*p)
|
||||
return p;
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OCIO_processorApply(ConstProcessorRcPtr* processor, PackedImageDesc* img)
|
||||
{
|
||||
try
|
||||
{
|
||||
(*processor)->apply(*img);
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void OCIO_processorApplyRGB(ConstProcessorRcPtr* processor, float* pixel)
|
||||
{
|
||||
(*processor)->applyRGB(pixel);
|
||||
}
|
||||
|
||||
void OCIO_processorApplyRGBA(ConstProcessorRcPtr* processor, float* pixel)
|
||||
{
|
||||
(*processor)->applyRGBA(pixel);
|
||||
}
|
||||
|
||||
void OCIO_processorRelease(ConstProcessorRcPtr* p)
|
||||
{
|
||||
if(p){
|
||||
delete p;
|
||||
p = 0;
|
||||
}
|
||||
}
|
||||
|
||||
const char* OCIO_colorSpaceGetName(ConstColorSpaceRcPtr* cs)
|
||||
{
|
||||
return (*cs)->getName();
|
||||
}
|
||||
|
||||
const char* OCIO_colorSpaceGetFamily(ConstColorSpaceRcPtr* cs)
|
||||
{
|
||||
return (*cs)->getFamily();
|
||||
}
|
||||
|
||||
|
||||
extern DisplayTransformRcPtr* OCIO_createDisplayTransform(void)
|
||||
{
|
||||
DisplayTransformRcPtr* dt = new DisplayTransformRcPtr();
|
||||
*dt = DisplayTransform::Create();
|
||||
return dt;
|
||||
}
|
||||
|
||||
extern void OCIO_displayTransformSetInputColorSpaceName(DisplayTransformRcPtr* dt, const char * name)
|
||||
{
|
||||
(*dt)->setInputColorSpaceName(name);
|
||||
}
|
||||
|
||||
extern void OCIO_displayTransformSetDisplay(DisplayTransformRcPtr* dt, const char * name)
|
||||
{
|
||||
(*dt)->setDisplay(name);
|
||||
}
|
||||
|
||||
extern void OCIO_displayTransformSetView(DisplayTransformRcPtr* dt, const char * name)
|
||||
{
|
||||
(*dt)->setView(name);
|
||||
}
|
||||
|
||||
extern void OCIO_displayTransformRelease(DisplayTransformRcPtr* dt)
|
||||
{
|
||||
if(dt){
|
||||
delete dt;
|
||||
dt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
PackedImageDesc* OCIO_createPackedImageDesc(float * data, long width, long height, long numChannels,
|
||||
long chanStrideBytes, long xStrideBytes, long yStrideBytes)
|
||||
{
|
||||
try
|
||||
{
|
||||
PackedImageDesc* id = new PackedImageDesc(data, width, height, numChannels, chanStrideBytes, xStrideBytes, yStrideBytes);
|
||||
return id;
|
||||
}
|
||||
catch(Exception & exception)
|
||||
{
|
||||
std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OCIO_packedImageDescRelease(PackedImageDesc* id)
|
||||
{
|
||||
if(id){
|
||||
delete id;
|
||||
id = 0;
|
||||
}
|
||||
}
|
||||
|
106
intern/opencolorio/ocio_capi.h
Normal file
106
intern/opencolorio/ocio_capi.h
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* 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 2
|
||||
* 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, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2012 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Xavier Thomas
|
||||
* Lukas Toene
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef OCIO_CAPI_H
|
||||
#define OCIO_CAPI_H
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
using namespace OCIO_NAMESPACE;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OCIO_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
|
||||
|
||||
|
||||
#ifndef OCIO_CAPI_IMPLEMENTATION
|
||||
#define OCIO_ROLE_SCENE_LINEAR "scene_linear"
|
||||
#define OCIO_ROLE_COLOR_PICKING "color_picking"
|
||||
#define OCIO_ROLE_TEXTURE_PAINT "texture_paint"
|
||||
|
||||
OCIO_DECLARE_HANDLE(ConstConfigRcPtr);
|
||||
OCIO_DECLARE_HANDLE(ConstColorSpaceRcPtr);
|
||||
OCIO_DECLARE_HANDLE(ConstProcessorRcPtr);
|
||||
OCIO_DECLARE_HANDLE(ConstContextRcPtr);
|
||||
OCIO_DECLARE_HANDLE(PackedImageDesc);
|
||||
OCIO_DECLARE_HANDLE(DisplayTransformRcPtr);
|
||||
OCIO_DECLARE_HANDLE(ConstTransformRcPtr);
|
||||
#endif
|
||||
|
||||
|
||||
extern ConstConfigRcPtr* OCIO_getCurrentConfig(void);
|
||||
extern void OCIO_setCurrentConfig(const ConstConfigRcPtr* config);
|
||||
|
||||
extern ConstConfigRcPtr* OCIO_configCreateFromEnv(void);
|
||||
extern ConstConfigRcPtr* OCIO_configCreateFromFile(const char* filename);
|
||||
|
||||
extern void OCIO_configRelease(ConstConfigRcPtr* config);
|
||||
|
||||
extern int OCIO_configGetNumColorSpaces(ConstConfigRcPtr* config);
|
||||
extern const char* OCIO_configGetColorSpaceNameByIndex(ConstConfigRcPtr* config, int index);
|
||||
extern ConstColorSpaceRcPtr* OCIO_configGetColorSpace(ConstConfigRcPtr* config, const char* name);
|
||||
extern int OCIO_configGetIndexForColorSpace(ConstConfigRcPtr* config, const char* name);
|
||||
|
||||
extern void OCIO_colorSpaceRelease(ConstColorSpaceRcPtr* cs);
|
||||
|
||||
extern const char* OCIO_configGetDefaultDisplay(ConstConfigRcPtr* config);
|
||||
extern int OCIO_configGetNumDisplays(ConstConfigRcPtr* config);
|
||||
extern const char* OCIO_configGetDisplay(ConstConfigRcPtr* config, int index);
|
||||
extern const char* OCIO_configGetDefaultView(ConstConfigRcPtr* config, const char* display);
|
||||
extern int OCIO_configGetNumViews(ConstConfigRcPtr* config, const char* display);
|
||||
extern const char* OCIO_configGetView(ConstConfigRcPtr* config, const char* display, int index);
|
||||
extern const char* OCIO_configGetDisplayColorSpaceName(ConstConfigRcPtr* config, const char* display, const char* view);
|
||||
|
||||
extern ConstProcessorRcPtr* OCIO_configGetProcessorWithNames(ConstConfigRcPtr* config, const char* srcName, const char* dstName);
|
||||
extern ConstProcessorRcPtr* OCIO_configGetProcessor(ConstConfigRcPtr* config, ConstTransformRcPtr* transform);
|
||||
|
||||
extern void OCIO_processorApply(ConstProcessorRcPtr* processor, PackedImageDesc* img);
|
||||
extern void OCIO_processorApplyRGB(ConstProcessorRcPtr* processor, float* pixel);
|
||||
extern void OCIO_processorApplyRGBA(ConstProcessorRcPtr* processor, float* pixel);
|
||||
|
||||
extern void OCIO_processorRelease(ConstProcessorRcPtr* p);
|
||||
|
||||
|
||||
extern const char* OCIO_colorSpaceGetName(ConstColorSpaceRcPtr* cs);
|
||||
extern const char* OCIO_colorSpaceGetFamily(ConstColorSpaceRcPtr* cs);
|
||||
|
||||
extern DisplayTransformRcPtr* OCIO_createDisplayTransform(void);
|
||||
extern void OCIO_displayTransformSetInputColorSpaceName(DisplayTransformRcPtr* dt, const char * name);
|
||||
extern void OCIO_displayTransformSetDisplay(DisplayTransformRcPtr* dt, const char * name);
|
||||
extern void OCIO_displayTransformSetView(DisplayTransformRcPtr* dt, const char * name);
|
||||
extern void OCIO_displayTransformRelease(DisplayTransformRcPtr* dt);
|
||||
|
||||
PackedImageDesc* OCIO_createPackedImageDesc(float * data, long width, long height, long numChannels,
|
||||
long chanStrideBytes, long xStrideBytes, long yStrideBytes);
|
||||
|
||||
extern void OCIO_packedImageDescRelease(PackedImageDesc* p);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //OCIO_CAPI_H
|
238
release/datafiles/colormanagement/config.ocio
Normal file
238
release/datafiles/colormanagement/config.ocio
Normal file
@ -0,0 +1,238 @@
|
||||
ocio_profile_version: 1
|
||||
|
||||
search_path: luts
|
||||
strictparsing: true
|
||||
luma: [0.2126, 0.7152, 0.0722]
|
||||
|
||||
description: RRT version ut33
|
||||
|
||||
roles:
|
||||
color_picking: raw
|
||||
color_timing: adx10
|
||||
compositing_log: adx10
|
||||
data: raw
|
||||
default: raw
|
||||
matte_paint: raw
|
||||
reference: aces
|
||||
scene_linear: aces
|
||||
texture_paint: raw
|
||||
|
||||
displays:
|
||||
p3dci:
|
||||
- !<View> {name: Raw, colorspace: raw}
|
||||
- !<View> {name: Log, colorspace: adx10}
|
||||
- !<View> {name: RRT, colorspace: rrt_p3dci}
|
||||
sRGB:
|
||||
- !<View> {name: Raw, colorspace: raw}
|
||||
- !<View> {name: Log, colorspace: adx10}
|
||||
- !<View> {name: RRT, colorspace: rrt_srgb}
|
||||
xyz:
|
||||
- !<View> {name: Raw, colorspace: raw}
|
||||
- !<View> {name: Log, colorspace: adx10}
|
||||
- !<View> {name: RRT, colorspace: rrt_xyz}
|
||||
|
||||
active_displays: [sRGB, p3dci, xyz]
|
||||
active_views: [RRT, Log, Raw]
|
||||
|
||||
colorspaces:
|
||||
- !<ColorSpace>
|
||||
name: aces
|
||||
family: aces
|
||||
equalitygroup:
|
||||
bitdepth: 32f
|
||||
isdata: false
|
||||
allocation: lg2
|
||||
allocationvars: [-8.5, 5]
|
||||
|
||||
- !<ColorSpace>
|
||||
name: raw
|
||||
family: raw
|
||||
equalitygroup:
|
||||
bitdepth: 32f
|
||||
isdata: true
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
|
||||
- !<ColorSpace>
|
||||
name: adx10
|
||||
family: adx
|
||||
equalitygroup:
|
||||
bitdepth: 10ui
|
||||
description: |
|
||||
Film Scan, using the 10-bit Academy Density Encoding
|
||||
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
to_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<FileTransform> {src: adx_adx10_to_cdd.spimtx}
|
||||
- !<FileTransform> {src: adx_cdd_to_cid.spimtx}
|
||||
- !<FileTransform> {src: adx_cid_to_rle.spi1d, interpolation: linear}
|
||||
- !<LogTransform> {base: 10, direction: inverse}
|
||||
- !<FileTransform> {src: adx_exp_to_aces.spimtx}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: adx16
|
||||
family: adx
|
||||
equalitygroup:
|
||||
bitdepth: 16ui
|
||||
description: |
|
||||
Film Scan, using the 16-bit Academy Density Encoding
|
||||
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
to_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<FileTransform> {src: adx_adx16_to_cdd.spimtx}
|
||||
- !<FileTransform> {src: adx_cdd_to_cid.spimtx}
|
||||
- !<FileTransform> {src: adx_cid_to_rle.spi1d, interpolation: linear}
|
||||
- !<LogTransform> {base: 10, direction: inverse}
|
||||
- !<FileTransform> {src: adx_exp_to_aces.spimtx}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: slogf35
|
||||
family: sony
|
||||
equalitygroup:
|
||||
bitdepth: 10ui
|
||||
description: |
|
||||
Sony 10-bit S-Log, with f35 color primaries
|
||||
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
to_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<FileTransform> {src: slog10.spi1d, interpolation: linear}
|
||||
- !<FileTransform> {src: slogf35_to_aces.spimtx, interpolation: linear}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: slogf65_3200
|
||||
family: sony
|
||||
equalitygroup:
|
||||
bitdepth: 10ui
|
||||
description: |
|
||||
Sony 10-bit S-Log, with f65 color primaries
|
||||
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
to_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<FileTransform> {src: slog10.spi1d, interpolation: linear}
|
||||
- !<FileTransform> {src: slogf65_to_aces_3200.spimtx, interpolation: linear}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: slogf65_5500
|
||||
family: sony
|
||||
equalitygroup:
|
||||
bitdepth: 10ui
|
||||
description: |
|
||||
Sony 10-bit S-Log, with f65 color primaries
|
||||
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
to_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<FileTransform> {src: slog10.spi1d, interpolation: linear}
|
||||
- !<FileTransform> {src: slogf65_to_aces_5500.spimtx, interpolation: linear}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: logc
|
||||
family: arri
|
||||
equalitygroup:
|
||||
bitdepth: 10ui
|
||||
description: |
|
||||
Arri Alexa LogC, V3, Exposure Index 800
|
||||
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
to_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<FileTransform> {src: logc800.spi1d, interpolation: linear}
|
||||
- !<FileTransform> {src: logc_to_aces.spimtx}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: log
|
||||
family: log
|
||||
equalitygroup:
|
||||
bitdepth: 32f
|
||||
description: |
|
||||
A mathematically idealized log space, which spans the dynamic range
|
||||
currently being utilized by the ACES RRT. Note: this does not correspond
|
||||
to scanned plates, adx10 is preferred for that purpose.
|
||||
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
from_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: rrt_srgb
|
||||
family: rrt
|
||||
equalitygroup:
|
||||
bitdepth: 32f
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
from_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
|
||||
- !<FileTransform> {src: rrt_ut33_sRGB.spi3d, interpolation: tetrahedral}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: rrt_rec709
|
||||
family: rrt
|
||||
equalitygroup:
|
||||
bitdepth: 32f
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
from_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
|
||||
- !<FileTransform> {src: rrt_ut33_rec709.spi3d, interpolation: tetrahedral}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: rrt_p3dci
|
||||
family: rrt
|
||||
equalitygroup:
|
||||
bitdepth: 32f
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
from_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
|
||||
- !<FileTransform> {src: rrt_ut33_p3dci.spi3d, interpolation: tetrahedral}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: rrt_p3d60
|
||||
family: rrt
|
||||
equalitygroup:
|
||||
bitdepth: 32f
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
from_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
|
||||
- !<FileTransform> {src: rrt_ut33_p3d60.spi3d, interpolation: tetrahedral}
|
||||
|
||||
- !<ColorSpace>
|
||||
name: rrt_xyz
|
||||
family: rrt
|
||||
equalitygroup:
|
||||
bitdepth: 32f
|
||||
isdata: false
|
||||
allocation: uniform
|
||||
allocationvars: [0, 1]
|
||||
from_reference: !<GroupTransform>
|
||||
children:
|
||||
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
|
||||
- !<FileTransform> {src: rrt_ut33_dcdm.spi3d, interpolation: tetrahedral}
|
@ -0,0 +1,4 @@
|
||||
2.046 0.0 0.0 -12451.65
|
||||
0.0 2.046 0.0 -12451.65
|
||||
0.0 0.0 2.046 -12451.65
|
||||
|
@ -0,0 +1,4 @@
|
||||
8.191875 0.0 0.0 -12451.65
|
||||
0.0 8.191875 0.0 -12451.65
|
||||
0.0 0.0 8.191875 -12451.65
|
||||
|
@ -0,0 +1,4 @@
|
||||
0.75573 0.22197 0.02230 0
|
||||
0.05901 0.96928 -0.02829 0
|
||||
0.16134 0.07406 0.76460 0
|
||||
|
95
release/datafiles/colormanagement/luts/adx_cid_to_rle.py
Normal file
95
release/datafiles/colormanagement/luts/adx_cid_to_rle.py
Normal file
@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import math, numpy
|
||||
|
||||
"""
|
||||
|
||||
const float REF_PT = (7120.0 - 1520.0) / 8000.0 * (100.0 / 55.0) - log10(0.18);
|
||||
|
||||
const float LUT_1D[11][2] = {
|
||||
{-0.190000000000000, -6.000000000000000},
|
||||
{ 0.010000000000000, -2.721718645000000},
|
||||
{ 0.028000000000000, -2.521718645000000},
|
||||
{ 0.054000000000000, -2.321718645000000},
|
||||
{ 0.095000000000000, -2.121718645000000},
|
||||
{ 0.145000000000000, -1.921718645000000},
|
||||
{ 0.220000000000000, -1.721718645000000},
|
||||
{ 0.300000000000000, -1.521718645000000},
|
||||
{ 0.400000000000000, -1.321718645000000},
|
||||
{ 0.500000000000000, -1.121718645000000},
|
||||
{ 0.600000000000000, -0.926545676714876}
|
||||
};
|
||||
|
||||
// Convert Channel Independent Density values to Relative Log Exposure values
|
||||
float logE[3];
|
||||
if ( cid[0] <= 0.6) logE[0] = interpolate1D( LUT_1D, cid[0]);
|
||||
if ( cid[1] <= 0.6) logE[1] = interpolate1D( LUT_1D, cid[1]);
|
||||
if ( cid[2] <= 0.6) logE[2] = interpolate1D( LUT_1D, cid[2]);
|
||||
|
||||
if ( cid[0] > 0.6) logE[0] = ( 100.0 / 55.0) * cid[0] - REF_PT;
|
||||
if ( cid[1] > 0.6) logE[1] = ( 100.0 / 55.0) * cid[1] - REF_PT;
|
||||
if ( cid[2] > 0.6) logE[2] = ( 100.0 / 55.0) * cid[2] - REF_PT;
|
||||
"""
|
||||
|
||||
|
||||
def interpolate1D(x, xp, fp):
|
||||
return numpy.interp(x, xp, fp)
|
||||
|
||||
LUT_1D_xp = [-0.190000000000000,
|
||||
0.010000000000000,
|
||||
0.028000000000000,
|
||||
0.054000000000000,
|
||||
0.095000000000000,
|
||||
0.145000000000000,
|
||||
0.220000000000000,
|
||||
0.300000000000000,
|
||||
0.400000000000000,
|
||||
0.500000000000000,
|
||||
0.600000000000000]
|
||||
|
||||
LUT_1D_fp = [-6.000000000000000,
|
||||
-2.721718645000000,
|
||||
-2.521718645000000,
|
||||
-2.321718645000000,
|
||||
-2.121718645000000,
|
||||
-1.921718645000000,
|
||||
-1.721718645000000,
|
||||
-1.521718645000000,
|
||||
-1.321718645000000,
|
||||
-1.121718645000000,
|
||||
-0.926545676714876]
|
||||
|
||||
REF_PT = (7120.0 - 1520.0) / 8000.0 * (100.0 / 55.0) - math.log(0.18, 10.0)
|
||||
|
||||
def cid_to_rle(x):
|
||||
if x <= 0.6:
|
||||
return interpolate1D(x, LUT_1D_xp, LUT_1D_fp)
|
||||
return (100.0 / 55.0) * x - REF_PT
|
||||
|
||||
def WriteSPI1D(filename, fromMin, fromMax, data):
|
||||
f = file(filename,'w')
|
||||
f.write("Version 1\n")
|
||||
f.write("From %s %s\n" % (fromMin, fromMax))
|
||||
f.write("Length %d\n" % len(data))
|
||||
f.write("Components 1\n")
|
||||
f.write("{\n")
|
||||
for value in data:
|
||||
f.write(" %s\n" % value)
|
||||
f.write("}\n")
|
||||
f.close()
|
||||
|
||||
def Fit(value, fromMin, fromMax, toMin, toMax):
|
||||
if fromMin == fromMax:
|
||||
raise ValueError("fromMin == fromMax")
|
||||
return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin
|
||||
|
||||
NUM_SAMPLES = 2**12
|
||||
RANGE = (-0.19, 3.0)
|
||||
data = []
|
||||
for i in xrange(NUM_SAMPLES):
|
||||
x = i/(NUM_SAMPLES-1.0)
|
||||
x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1])
|
||||
data.append(cid_to_rle(x))
|
||||
|
||||
WriteSPI1D('adx_cid_to_rle.spi1d', RANGE[0], RANGE[1], data)
|
||||
|
4102
release/datafiles/colormanagement/luts/adx_cid_to_rle.spi1d
Normal file
4102
release/datafiles/colormanagement/luts/adx_cid_to_rle.spi1d
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@
|
||||
0.72286 0.12630 0.15084 0
|
||||
0.11923 0.76418 0.11659 0
|
||||
0.01427 0.08213 0.90359 0
|
||||
|
51
release/datafiles/colormanagement/luts/logc800.py
Normal file
51
release/datafiles/colormanagement/luts/logc800.py
Normal file
@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import math
|
||||
|
||||
"""
|
||||
|
||||
// ARRI ALEXA IDT for ALEXA logC files
|
||||
// with camera EI set to 800
|
||||
// Written by v3_IDT_maker.py v0.06 on Thursday 01 March 2012 by alex
|
||||
|
||||
float
|
||||
normalizedLogCToRelativeExposure(float x) {
|
||||
if (x > 0.149659)
|
||||
return (pow(10,(x - 0.385537) / 0.247189) - 0.052272) / 5.555556;
|
||||
else
|
||||
return (x - 0.092809) / 5.367650;
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
def logCToLinear(x):
|
||||
if (x > 0.149659):
|
||||
return (math.pow(10.0,(x - 0.385537) / 0.247189) - 0.052272) / 5.555556
|
||||
else:
|
||||
return (x - 0.092809) / 5.367650
|
||||
|
||||
def WriteSPI1D(filename, fromMin, fromMax, data):
|
||||
f = file(filename,'w')
|
||||
f.write("Version 1\n")
|
||||
f.write("From %s %s\n" % (fromMin, fromMax))
|
||||
f.write("Length %d\n" % len(data))
|
||||
f.write("Components 1\n")
|
||||
f.write("{\n")
|
||||
for value in data:
|
||||
f.write(" %s\n" % value)
|
||||
f.write("}\n")
|
||||
f.close()
|
||||
|
||||
def Fit(value, fromMin, fromMax, toMin, toMax):
|
||||
if fromMin == fromMax:
|
||||
raise ValueError("fromMin == fromMax")
|
||||
return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin
|
||||
|
||||
NUM_SAMPLES = 2**14
|
||||
RANGE = (-0.125, 1.125)
|
||||
data = []
|
||||
for i in xrange(NUM_SAMPLES):
|
||||
x = i/(NUM_SAMPLES-1.0)
|
||||
x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1])
|
||||
data.append(logCToLinear(x))
|
||||
WriteSPI1D('logc800.spi1d', RANGE[0], RANGE[1], data)
|
16390
release/datafiles/colormanagement/luts/logc800.spi1d
Normal file
16390
release/datafiles/colormanagement/luts/logc800.spi1d
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@
|
||||
0.680206 0.236137 0.083658 0
|
||||
0.085415 1.017471 -0.102886 0
|
||||
0.002057 -0.062563 1.060506 0
|
||||
|
32771
release/datafiles/colormanagement/luts/rrt_ut33_dcdm.spi3d
Normal file
32771
release/datafiles/colormanagement/luts/rrt_ut33_dcdm.spi3d
Normal file
File diff suppressed because it is too large
Load Diff
32771
release/datafiles/colormanagement/luts/rrt_ut33_p3d60.spi3d
Normal file
32771
release/datafiles/colormanagement/luts/rrt_ut33_p3d60.spi3d
Normal file
File diff suppressed because it is too large
Load Diff
32771
release/datafiles/colormanagement/luts/rrt_ut33_p3dci.spi3d
Normal file
32771
release/datafiles/colormanagement/luts/rrt_ut33_p3dci.spi3d
Normal file
File diff suppressed because it is too large
Load Diff
32771
release/datafiles/colormanagement/luts/rrt_ut33_rec709.spi3d
Normal file
32771
release/datafiles/colormanagement/luts/rrt_ut33_rec709.spi3d
Normal file
File diff suppressed because it is too large
Load Diff
32771
release/datafiles/colormanagement/luts/rrt_ut33_sRGB.spi3d
Normal file
32771
release/datafiles/colormanagement/luts/rrt_ut33_sRGB.spi3d
Normal file
File diff suppressed because it is too large
Load Diff
58
release/datafiles/colormanagement/luts/slog.py
Normal file
58
release/datafiles/colormanagement/luts/slog.py
Normal file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import math
|
||||
|
||||
# IT's annoying that the 1023,4 and 4095,16 almost, but dont exactly, cancel. UGH
|
||||
# The intent is clearly to have the same mapping, but it's not done very well.
|
||||
# Sony engineers and/or the Academy should pick one of these mappings for both.
|
||||
|
||||
def SLog10_to_lin(x):
|
||||
return (math.pow(10.0,(((((x*1023.0)/4.0-16.0)/219.0)-0.616596-0.03)/0.432699))-0.037584)*0.9
|
||||
|
||||
def SLog12_to_lin(x):
|
||||
return (math.pow(10.0,(((((x*4095.0)/16.0-16.0)/219.0)-0.616596-0.03)/0.432699))-0.037584)*0.9
|
||||
|
||||
|
||||
def WriteSPI1D(filename, fromMin, fromMax, data):
|
||||
f = file(filename,'w')
|
||||
f.write("Version 1\n")
|
||||
f.write("From %s %s\n" % (fromMin, fromMax))
|
||||
f.write("Length %d\n" % len(data))
|
||||
f.write("Components 1\n")
|
||||
f.write("{\n")
|
||||
for value in data:
|
||||
f.write(" %s\n" % value)
|
||||
f.write("}\n")
|
||||
f.close()
|
||||
|
||||
def Fit(value, fromMin, fromMax, toMin, toMax):
|
||||
if fromMin == fromMax:
|
||||
raise ValueError("fromMin == fromMax")
|
||||
return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin
|
||||
|
||||
#
|
||||
# NOTE: The ctl matrix order is transposed compared to what OCIO expects
|
||||
#const float SGAMUT_TO_ACES_MTX[3][3] = {
|
||||
# { 0.754338638, 0.021198141, -0.009756991 },
|
||||
# #{ 0.133697046, 1.005410934, 0.004508563 },
|
||||
# { 0.111968437, -0.026610548, 1.005253201 }
|
||||
|
||||
NUM_SAMPLES = 2**11
|
||||
RANGE = (-0.125, 1.125)
|
||||
data = []
|
||||
for i in xrange(NUM_SAMPLES):
|
||||
x = i/(NUM_SAMPLES-1.0)
|
||||
x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1])
|
||||
data.append(SLog10_to_lin(x))
|
||||
WriteSPI1D('slog10.spi1d', RANGE[0], RANGE[1], data)
|
||||
|
||||
"""
|
||||
NUM_SAMPLES = 2**13
|
||||
RANGE = (-0.125, 1.125)
|
||||
data = []
|
||||
for i in xrange(NUM_SAMPLES):
|
||||
x = i/(NUM_SAMPLES-1.0)
|
||||
x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1])
|
||||
data.append(SLog12_to_lin(x))
|
||||
WriteSPI1D('slog12.spi1d', RANGE[0], RANGE[1], data)
|
||||
"""
|
4102
release/datafiles/colormanagement/luts/slog.spi1d
Normal file
4102
release/datafiles/colormanagement/luts/slog.spi1d
Normal file
File diff suppressed because it is too large
Load Diff
2054
release/datafiles/colormanagement/luts/slog10.spi1d
Normal file
2054
release/datafiles/colormanagement/luts/slog10.spi1d
Normal file
File diff suppressed because it is too large
Load Diff
62
release/datafiles/colormanagement/luts/slog2.py
Normal file
62
release/datafiles/colormanagement/luts/slog2.py
Normal file
@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import math
|
||||
|
||||
# IT's annoying that the 1023,4 and 4095,16 almost, but dont exactly, cancel. UGH
|
||||
# The intent is clearly to have the same mapping, but it's not done very well.
|
||||
# Sony engineers and/or the Academy should pick one of these mappings for both.
|
||||
|
||||
def SLog_to_lin(x):
|
||||
return (math.pow(10.0,(((((x*1023.0)/4.0-16.0)/219.0)-0.616596-0.03)/0.432699))-0.037584)*0.9
|
||||
|
||||
def SLog2_to_lin(x):
|
||||
if x < 0.030001222851889303:
|
||||
return (x-0.030001222851889303 ) * 0.28258064516129
|
||||
return (219.0*(math.pow(10.0, ((x-0.616596-0.03)/0.432699)) - 0.037584) /155.0)
|
||||
|
||||
steps = 21
|
||||
for i in xrange(steps):
|
||||
x = i/(steps-1.0)
|
||||
print x, SLog_to_lin(x), SLog2_to_lin(x)
|
||||
|
||||
def WriteSPI1D(filename, fromMin, fromMax, data):
|
||||
f = file(filename,'w')
|
||||
f.write("Version 1\n")
|
||||
f.write("From %s %s\n" % (fromMin, fromMax))
|
||||
f.write("Length %d\n" % len(data))
|
||||
f.write("Components 1\n")
|
||||
f.write("{\n")
|
||||
for value in data:
|
||||
f.write(" %s\n" % value)
|
||||
f.write("}\n")
|
||||
f.close()
|
||||
|
||||
def Fit(value, fromMin, fromMax, toMin, toMax):
|
||||
if fromMin == fromMax:
|
||||
raise ValueError("fromMin == fromMax")
|
||||
return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin
|
||||
|
||||
"""
|
||||
5500K:
|
||||
|
||||
ACESR = 0.8764457030 * Rraw + 0.0145411681 * Graw + 0.1090131290 * Braw;
|
||||
ACESG = 0.0774075345 * Rraw + 0.9529571767 * Graw + -0.0303647111 * Braw;
|
||||
ACESB = 0.0573564351 * Rraw + -0.1151066335 * Graw + 1.0577501984 * Braw;
|
||||
|
||||
3200K:
|
||||
|
||||
ACESR = 1.0110238740 * Rraw + -0.1362526051 * Graw + 0.1252287310 * Braw;
|
||||
ACESG = 0.1011994504 * Rraw + 0.9562196265 * Graw + -0.0574190769 * Braw;
|
||||
ACESB = 0.0600766530 * Rraw + -0.1010185315 * Graw + 1.0409418785 * Braw;
|
||||
"""
|
||||
|
||||
"""
|
||||
NUM_SAMPLES = 2**11
|
||||
RANGE = (-0.125, 1.125)
|
||||
data = []
|
||||
for i in xrange(NUM_SAMPLES):
|
||||
x = i/(NUM_SAMPLES-1.0)
|
||||
x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1])
|
||||
data.append(SLog10_to_lin(x))
|
||||
WriteSPI1D('slog2.spi1d', RANGE[0], RANGE[1], data)
|
||||
"""
|
@ -0,0 +1,4 @@
|
||||
0.754338638 0.133697046 0.111968437 0
|
||||
0.021198141 1.005410934 -0.026610548 0
|
||||
-0.009756991 0.004508563 1.005253201 0
|
||||
|
@ -0,0 +1,4 @@
|
||||
1.0110238740 -0.1362526051 0.1252287310 0
|
||||
0.1011994504 0.9562196265 -0.0574190769 0
|
||||
0.0600766530 -0.1010185315 1.0409418785 0
|
||||
|
@ -0,0 +1,4 @@
|
||||
0.8764457030 0.0145411681 0.1090131290 0
|
||||
0.0774075345 0.9529571767 -0.0303647111 0
|
||||
0.0573564351 -0.1151066335 1.0577501984 0
|
||||
|
@ -0,0 +1,3 @@
|
||||
1023 0.0 0.0 0
|
||||
0.0 1023 0.0 0
|
||||
0.000 0.0 1023 0
|
@ -107,6 +107,15 @@ class IMAGE_MT_select(Menu):
|
||||
layout.operator("uv.select_linked")
|
||||
|
||||
|
||||
class IMAGE_PT_view_transform(Panel):
|
||||
bl_label = "View Transform"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
|
||||
layout.prop(sima, "view_transform")
|
||||
class IMAGE_MT_image(Menu):
|
||||
bl_label = "Image"
|
||||
|
||||
@ -427,6 +436,19 @@ class IMAGE_HT_header(Header):
|
||||
layout.prop(sima, "use_realtime_update", text="", icon_only=True, icon='LOCKED')
|
||||
|
||||
|
||||
class IMAGE_PT_view_transform(Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "View Transform"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
|
||||
layout.prop(sima, "view_transform", text="")
|
||||
|
||||
|
||||
class IMAGE_PT_image_properties(Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
|
@ -76,7 +76,7 @@
|
||||
|
||||
#define HEADER_HEIGHT 18
|
||||
|
||||
static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage)
|
||||
static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage, int view_transform)
|
||||
{
|
||||
/* detect if we need to redo the curve map.
|
||||
* ibuf->rect is zero for compositor and render results after change
|
||||
@ -85,7 +85,9 @@ static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage)
|
||||
* NOTE: if float buffer changes, we have to manually remove the rect
|
||||
*/
|
||||
|
||||
if (ibuf->rect_float && (ibuf->rect == NULL || (ibuf->userflags & IB_RECT_INVALID)) ) {
|
||||
unsigned int *rect = imb_getrectviewImBuf(ibuf, view_transform);
|
||||
|
||||
if (ibuf->rect_float && (rect == NULL || (ibuf->userflags & IB_RECT_INVALID)) ) {
|
||||
if (color_manage) {
|
||||
if (ima && ima->source == IMA_SRC_VIEWER)
|
||||
ibuf->profile = IB_PROFILE_LINEAR_RGB;
|
||||
@ -93,7 +95,7 @@ static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage)
|
||||
else
|
||||
ibuf->profile = IB_PROFILE_NONE;
|
||||
|
||||
IMB_rect_from_float(ibuf);
|
||||
IMB_rect_from_float_with_view_transform(ibuf, view_transform);
|
||||
}
|
||||
}
|
||||
|
||||
@ -430,8 +432,10 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image
|
||||
|
||||
/* this part is generic image display */
|
||||
if (sima->flag & SI_SHOW_ALPHA) {
|
||||
if (ibuf->rect)
|
||||
sima_draw_alpha_pixels(x, y, ibuf->x, ibuf->y, ibuf->rect);
|
||||
unsigned int *rect = imb_getrectviewImBuf(ibuf, sima->view_transform);
|
||||
|
||||
if (rect)
|
||||
sima_draw_alpha_pixels(x, y, ibuf->x, ibuf->y, rect);
|
||||
else if (ibuf->rect_float && ibuf->channels == 4)
|
||||
sima_draw_alpha_pixelsf(x, y, ibuf->x, ibuf->y, ibuf->rect_float);
|
||||
}
|
||||
@ -444,6 +448,8 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image
|
||||
sima_draw_zbuffloat_pixels(scene, x, y, ibuf->x, ibuf->y, ibuf->rect_float);
|
||||
}
|
||||
else {
|
||||
unsigned int *rect;
|
||||
|
||||
if (sima->flag & SI_USE_ALPHA) {
|
||||
fdrawcheckerboard(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy);
|
||||
|
||||
@ -453,10 +459,12 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image
|
||||
|
||||
/* we don't draw floats buffers directly but
|
||||
* convert them, and optionally apply curves */
|
||||
image_verify_buffer_float(ima, ibuf, color_manage);
|
||||
image_verify_buffer_float(ima, ibuf, color_manage, sima->view_transform);
|
||||
|
||||
if (ibuf->rect)
|
||||
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
|
||||
rect = imb_getrectviewImBuf(ibuf, sima->view_transform);
|
||||
|
||||
if (rect)
|
||||
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, rect);
|
||||
#if 0
|
||||
else
|
||||
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float);
|
||||
@ -470,14 +478,15 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image
|
||||
glPixelZoom(1.0f, 1.0f);
|
||||
}
|
||||
|
||||
static unsigned int *get_part_from_ibuf(ImBuf *ibuf, short startx, short starty, short endx, short endy)
|
||||
static unsigned int *get_part_from_ibuf(ImBuf *ibuf, short startx, short starty, short endx, short endy, int view_transform)
|
||||
{
|
||||
unsigned int *rt, *rp, *rectmain;
|
||||
short y, heigth, len;
|
||||
unsigned int *rect = imb_getrectviewImBuf(ibuf, view_transform);
|
||||
|
||||
/* the right offset in rectot */
|
||||
|
||||
rt = ibuf->rect + (starty * ibuf->x + startx);
|
||||
rt = rect + (starty * ibuf->x + startx);
|
||||
|
||||
len = (endx - startx);
|
||||
heigth = (endy - starty);
|
||||
@ -508,14 +517,14 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene,
|
||||
sima->curtile = ima->xrep * ima->yrep - 1;
|
||||
|
||||
/* create char buffer from float if needed */
|
||||
image_verify_buffer_float(ima, ibuf, color_manage);
|
||||
image_verify_buffer_float(ima, ibuf, color_manage, sima->view_transform);
|
||||
|
||||
/* retrieve part of image buffer */
|
||||
dx = ibuf->x / ima->xrep;
|
||||
dy = ibuf->y / ima->yrep;
|
||||
sx = (sima->curtile % ima->xrep) * dx;
|
||||
sy = (sima->curtile / ima->xrep) * dy;
|
||||
rect = get_part_from_ibuf(ibuf, sx, sy, sx + dx, sy + dy);
|
||||
rect = get_part_from_ibuf(ibuf, sx, sy, sx + dx, sy + dy, sima->view_transform);
|
||||
|
||||
/* draw repeated */
|
||||
for (sy = 0; sy + dy <= ibuf->y; sy += dy) {
|
||||
@ -637,16 +646,19 @@ static unsigned char *get_alpha_clone_image(Scene *scene, int *width, int *heigh
|
||||
ImBuf *ibuf;
|
||||
unsigned int size, alpha;
|
||||
unsigned char *rect, *cp;
|
||||
unsigned int *rect_view;
|
||||
|
||||
if (!brush || !brush->clone.image)
|
||||
return NULL;
|
||||
|
||||
ibuf = BKE_image_get_ibuf(brush->clone.image, NULL);
|
||||
/* XXX: which transform to use here? */
|
||||
rect_view = imb_getrectviewImBuf(ibuf, IMB_VIEW_TRANSFORM_NONE);
|
||||
|
||||
if (!ibuf || !ibuf->rect)
|
||||
if (!ibuf || !rect_view)
|
||||
return NULL;
|
||||
|
||||
rect = MEM_dupallocN(ibuf->rect);
|
||||
rect = MEM_dupallocN(rect_view);
|
||||
if (!rect)
|
||||
return NULL;
|
||||
|
||||
|
@ -180,6 +180,26 @@ if(WITH_IMAGE_HDR)
|
||||
add_definitions(-DWITH_HDR)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
list(APPEND SRC
|
||||
intern/colormanagement.c
|
||||
)
|
||||
list(APPEND INC
|
||||
../../../intern/opencolorio
|
||||
)
|
||||
add_definitions(-DWITH_OCIO)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
list(APPEND SRC
|
||||
intern/colormanagement.c
|
||||
)
|
||||
list(APPEND INC
|
||||
../../../intern/opencolorio
|
||||
)
|
||||
add_definitions(-DWITH_OCIO)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
../../../intern/utfconv
|
||||
|
39
source/blender/imbuf/IMB_colormanagement.h
Normal file
39
source/blender/imbuf/IMB_colormanagement.h
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* 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 2
|
||||
* 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, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2012 by Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Xavier Thomas,
|
||||
* Lukas Toenne,
|
||||
* Sergey Sharybin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IMB_COLORMANAGEMENT_H
|
||||
#define IMB_COLORMANAGEMENT_H
|
||||
|
||||
#define BCM_CONFIG_FILE "config.ocio"
|
||||
|
||||
void IMB_colormanagement_init(void);
|
||||
void IMB_colormanagement_exit(void);
|
||||
|
||||
#endif // IMB_COLORMANAGEMENT_H
|
@ -364,8 +364,18 @@ int imb_get_anim_type(const char *name);
|
||||
void IMB_de_interlace(struct ImBuf *ibuf);
|
||||
void IMB_interlace(struct ImBuf *ibuf);
|
||||
|
||||
/* currently should match eSpaceImage_ViewTransform */
|
||||
typedef enum IMB_ViewTransform {
|
||||
IMB_VIEW_TRANSFORM_NONE = 0,
|
||||
IMB_VIEW_TRANSFORM_ACES_ODT_TONECURVE = 1,
|
||||
IMB_VIEW_TRANSFORM_OCIO_RAW = 2,
|
||||
IMB_VIEW_TRANSFORM_OCIO_RRT = 3,
|
||||
IMB_VIEW_TRANSFORM_OCIO_LOG = 4,
|
||||
} IMB_ViewTransform;
|
||||
|
||||
/* create char buffer, color corrected if necessary, for ImBufs that lack one */
|
||||
void IMB_rect_from_float(struct ImBuf *ibuf);
|
||||
void IMB_rect_from_float_with_view_transform(struct ImBuf *ibuf, int view_transform);
|
||||
/* Create char buffer for part of the image, color corrected if necessary,
|
||||
* Changed part will be stored in buffer. This is expected to be used for texture painting updates */
|
||||
void IMB_partial_rect_from_float(struct ImBuf *ibuf, float *buffer, int x, int y, int w, int h);
|
||||
@ -498,5 +508,10 @@ void imb_freemipmapImBuf(struct ImBuf *ibuf);
|
||||
short imb_addtilesImBuf(struct ImBuf *ibuf);
|
||||
void imb_freetilesImBuf(struct ImBuf *ibuf);
|
||||
|
||||
#endif
|
||||
short imb_addrectviewImBuf(struct ImBuf *ibuf, int view_transform);
|
||||
void imb_freerectviewImBuf(struct ImBuf *ibuf, int view_transform);
|
||||
void imb_freerectviewImBuf_all(struct ImBuf *ibuf);
|
||||
|
||||
unsigned int *imb_getrectviewImBuf(struct ImBuf *ibuf, int view_transform);
|
||||
|
||||
#endif
|
||||
|
@ -76,6 +76,8 @@ typedef struct ImBuf {
|
||||
|
||||
/* pixels */
|
||||
unsigned int *rect; /* pixel values stored here */
|
||||
unsigned int *rect_view[5]; /* cached view rects which were converted from float buffer */
|
||||
/* using different view transforms */
|
||||
float *rect_float; /* floating point Rect equivalent
|
||||
* Linear RGB color space - may need gamma correction to
|
||||
* sRGB when generating 8bit representations */
|
||||
|
@ -58,4 +58,16 @@ if env['WITH_BF_QUICKTIME']:
|
||||
incs += ' ../quicktime ' + env['BF_QUICKTIME_INC']
|
||||
defs.append('WITH_QUICKTIME')
|
||||
|
||||
if env['WITH_BF_OCIO']:
|
||||
defs.append('WITH_OCIO')
|
||||
incs += ' #intern/opencolorio'
|
||||
else:
|
||||
sources.remove(os.path.join('intern', 'colormanagement.c'))
|
||||
|
||||
if env['WITH_BF_OCIO']:
|
||||
defs.append('WITH_OCIO')
|
||||
incs += ' #intern/opencolorio'
|
||||
else:
|
||||
sources.remove(os.path.join('intern', 'colormanagement.c'))
|
||||
|
||||
env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [185,115] )
|
||||
|
@ -43,5 +43,9 @@ void IMB_premultiply_rect_float(float *rect_float, char planes, int w, int h);
|
||||
|
||||
void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1);
|
||||
|
||||
/* tonecurves corrections */
|
||||
void IMB_ratio_preserving_odt_tonecurve_v3(const float rgbIn[3], float rgbOut[3]);
|
||||
void IMB_ratio_preserving_odt_tonecurve_v4(const float rgbIn[4], float rgbOut[4]);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -156,6 +156,7 @@ void IMB_freeImBuf(ImBuf *ibuf)
|
||||
}
|
||||
else {
|
||||
imb_freerectImBuf(ibuf);
|
||||
imb_freerectviewImBuf_all(ibuf);
|
||||
imb_freerectfloatImBuf(ibuf);
|
||||
imb_freetilesImBuf(ibuf);
|
||||
IMB_freezbufImBuf(ibuf);
|
||||
@ -439,6 +440,8 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
|
||||
// for now don't duplicate metadata
|
||||
tbuf.metadata = NULL;
|
||||
|
||||
memset(tbuf.rect_view, 0, sizeof(tbuf.rect_view));
|
||||
|
||||
*ibuf2 = tbuf;
|
||||
|
||||
return(ibuf2);
|
||||
@ -471,3 +474,63 @@ static MEM_CacheLimiterC **get_imbuf_cache_limiter(void)
|
||||
return &c;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* question; why also add zbuf? */
|
||||
short imb_addrectviewImBuf(ImBuf *ibuf, int view_transform)
|
||||
{
|
||||
int size;
|
||||
|
||||
if (view_transform == IMB_VIEW_TRANSFORM_NONE)
|
||||
return imb_addrectImBuf(ibuf);
|
||||
|
||||
if (ibuf == NULL) return FALSE;
|
||||
|
||||
/* don't call imb_freerectImBuf, it frees mipmaps, this call is used only too give float buffers display */
|
||||
if (ibuf->rect_view[view_transform])
|
||||
MEM_freeN(ibuf->rect_view[view_transform]);
|
||||
ibuf->rect_view[view_transform] = NULL;
|
||||
|
||||
size = ibuf->x * ibuf->y;
|
||||
size = size * sizeof(unsigned int);
|
||||
|
||||
if ((ibuf->rect_view[view_transform] = MEM_mapallocN(size, "imb_addrectImBuf"))) {
|
||||
if (ibuf->planes > 32) return (addzbufImBuf(ibuf));
|
||||
else return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* any free rect frees mipmaps to be sure, creation is in render on first request */
|
||||
void imb_freerectviewImBuf(ImBuf *ibuf, int view_transform)
|
||||
{
|
||||
if (view_transform == IMB_VIEW_TRANSFORM_NONE) {
|
||||
imb_freerectImBuf(ibuf);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (ibuf == NULL) return;
|
||||
|
||||
if (ibuf->rect_view[view_transform])
|
||||
MEM_freeN(ibuf->rect_view[view_transform]);
|
||||
|
||||
ibuf->rect_view[view_transform] = NULL;
|
||||
}
|
||||
|
||||
void imb_freerectviewImBuf_all(ImBuf *ibuf)
|
||||
{
|
||||
imb_freerectviewImBuf(ibuf, IMB_VIEW_TRANSFORM_ACES_ODT_TONECURVE);
|
||||
imb_freerectviewImBuf(ibuf, IMB_VIEW_TRANSFORM_OCIO_RAW);
|
||||
imb_freerectviewImBuf(ibuf, IMB_VIEW_TRANSFORM_OCIO_RRT);
|
||||
imb_freerectviewImBuf(ibuf, IMB_VIEW_TRANSFORM_OCIO_LOG);
|
||||
}
|
||||
|
||||
unsigned int *imb_getrectviewImBuf(ImBuf *ibuf, int view_transform)
|
||||
{
|
||||
if (view_transform == IMB_VIEW_TRANSFORM_NONE) {
|
||||
return ibuf->rect;
|
||||
}
|
||||
|
||||
return ibuf->rect_view[view_transform];
|
||||
}
|
||||
|
86
source/blender/imbuf/intern/colormanagement.c
Normal file
86
source/blender/imbuf/intern/colormanagement.c
Normal file
@ -0,0 +1,86 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* 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 2
|
||||
* 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, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2012 by Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Xavier Thomas,
|
||||
* Lukas Toenne,
|
||||
* Sergey Sharybin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*
|
||||
*/
|
||||
|
||||
#include "IMB_colormanagement.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_path_util.h"
|
||||
|
||||
#include "BKE_utildefines.h"
|
||||
|
||||
#include <ocio_capi.h>
|
||||
|
||||
static void colormgmt_load_config(ConstConfigRcPtr* config)
|
||||
{
|
||||
OCIO_setCurrentConfig(config);
|
||||
}
|
||||
|
||||
void colormgmt_free_config(void)
|
||||
{
|
||||
}
|
||||
|
||||
void IMB_colormanagement_init(void)
|
||||
{
|
||||
const char *ocio_env;
|
||||
const char *configdir;
|
||||
char configfile[FILE_MAXDIR+FILE_MAXFILE];
|
||||
ConstConfigRcPtr* config;
|
||||
|
||||
ocio_env = getenv("OCIO");
|
||||
|
||||
if (ocio_env) {
|
||||
config = OCIO_configCreateFromEnv();
|
||||
}
|
||||
else {
|
||||
configdir = BLI_get_folder(BLENDER_DATAFILES, "colormanagement");
|
||||
|
||||
if (configdir) {
|
||||
BLI_join_dirfile(configfile, sizeof(configfile), configdir, BCM_CONFIG_FILE);
|
||||
}
|
||||
|
||||
config = OCIO_configCreateFromFile(configfile);
|
||||
}
|
||||
|
||||
if (config) {
|
||||
colormgmt_load_config(config);
|
||||
}
|
||||
|
||||
OCIO_configRelease(config);
|
||||
}
|
||||
|
||||
void IMB_colormanagement_exit(void)
|
||||
{
|
||||
colormgmt_free_config();
|
||||
}
|
@ -40,10 +40,15 @@
|
||||
#include "imbuf.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
#include "IMB_imbuf.h"
|
||||
#include "IMB_filter.h"
|
||||
#include "IMB_allocimbuf.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#ifdef WITH_OCIO
|
||||
#include <ocio_capi.h>
|
||||
#endif
|
||||
|
||||
/**************************** Interlace/Deinterlace **************************/
|
||||
|
||||
void IMB_de_interlace(ImBuf *ibuf)
|
||||
@ -522,6 +527,89 @@ void IMB_buffer_byte_from_byte(uchar *rect_to, const uchar *rect_from,
|
||||
}
|
||||
}
|
||||
|
||||
/* float to byte pixels, output 4-channel RGBA */
|
||||
void IMB_buffer_srgb_byte_from_linear_float(uchar *rect_to, const float *rect_from,
|
||||
int channels_from, float dither, int predivide,
|
||||
int width, int height, int stride_to, int stride_from)
|
||||
{
|
||||
float tmp[4];
|
||||
int x, y;
|
||||
DitherContext *di;
|
||||
float corrected[4];
|
||||
|
||||
BLI_init_srgb_conversion();
|
||||
|
||||
if (dither)
|
||||
di = create_dither_context(width, dither);
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
if (channels_from == 1) {
|
||||
/* single channel input */
|
||||
const float *from = rect_from + stride_from * y;
|
||||
uchar *to = rect_to + stride_to * y * 4;
|
||||
|
||||
for (x = 0; x < width; x++, from++, to += 4)
|
||||
to[0] = to[1] = to[2] = to[3] = FTOCHAR(from[0]);
|
||||
}
|
||||
else if (channels_from == 3) {
|
||||
/* RGB input */
|
||||
const float *from = rect_from + stride_from * y * 3;
|
||||
uchar *to = rect_to + stride_to * y * 4;
|
||||
|
||||
/* convert from linear to sRGB */
|
||||
for (x = 0; x < width; x++, from += 3, to += 4) {
|
||||
IMB_ratio_preserving_odt_tonecurve_v3(from, corrected);
|
||||
linearrgb_to_srgb_v3_v3(tmp, corrected);
|
||||
rgb_float_to_uchar(to, tmp);
|
||||
to[3] = 255;
|
||||
}
|
||||
}
|
||||
else if (channels_from == 4) {
|
||||
/* RGBA input */
|
||||
const float *from = rect_from + stride_from * y * 4;
|
||||
uchar *to = rect_to + stride_to * y * 4;
|
||||
|
||||
/* convert from linear to sRGB */
|
||||
unsigned short us[4];
|
||||
|
||||
if (dither && predivide) {
|
||||
for (x = 0; x < width; x++, from += 4, to += 4) {
|
||||
IMB_ratio_preserving_odt_tonecurve_v4(from, corrected);
|
||||
linearrgb_to_srgb_ushort4_predivide(us, corrected);
|
||||
ushort_to_byte_dither_v4(to, us, di);
|
||||
}
|
||||
}
|
||||
else if (dither) {
|
||||
for (x = 0; x < width; x++, from += 4, to += 4) {
|
||||
IMB_ratio_preserving_odt_tonecurve_v4(from, corrected);
|
||||
linearrgb_to_srgb_ushort4(us, corrected);
|
||||
ushort_to_byte_dither_v4(to, us, di);
|
||||
}
|
||||
}
|
||||
else if (predivide) {
|
||||
for (x = 0; x < width; x++, from += 4, to += 4) {
|
||||
IMB_ratio_preserving_odt_tonecurve_v4(from, corrected);
|
||||
linearrgb_to_srgb_ushort4_predivide(us, corrected);
|
||||
ushort_to_byte_v4(to, us);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (x = 0; x < width; x++, from += 4, to += 4) {
|
||||
IMB_ratio_preserving_odt_tonecurve_v4(from, corrected);
|
||||
linearrgb_to_srgb_ushort4(us, corrected);
|
||||
ushort_to_byte_v4(to, us);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dither)
|
||||
dither_finish_row(di);
|
||||
}
|
||||
|
||||
if (dither)
|
||||
clear_dither_context(di);
|
||||
}
|
||||
|
||||
/****************************** ImBuf Conversion *****************************/
|
||||
|
||||
void IMB_rect_from_float(ImBuf *ibuf)
|
||||
@ -533,6 +621,10 @@ void IMB_rect_from_float(ImBuf *ibuf)
|
||||
if (ibuf->rect_float == NULL)
|
||||
return;
|
||||
|
||||
if (ibuf->userflags & IB_RECT_INVALID) {
|
||||
imb_freerectviewImBuf_all(ibuf);
|
||||
}
|
||||
|
||||
/* create byte rect if it didn't exist yet */
|
||||
if (ibuf->rect == NULL)
|
||||
imb_addrectImBuf(ibuf);
|
||||
@ -558,6 +650,106 @@ void IMB_rect_from_float(ImBuf *ibuf)
|
||||
ibuf->userflags &= ~IB_RECT_INVALID;
|
||||
}
|
||||
|
||||
void IMB_rect_from_float_with_view_transform(ImBuf *ibuf, int view_transform)
|
||||
{
|
||||
int predivide = (ibuf->flags & IB_cm_predivide);
|
||||
|
||||
/* verify we have a float buffer */
|
||||
if (ibuf->rect_float == NULL)
|
||||
return;
|
||||
|
||||
if (ibuf->userflags & IB_RECT_INVALID) {
|
||||
imb_freerectviewImBuf_all(ibuf);
|
||||
}
|
||||
|
||||
if (view_transform == IMB_VIEW_TRANSFORM_NONE) {
|
||||
int profile_from;
|
||||
|
||||
/* create byte rect if it didn't exist yet */
|
||||
if (ibuf->rect == NULL)
|
||||
imb_addrectImBuf(ibuf);
|
||||
|
||||
/* determine profiles */
|
||||
if (ibuf->profile == IB_PROFILE_LINEAR_RGB) {
|
||||
profile_from = IB_PROFILE_LINEAR_RGB;
|
||||
}
|
||||
else if (ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE)) {
|
||||
profile_from = IB_PROFILE_SRGB;
|
||||
}
|
||||
else {
|
||||
profile_from = IB_PROFILE_SRGB; /* should never happen */
|
||||
BLI_assert(0);
|
||||
}
|
||||
|
||||
/* do conversion */
|
||||
IMB_buffer_byte_from_float((uchar *)ibuf->rect, ibuf->rect_float,
|
||||
ibuf->channels, ibuf->dither, IB_PROFILE_SRGB, profile_from, predivide,
|
||||
ibuf->x, ibuf->y, ibuf->x, ibuf->x);
|
||||
}
|
||||
else if (view_transform == IMB_VIEW_TRANSFORM_ACES_ODT_TONECURVE) {
|
||||
unsigned int *rect_view;
|
||||
|
||||
/* create byte rect if it didn't exist yet */
|
||||
if (ibuf->rect_view[view_transform] == NULL)
|
||||
imb_addrectviewImBuf(ibuf, view_transform);
|
||||
|
||||
rect_view = imb_getrectviewImBuf(ibuf, view_transform);
|
||||
|
||||
IMB_buffer_srgb_byte_from_linear_float((uchar *)rect_view, ibuf->rect_float,
|
||||
ibuf->channels, ibuf->dither, predivide,
|
||||
ibuf->x, ibuf->y, ibuf->x, ibuf->x);
|
||||
}
|
||||
else {
|
||||
ConstConfigRcPtr *config = OCIO_getCurrentConfig();
|
||||
ConstProcessorRcPtr *processor;
|
||||
DisplayTransformRcPtr *dt = OCIO_createDisplayTransform();
|
||||
PackedImageDesc *img;
|
||||
float *rect_float;
|
||||
|
||||
OCIO_displayTransformSetInputColorSpaceName(dt, "aces");
|
||||
OCIO_displayTransformSetDisplay(dt, "sRGB");
|
||||
|
||||
if (view_transform == IMB_VIEW_TRANSFORM_OCIO_RAW)
|
||||
OCIO_displayTransformSetView(dt, "Raw");
|
||||
else if (view_transform == IMB_VIEW_TRANSFORM_OCIO_RRT)
|
||||
OCIO_displayTransformSetView(dt, "RRT");
|
||||
else if (view_transform == IMB_VIEW_TRANSFORM_OCIO_LOG)
|
||||
OCIO_displayTransformSetView(dt, "Log");
|
||||
|
||||
rect_float = MEM_dupallocN(ibuf->rect_float);
|
||||
img = OCIO_createPackedImageDesc(rect_float, ibuf->x, ibuf->y, ibuf->channels, sizeof(float),
|
||||
ibuf->channels * sizeof(float), ibuf->channels * sizeof(float)*ibuf->x);
|
||||
|
||||
processor = OCIO_configGetProcessor(config, (ConstTransformRcPtr*)dt);
|
||||
if (processor) {
|
||||
unsigned int *rect_view;
|
||||
|
||||
OCIO_processorApply(processor, img);
|
||||
|
||||
/* create byte rect if it didn't exist yet */
|
||||
if (ibuf->rect_view[view_transform] == NULL)
|
||||
imb_addrectviewImBuf(ibuf, view_transform);
|
||||
|
||||
rect_view = imb_getrectviewImBuf(ibuf, view_transform);
|
||||
|
||||
/* do conversion */
|
||||
IMB_buffer_byte_from_float((uchar *)rect_view, rect_float,
|
||||
ibuf->channels, ibuf->dither, IB_PROFILE_SRGB, IB_PROFILE_SRGB, predivide,
|
||||
ibuf->x, ibuf->y, ibuf->x, ibuf->x);
|
||||
|
||||
}
|
||||
|
||||
OCIO_packedImageDescRelease(img);
|
||||
OCIO_displayTransformRelease(dt);
|
||||
OCIO_processorRelease(processor);
|
||||
OCIO_configRelease(config);
|
||||
|
||||
MEM_freeN(rect_float);
|
||||
}
|
||||
|
||||
ibuf->userflags &= ~IB_RECT_INVALID;
|
||||
}
|
||||
|
||||
/* converts from linear float to sRGB byte for part of the texture, buffer will hold the changed part */
|
||||
void IMB_partial_rect_from_float(ImBuf *ibuf, float *buffer, int x, int y, int w, int h)
|
||||
{
|
||||
|
@ -31,8 +31,12 @@
|
||||
* \ingroup imbuf
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <math.h>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "IMB_imbuf_types.h"
|
||||
@ -595,3 +599,194 @@ void IMB_premultiply_alpha(ImBuf *ibuf)
|
||||
IMB_premultiply_rect_float(ibuf->rect_float, ibuf->planes, ibuf->x, ibuf->y);
|
||||
}
|
||||
|
||||
/* Tonecurve corrections */
|
||||
|
||||
// code of rdt_shaper_fwd and ratio_preserving_odt_tonecurve belongs to
|
||||
// ACES project (https://github.com/ampas/aces-dev)
|
||||
|
||||
// === ODT SPLINE === //
|
||||
//
|
||||
// Algorithm for applying ODT tone curve in forward direction.
|
||||
//
|
||||
// vers 1.0 Doug Walker 2012-01-23
|
||||
// modified by Scott Dyer 2012-02-28
|
||||
|
||||
// Input and output are in linear (not log) units.
|
||||
static float rdt_shaper_fwd( float x)
|
||||
{
|
||||
// B-spline coefficients.
|
||||
// The units are density of the output.
|
||||
const float COEFS0 = -0.008;
|
||||
const float COEFS1 = -0.00616;
|
||||
const float COEFS2 = 0.026;
|
||||
const float COEFS3 = 0.185;
|
||||
const float COEFS4 = 0.521;
|
||||
const float COEFS5 = 0.993;
|
||||
const float COEFS6 = 1.563;
|
||||
const float COEFS7 = 2.218;
|
||||
const float COEFS8 = 2.795;
|
||||
const float COEFS9 = 3.36;
|
||||
const float COEFS10 = 4.0; // NB: keep this less than or equal to -log10( FLARE)
|
||||
// The locations of these control points in OCES density space are:
|
||||
// -1., -0.79, -0.44, -0.01, 0.48, 1.01, 1.58, 2.18, 2.82, 3.47, 4.15, 4.85
|
||||
|
||||
// The flare term allows the spline to more rapidly approach zero
|
||||
// while keeping the shape of the curve well-behaved in density space.
|
||||
const float FLARE = 1e-4;
|
||||
|
||||
// The last control point is fixed to yield a specific density at the
|
||||
// end of the knot domain.
|
||||
//const float COEFS11 = 2. * ( -log10( FLARE) - 0.001) - COEFS10;
|
||||
// Note: Apparently a CTL bug prevents calling log10() here, so
|
||||
// you'll need to update this manually if you change FLARE.
|
||||
const float COEFS11 = COEFS10 + 2. * ( 4. - COEFS10);
|
||||
|
||||
// The knots are in units of OCES density.
|
||||
const unsigned int KNOT_LEN = 11;
|
||||
const float KNOT_START = -0.9;
|
||||
const float KNOT_END = 4.484256;
|
||||
|
||||
// The KNOT_POW adjusts the spacing to put more knots near the toe (highlights).
|
||||
const float KNOT_POW = 1. / 1.3;
|
||||
const float OFFS = KNOT_START;
|
||||
const float SC = KNOT_END - KNOT_START;
|
||||
|
||||
// KNOT_DENS is density of the spline at the knots.
|
||||
const float KNOT_DENS[ 11] = {
|
||||
( COEFS0 + COEFS1) / 2.,
|
||||
( COEFS1 + COEFS2) / 2.,
|
||||
( COEFS2 + COEFS3) / 2.,
|
||||
( COEFS3 + COEFS4) / 2.,
|
||||
( COEFS4 + COEFS5) / 2.,
|
||||
( COEFS5 + COEFS6) / 2.,
|
||||
( COEFS6 + COEFS7) / 2.,
|
||||
( COEFS7 + COEFS8) / 2.,
|
||||
( COEFS8 + COEFS9) / 2.,
|
||||
( COEFS9 + COEFS10) / 2.,
|
||||
( COEFS10 + COEFS11) / 2.
|
||||
};
|
||||
|
||||
// Parameters controlling linear extrapolation.
|
||||
const float LIGHT_SLOPE = 0.023;
|
||||
const float CROSSOVER = pow(10,-KNOT_END);
|
||||
const float REV_CROSSOVER = pow10( -KNOT_DENS[ KNOT_LEN - 1]) - FLARE;
|
||||
const float DARK_SLOPE = REV_CROSSOVER / CROSSOVER;
|
||||
|
||||
// Textbook monomial to basis-function conversion matrix.
|
||||
/*const*/ float M[ 3][ 3] = {
|
||||
{ 0.5, -1.0, 0.5 },
|
||||
{ -1.0, 1.0, 0.5 },
|
||||
{ 0.5, 0.0, 0.0 }
|
||||
};
|
||||
|
||||
float y;
|
||||
// Linear extrapolation in linear space for negative & very dark values.
|
||||
if ( x <= CROSSOVER)
|
||||
y = x * DARK_SLOPE;
|
||||
else {
|
||||
float in_dens = -log10( x);
|
||||
float out_dens;
|
||||
float knot_coord = ( in_dens - OFFS) / SC;
|
||||
|
||||
// Linear extrapolation in log space for very light values.
|
||||
if ( knot_coord <= 0.)
|
||||
out_dens = KNOT_DENS[ 0] - ( KNOT_START - in_dens) * LIGHT_SLOPE;
|
||||
|
||||
// For typical OCES values, apply a B-spline curve.
|
||||
else {
|
||||
knot_coord = ( KNOT_LEN - 1) * pow( knot_coord, KNOT_POW);
|
||||
{
|
||||
int j = knot_coord;
|
||||
float t = knot_coord - j;
|
||||
|
||||
// Would like to do this:
|
||||
//float cf[ 3] = { COEFS[ j], COEFS[ j + 1], COEFS[ j + 2]};
|
||||
// or at least:
|
||||
//cf[ 0] = COEFS[ j];
|
||||
//cf[ 1] = COEFS[ j + 1];
|
||||
//cf[ 2] = COEFS[ j + 2];
|
||||
// But apparently CTL bugs prevent it, so we do the following:
|
||||
float cf[ 3];
|
||||
if ( j <= 0) {
|
||||
cf[ 0] = COEFS0; cf[ 1] = COEFS1; cf[ 2] = COEFS2;
|
||||
}
|
||||
else if ( j == 1) {
|
||||
cf[ 0] = COEFS1; cf[ 1] = COEFS2; cf[ 2] = COEFS3;
|
||||
}
|
||||
else if ( j == 2) {
|
||||
cf[ 0] = COEFS2; cf[ 1] = COEFS3; cf[ 2] = COEFS4;
|
||||
}
|
||||
else if ( j == 3) {
|
||||
cf[ 0] = COEFS3; cf[ 1] = COEFS4; cf[ 2] = COEFS5;
|
||||
}
|
||||
else if ( j == 4) {
|
||||
cf[ 0] = COEFS4; cf[ 1] = COEFS5; cf[ 2] = COEFS6;
|
||||
}
|
||||
else if ( j == 5) {
|
||||
cf[ 0] = COEFS5; cf[ 1] = COEFS6; cf[ 2] = COEFS7;
|
||||
}
|
||||
else if ( j == 6) {
|
||||
cf[ 0] = COEFS6; cf[ 1] = COEFS7; cf[ 2] = COEFS8;
|
||||
}
|
||||
else if ( j == 7) {
|
||||
cf[ 0] = COEFS7; cf[ 1] = COEFS8; cf[ 2] = COEFS9;
|
||||
}
|
||||
else if ( j == 8) {
|
||||
cf[ 0] = COEFS8; cf[ 1] = COEFS9; cf[ 2] = COEFS10;
|
||||
}
|
||||
else {
|
||||
cf[ 0] = COEFS9; cf[ 1] = COEFS10; cf[ 2] = COEFS11;
|
||||
}
|
||||
|
||||
{
|
||||
float monomials[ 3] = { t * t, t, 1. };
|
||||
float v[3];
|
||||
|
||||
// XXX: check on this! maths could be different here (like row-major vs. column major or so)
|
||||
//out_dens = dot_f3_f3( monomials, mult_f3_f33( cf, M));
|
||||
|
||||
mul_v3_m3v3(v, M, cf);
|
||||
out_dens = dot_v3v3( monomials, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
y = pow10( -out_dens) - FLARE;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
|
||||
void IMB_ratio_preserving_odt_tonecurve_v3(const float rgbIn[3], float rgbOut[3])
|
||||
{
|
||||
//
|
||||
// The "ratio preserving tonecurve" is used to avoid hue/chroma shifts.
|
||||
// It sends a norm through the tonecurve and scales the RGB values based on the output.
|
||||
//
|
||||
|
||||
const float NTH_POWER = 2.0;
|
||||
const float TINY = 1e-12;
|
||||
|
||||
float numerator = ( pow(rgbIn[0],NTH_POWER) + pow(rgbIn[1],NTH_POWER) + pow(rgbIn[2],NTH_POWER) );
|
||||
float denominator = MAX2( TINY,
|
||||
( pow(rgbIn[0],NTH_POWER-1) +
|
||||
pow(rgbIn[1],NTH_POWER-1) +
|
||||
pow(rgbIn[2],NTH_POWER-1)
|
||||
)
|
||||
); // use of max function to avoid divide by zero
|
||||
float normRGB = numerator / denominator;
|
||||
if (normRGB <= 0.0) normRGB = TINY;
|
||||
|
||||
{
|
||||
float normRGBo = rdt_shaper_fwd( normRGB );
|
||||
|
||||
rgbOut[0] = rgbIn[0] * normRGBo / normRGB;
|
||||
rgbOut[1] = rgbIn[1] * normRGBo / normRGB;
|
||||
rgbOut[2] = rgbIn[2] * normRGBo / normRGB;
|
||||
}
|
||||
}
|
||||
|
||||
void IMB_ratio_preserving_odt_tonecurve_v4(const float rgbIn[4], float rgbOut[4])
|
||||
{
|
||||
IMB_ratio_preserving_odt_tonecurve_v3(rgbIn, rgbOut);
|
||||
|
||||
rgbOut[3] = rgbIn[3];
|
||||
}
|
||||
|
@ -689,6 +689,9 @@ typedef struct SpaceImage {
|
||||
char sticky; /* sticky selection type */
|
||||
char dt_uvstretch;
|
||||
char around;
|
||||
|
||||
/* color transformation */
|
||||
int view_transform, pad2;
|
||||
} SpaceImage;
|
||||
|
||||
|
||||
@ -752,6 +755,15 @@ typedef enum eSpaceImage_Flag {
|
||||
SI_COLOR_CORRECTION = (1 << 24),
|
||||
} eSpaceImage_Flag;
|
||||
|
||||
/* SpaceImage->flag */
|
||||
typedef enum eSpaceImage_ViewTransform {
|
||||
SI_VIEW_TRANSFORM_NONE = 0,
|
||||
SI_VIEW_TRANSFORM_ACES_ODT_TONECURVE = 1,
|
||||
SI_VIEW_TRANSFORM_OCIO_RAW = 2,
|
||||
SI_VIEW_TRANSFORM_OCIO_RRT = 3,
|
||||
SI_VIEW_TRANSFORM_OCIO_LOG = 4,
|
||||
} eSpaceImage_ViewTransform;
|
||||
|
||||
/* Text Editor ============================================ */
|
||||
|
||||
/* Text Editor */
|
||||
|
@ -1916,6 +1916,15 @@ static void rna_def_space_image(BlenderRNA *brna)
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
static EnumPropertyItem view_transform_items[] = {
|
||||
{SI_VIEW_TRANSFORM_NONE, "NONE", ICON_NONE, "None", ""},
|
||||
{SI_VIEW_TRANSFORM_ACES_ODT_TONECURVE, "ACES_TOMEMAP", ICON_NONE, "ACES ODT Tonecurve", ""},
|
||||
{SI_VIEW_TRANSFORM_OCIO_RAW, "OCIO_RAW", ICON_NONE, "OCIO RAW", ""},
|
||||
{SI_VIEW_TRANSFORM_OCIO_RRT, "OCIO_RRT", ICON_NONE, "OCIO RRT", ""},
|
||||
{SI_VIEW_TRANSFORM_OCIO_LOG, "OCIO_LOG", ICON_NONE, "OCIO LOG", ""},
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
srna = RNA_def_struct(brna, "SpaceImageEditor", "Space");
|
||||
RNA_def_struct_sdna(srna, "SpaceImage");
|
||||
RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
|
||||
@ -2020,6 +2029,12 @@ static void rna_def_space_image(BlenderRNA *brna)
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
|
||||
|
||||
prop = RNA_def_property(srna, "view_transform", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "view_transform");
|
||||
RNA_def_property_enum_items(prop, view_transform_items);
|
||||
RNA_def_property_ui_text(prop, "View Transform", "Transformation used on linear to sRGB conversion");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
|
||||
|
||||
rna_def_space_image_uv(brna);
|
||||
}
|
||||
|
||||
|
@ -142,4 +142,12 @@ if(WIN322)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
add_definitions(-DWITH_OCIO)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
add_definitions(-DWITH_OCIO)
|
||||
endif()
|
||||
|
||||
blender_add_lib_nolist(bf_windowmanager "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
@ -43,4 +43,10 @@ if env['BF_BUILDINFO']:
|
||||
if env['WITH_BF_INTERNATIONAL']:
|
||||
defs.append('WITH_INTERNATIONAL')
|
||||
|
||||
if env['WITH_BF_OCIO']:
|
||||
defs.append('WITH_OCIO')
|
||||
|
||||
if env['WITH_BF_OCIO']:
|
||||
defs.append('WITH_OCIO')
|
||||
|
||||
env.BlenderLib ( 'bf_windowmanager', sources, Split(incs), defines=defs, libtype=['core'], priority=[5] )
|
||||
|
@ -110,6 +110,10 @@
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_sound.h"
|
||||
|
||||
#ifdef WITH_OCIO
|
||||
#include "IMB_colormanagement.h"
|
||||
#endif
|
||||
|
||||
static void wm_init_reports(bContext *C)
|
||||
{
|
||||
BKE_reports_init(CTX_wm_reports(C), RPT_STORE);
|
||||
@ -199,6 +203,10 @@ void WM_init(bContext *C, int argc, const char **argv)
|
||||
#endif
|
||||
|
||||
BLI_strncpy(G.lib, G.main->name, FILE_MAX);
|
||||
|
||||
#ifdef WITH_OCIO
|
||||
IMB_colormanagement_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
void WM_init_splash(bContext *C)
|
||||
@ -452,6 +460,10 @@ void WM_exit_ext(bContext *C, const short do_python)
|
||||
getchar();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_OCIO
|
||||
IMB_colormanagement_exit();
|
||||
#endif
|
||||
}
|
||||
|
||||
void WM_exit(bContext *C)
|
||||
|
@ -147,6 +147,7 @@ endif()
|
||||
bf_intern_mikktspace
|
||||
extern_recastnavigation
|
||||
bf_intern_raskter
|
||||
bf_intern_opencolorio
|
||||
)
|
||||
|
||||
if(WITH_MOD_CLOTH_ELTOPO)
|
||||
|
@ -395,6 +395,13 @@ if(UNIX AND NOT APPLE)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
install(
|
||||
DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/colormanagement
|
||||
DESTINATION ${TARGETDIR_VER}/datafiles
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
if(WITH_PYTHON_INSTALL)
|
||||
# on some platforms (like openSUSE) Python is linked
|
||||
@ -625,6 +632,17 @@ elseif(WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
if(NOT MINGW)
|
||||
set_lib_path(OCIOBIN "opencolorio/bin")
|
||||
install(
|
||||
FILES
|
||||
${OCIOBIN}/OpenColorIO.dll
|
||||
DESTINATION ${TARGETDIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
elseif(APPLE)
|
||||
|
||||
# handy install macro to exclude files, we use \$ escape for the "to"
|
||||
@ -896,6 +914,7 @@ endif()
|
||||
bf_compositor #added for opencl compositor
|
||||
bf_opencl #added for opencl compositor
|
||||
bf_intern_raskter
|
||||
bf_intern_opencolorio
|
||||
)
|
||||
|
||||
if(WITH_LIBMV)
|
||||
|
Loading…
Reference in New Issue
Block a user