[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47963] branches/soc-2011-tomato: Commit current patch needed for color pipeline investigation in Mango Project
Sergey Sharybin
sergey.vfx at gmail.com
Fri Jun 15 17:00:55 CEST 2012
Revision: 47963
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47963
Author: nazgul
Date: 2012-06-15 15:00:51 +0000 (Fri, 15 Jun 2012)
Log Message:
-----------
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.
Modified Paths:
--------------
branches/soc-2011-tomato/CMakeLists.txt
branches/soc-2011-tomato/SConstruct
branches/soc-2011-tomato/build_files/cmake/macros.cmake
branches/soc-2011-tomato/build_files/scons/config/darwin-config.py
branches/soc-2011-tomato/build_files/scons/config/linux-config.py
branches/soc-2011-tomato/build_files/scons/config/win32-mingw-config.py
branches/soc-2011-tomato/build_files/scons/config/win32-vc-config.py
branches/soc-2011-tomato/build_files/scons/config/win64-mingw-config.py
branches/soc-2011-tomato/build_files/scons/config/win64-vc-config.py
branches/soc-2011-tomato/build_files/scons/tools/Blender.py
branches/soc-2011-tomato/build_files/scons/tools/btools.py
branches/soc-2011-tomato/intern/CMakeLists.txt
branches/soc-2011-tomato/intern/SConscript
branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py
branches/soc-2011-tomato/source/blender/editors/space_image/image_draw.c
branches/soc-2011-tomato/source/blender/imbuf/CMakeLists.txt
branches/soc-2011-tomato/source/blender/imbuf/IMB_imbuf.h
branches/soc-2011-tomato/source/blender/imbuf/IMB_imbuf_types.h
branches/soc-2011-tomato/source/blender/imbuf/SConscript
branches/soc-2011-tomato/source/blender/imbuf/intern/IMB_filter.h
branches/soc-2011-tomato/source/blender/imbuf/intern/allocimbuf.c
branches/soc-2011-tomato/source/blender/imbuf/intern/divers.c
branches/soc-2011-tomato/source/blender/imbuf/intern/filter.c
branches/soc-2011-tomato/source/blender/makesdna/DNA_space_types.h
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_space.c
branches/soc-2011-tomato/source/blender/windowmanager/CMakeLists.txt
branches/soc-2011-tomato/source/blender/windowmanager/SConscript
branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_init_exit.c
branches/soc-2011-tomato/source/blenderplayer/CMakeLists.txt
branches/soc-2011-tomato/source/creator/CMakeLists.txt
Added Paths:
-----------
branches/soc-2011-tomato/build_files/cmake/Modules/FindOpenColorIO.cmake
branches/soc-2011-tomato/intern/opencolorio/
branches/soc-2011-tomato/intern/opencolorio/CMakeLists.txt
branches/soc-2011-tomato/intern/opencolorio/SConscript
branches/soc-2011-tomato/intern/opencolorio/ocio_capi.cpp
branches/soc-2011-tomato/intern/opencolorio/ocio_capi.h
branches/soc-2011-tomato/release/datafiles/colormanagement/
branches/soc-2011-tomato/release/datafiles/colormanagement/config.ocio
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/adx_adx10_to_cdd.spimtx
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/adx_adx16_to_cdd.spimtx
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/adx_cdd_to_cid.spimtx
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/adx_cid_to_rle.py
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/adx_cid_to_rle.spi1d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/adx_exp_to_aces.spimtx
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/logc800.py
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/logc800.spi1d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/logc_to_aces.spimtx
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/rrt_ut33_dcdm.spi3d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/rrt_ut33_p3d60.spi3d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/rrt_ut33_p3dci.spi3d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/rrt_ut33_rec709.spi3d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/rrt_ut33_sRGB.spi3d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/slog.py
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/slog.spi1d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/slog10.spi1d
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/slog2.py
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/slogf35_to_aces.spimtx
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/slogf65_to_aces_3200.spimtx
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/slogf65_to_aces_5500.spimtx
branches/soc-2011-tomato/release/datafiles/colormanagement/luts/ten_bit_scale.spimtx
branches/soc-2011-tomato/source/blender/imbuf/IMB_colormanagement.h
branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c
Modified: branches/soc-2011-tomato/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/CMakeLists.txt 2012-06-15 14:47:34 UTC (rev 47962)
+++ branches/soc-2011-tomato/CMakeLists.txt 2012-06-15 15:00:51 UTC (rev 47963)
@@ -130,6 +130,7 @@
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 @@
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 @@
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 @@
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 @@
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")
Modified: branches/soc-2011-tomato/SConstruct
===================================================================
--- branches/soc-2011-tomato/SConstruct 2012-06-15 14:47:34 UTC (rev 47962)
+++ branches/soc-2011-tomato/SConstruct 2012-06-15 15:00:51 UTC (rev 47963)
@@ -608,7 +608,15 @@
kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel')
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['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)
Added: branches/soc-2011-tomato/build_files/cmake/Modules/FindOpenColorIO.cmake
===================================================================
--- branches/soc-2011-tomato/build_files/cmake/Modules/FindOpenColorIO.cmake (rev 0)
+++ branches/soc-2011-tomato/build_files/cmake/Modules/FindOpenColorIO.cmake 2012-06-15 15:00:51 UTC (rev 47963)
@@ -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
+)
+
Modified: branches/soc-2011-tomato/build_files/cmake/macros.cmake
===================================================================
--- branches/soc-2011-tomato/build_files/cmake/macros.cmake 2012-06-15 14:47:34 UTC (rev 47962)
+++ branches/soc-2011-tomato/build_files/cmake/macros.cmake 2012-06-15 15:00:51 UTC (rev 47963)
@@ -193,6 +193,9 @@
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 @@
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()
Modified: branches/soc-2011-tomato/build_files/scons/config/darwin-config.py
===================================================================
--- branches/soc-2011-tomato/build_files/scons/config/darwin-config.py 2012-06-15 14:47:34 UTC (rev 47962)
+++ branches/soc-2011-tomato/build_files/scons/config/darwin-config.py 2012-06-15 15:00:51 UTC (rev 47963)
@@ -277,6 +277,12 @@
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'
Modified: branches/soc-2011-tomato/build_files/scons/config/linux-config.py
===================================================================
--- branches/soc-2011-tomato/build_files/scons/config/linux-config.py 2012-06-15 14:47:34 UTC (rev 47962)
+++ branches/soc-2011-tomato/build_files/scons/config/linux-config.py 2012-06-15 15:00:51 UTC (rev 47963)
@@ -210,6 +210,16 @@
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'
Modified: branches/soc-2011-tomato/build_files/scons/config/win32-mingw-config.py
===================================================================
--- branches/soc-2011-tomato/build_files/scons/config/win32-mingw-config.py 2012-06-15 14:47:34 UTC (rev 47962)
+++ branches/soc-2011-tomato/build_files/scons/config/win32-mingw-config.py 2012-06-15 15:00:51 UTC (rev 47963)
@@ -159,6 +159,12 @@
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'
Modified: branches/soc-2011-tomato/build_files/scons/config/win32-vc-config.py
===================================================================
--- branches/soc-2011-tomato/build_files/scons/config/win32-vc-config.py 2012-06-15 14:47:34 UTC (rev 47962)
+++ branches/soc-2011-tomato/build_files/scons/config/win32-vc-config.py 2012-06-15 15:00:51 UTC (rev 47963)
@@ -156,6 +156,12 @@
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list