summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo F. Vescovi <mfv.debian@gmail.com>2013-08-20 09:53:19 +0100
committerMatteo F. Vescovi <mfv.debian@gmail.com>2013-08-20 09:53:19 +0100
commit66e5d9e2915733247bca47d077414ec2594aedad (patch)
treef4070a31bf015e159dadd34378cda703d8f6edea
opencolorio (1.0.8~dfsg0-2) unstable; urgency=low
* debian/rules: get-orig-source stuff added * debian/rules: useless dh addon removed * debian/rules: License.txt duplicate removed * debian/rules: SSE optimization disabled (Closes: #719174) * debian/libopencolorio1.symbols: file removed (Closes: #719175) # imported from the archive
-rw-r--r--.gitignore6
-rw-r--r--.pc/.quilt_patches1
-rw-r--r--.pc/.quilt_series1
-rw-r--r--.pc/.version1
-rw-r--r--.pc/0001-Fix_built-in_documentation_dependencies.patch/CMakeLists.txt406
-rw-r--r--.pc/0001-Fix_built-in_documentation_dependencies.patch/docs/CMakeLists.txt131
-rw-r--r--.pc/applied-patches1
-rw-r--r--.travis.yml23
-rw-r--r--CMakeLists.txt403
-rw-r--r--ChangeLog301
-rw-r--r--INSTALL1
-rw-r--r--LICENSE251
-rw-r--r--README20
-rw-r--r--debian/changelog15
-rw-r--r--debian/compat1
-rw-r--r--debian/control171
-rw-r--r--debian/copyright77
-rw-r--r--debian/docs1
-rw-r--r--debian/examples1
-rw-r--r--debian/libopencolorio-dev.install3
-rw-r--r--debian/libopencolorio1.install1
-rw-r--r--debian/manpages/ociobakelut.199
-rw-r--r--debian/manpages/ociocheck.135
-rw-r--r--debian/manpages/ocioconvert.128
-rw-r--r--debian/manpages/ociolutimage.143
-rw-r--r--debian/opencolorio-doc.doc-base11
-rw-r--r--debian/opencolorio-doc.install1
-rw-r--r--debian/opencolorio-doc.links2
-rw-r--r--debian/opencolorio-tools.install1
-rw-r--r--debian/opencolorio-tools.manpages1
-rw-r--r--debian/patches/0001-Fix_built-in_documentation_dependencies.patch116
-rw-r--r--debian/patches/series1
-rw-r--r--debian/python-pyopencolorio.install2
-rw-r--r--debian/repack.local2
-rwxr-xr-xdebian/repack.sh161
-rw-r--r--debian/repack.stub82
-rwxr-xr-xdebian/rules40
-rw-r--r--debian/source/format1
-rw-r--r--debian/watch3
-rw-r--r--docs/CMakeLists.txt73
-rwxr-xr-xdocs/ChangeLog.rst6
-rw-r--r--docs/CompatibleSoftware.rst268
-rw-r--r--docs/FAQ.rst141
-rwxr-xr-xdocs/License.rst5
-rw-r--r--docs/conf.py.in110
-rw-r--r--docs/configurations/allocation_vars.rst119
-rw-r--r--docs/configurations/images/spi-vfx/gn10_to_linear_light.jpegbin0 -> 34921 bytes
-rw-r--r--docs/configurations/images/spi-vfx/gnf_to_linear_light.jpegbin0 -> 34769 bytes
-rw-r--r--docs/configurations/images/spi-vfx/lg10_to_linear_light.jpegbin0 -> 37622 bytes
-rw-r--r--docs/configurations/images/spi-vfx/lg8_to_vd8.jpegbin0 -> 36153 bytes
-rw-r--r--docs/configurations/images/spi-vfx/lgf_to_linear_light.jpegbin0 -> 37440 bytes
-rw-r--r--docs/configurations/index.rst22
-rw-r--r--docs/configurations/nuke_default.rst19
-rw-r--r--docs/configurations/spi_anim.rst4
-rw-r--r--docs/configurations/spi_pipeline.rst74
-rw-r--r--docs/configurations/spi_vfx.rst186
-rw-r--r--docs/developers/api/index.rst6
-rw-r--r--docs/developers/bindings/PythonAPI.rst147
-rw-r--r--docs/developers/bindings/PythonTransforms.rst132
-rw-r--r--docs/developers/bindings/PythonTypes.rst9
-rw-r--r--docs/developers/coding_guidelines.rst109
-rw-r--r--docs/developers/getting_started.rst47
-rw-r--r--docs/developers/index.rst45
-rw-r--r--docs/developers/internal_architecture.rst287
-rw-r--r--docs/developers/issues.rst4
-rw-r--r--docs/developers/submitting_changes.rst14
-rw-r--r--docs/developers/usage_examples.rst357
-rw-r--r--docs/downloads.rst41
-rw-r--r--docs/index.rst77
-rw-r--r--docs/installation.rst234
-rw-r--r--docs/ociotheme/layout.html74
-rw-r--r--docs/ociotheme/page.html29
-rw-r--r--docs/ociotheme/searchbox.html12
-rw-r--r--docs/ociotheme/static/alert_info_32.pngbin0 -> 1168 bytes
-rw-r--r--docs/ociotheme/static/alert_warning_32.pngbin0 -> 1060 bytes
-rw-r--r--docs/ociotheme/static/bg-page.pngbin0 -> 164 bytes
-rw-r--r--docs/ociotheme/static/bullet_orange.pngbin0 -> 182 bytes
-rw-r--r--docs/ociotheme/static/clo_res19_lm10.0101.jpgbin0 -> 12478 bytes
-rw-r--r--docs/ociotheme/static/clo_res19_lnf.0101.jpgbin0 -> 13461 bytes
-rw-r--r--docs/ociotheme/static/clo_res19_vd16.0101.jpgbin0 -> 15721 bytes
-rw-r--r--docs/ociotheme/static/ocio.css_t469
-rw-r--r--docs/ociotheme/theme.conf13
-rw-r--r--docs/userguide/baking_luts.rst359
-rw-r--r--docs/userguide/contexts.rst361
-rw-r--r--docs/userguide/images/ps_icc/psicc_itworks.pngbin0 -> 272150 bytes
-rw-r--r--docs/userguide/images/ps_icc/psicc_open_current_profile.pngbin0 -> 45999 bytes
-rw-r--r--docs/userguide/images/ps_icc/psicc_proof_setup.pngbin0 -> 11632 bytes
-rw-r--r--docs/userguide/images/ps_icc/psicc_reveal_profile.pngbin0 -> 30846 bytes
-rw-r--r--docs/userguide/images/ps_icc/psicc_select_profile.pngbin0 -> 28233 bytes
-rw-r--r--docs/userguide/index.rst15
-rw-r--r--docs/userguide/looks.rst139
-rw-r--r--docs/userguide/tool_overview.rst168
-rw-r--r--export/OpenColorIO/OpenColorABI.h.in89
-rw-r--r--export/OpenColorIO/OpenColorIO.h1238
-rw-r--r--export/OpenColorIO/OpenColorTransforms.h812
-rw-r--r--export/OpenColorIO/OpenColorTypes.h397
-rw-r--r--export/PyOpenColorIO/PyOpenColorIO.h98
-rw-r--r--export/pkgconfig/OpenColorIO.pc.in10
-rw-r--r--share/cmake/FindNuke.cmake96
-rw-r--r--share/cmake/FindTinyXML.cmake59
-rw-r--r--share/cmake/FindTruelight.cmake87
-rw-r--r--share/cmake/OCIOMacros.cmake339
-rw-r--r--share/cmake/ParseArguments.cmake57
-rw-r--r--share/cmake/TestForDDImageVersion.cxx14
-rw-r--r--share/cmake/andriod-toolchain.cmake61
-rw-r--r--share/cmake/iPhone-armv6-toolchain.cmake42
-rw-r--r--share/cmake/iPhone-toolchain.cmake42
-rw-r--r--share/cmake/iPhoneSimulator-toolchain.cmake43
-rw-r--r--share/nuke/examples/colorlookup_to_spi1d.py24
-rw-r--r--share/nuke/examples/ocio_to_colorlookup_all.py36
-rw-r--r--share/nuke/examples/ocio_to_colorlookup_rgb.py29
-rw-r--r--share/nuke/init.py26
-rw-r--r--share/nuke/menu.py26
-rw-r--r--share/nuke/ocio_icon.pngbin0 -> 2507 bytes
-rw-r--r--share/nuke/ocionuke/__init__.py0
-rw-r--r--share/nuke/ocionuke/cdl.py269
-rw-r--r--share/nuke/ocionuke/viewer.py50
-rw-r--r--share/ocio/setup_ocio.sh.in14
-rwxr-xr-xshare/sphinx/ExtractRstFromSourceCPP.py324
-rwxr-xr-xshare/sphinx/ExtractRstFromSourceSimple.py110
-rw-r--r--src/aftereffects/DrawbotBot.cpp239
-rw-r--r--src/aftereffects/DrawbotBot.h89
-rwxr-xr-xsrc/aftereffects/OpenColorIO_AE.cpp1133
-rwxr-xr-xsrc/aftereffects/OpenColorIO_AE.h227
-rw-r--r--src/aftereffects/OpenColorIO_AE_ArbData.cpp408
-rw-r--r--src/aftereffects/OpenColorIO_AE_Context.cpp1051
-rw-r--r--src/aftereffects/OpenColorIO_AE_Context.h153
-rw-r--r--src/aftereffects/OpenColorIO_AE_Dialogs.h60
-rw-r--r--src/aftereffects/OpenColorIO_AE_GL.h61
-rw-r--r--src/aftereffects/OpenColorIO_AE_PiPL.r102
-rw-r--r--src/aftereffects/OpenColorIO_AE_UI.cpp1229
-rwxr-xr-xsrc/aftereffects/mac/OpenColorIO_AE.plugin-Info.plist24
-rw-r--r--src/aftereffects/mac/OpenColorIO_AE_Dialogs_Cocoa.mm237
-rw-r--r--src/aftereffects/mac/OpenColorIO_AE_GL_Cocoa.mm178
-rw-r--r--src/aftereffects/mac/OpenColorIO_AE_Menu.h45
-rw-r--r--src/aftereffects/mac/OpenColorIO_AE_Menu.m114
-rw-r--r--src/aftereffects/mac/OpenColorIO_AE_MonitorProfileChooser.xib494
-rw-r--r--src/aftereffects/mac/OpenColorIO_AE_MonitorProfileChooser_Controller.h46
-rw-r--r--src/aftereffects/mac/OpenColorIO_AE_MonitorProfileChooser_Controller.m195
-rw-r--r--src/aftereffects/vc/vc9/OpenColorABI.h100
-rw-r--r--src/aftereffects/vc/vc9/OpenColorIO.vcproj667
-rw-r--r--src/aftereffects/vc/vc9/aftereffects/OpenColorIO_AE.sln57
-rw-r--r--src/aftereffects/vc/vc9/aftereffects/OpenColorIO_AE.vcproj448
-rw-r--r--src/aftereffects/vc/vc9/ext/glew.vcproj319
-rw-r--r--src/aftereffects/vc/vc9/ext/lcms.vcproj407
-rw-r--r--src/aftereffects/vc/vc9/ext/tinyxml.vcproj323
-rw-r--r--src/aftereffects/vc/vc9/ext/yaml.vcproj603
-rw-r--r--src/aftereffects/win/OpenColorIO.rc99
-rw-r--r--src/aftereffects/win/OpenColorIO_AE_Dialogs_Win.cpp564
-rw-r--r--src/aftereffects/win/OpenColorIO_AE_GL_Win.cpp212
-rw-r--r--src/aftereffects/win/resource.h17
-rw-r--r--src/aftereffects/xcode/OpenColorABI.h100
-rw-r--r--src/aftereffects/xcode/OpenColorIO.xcodeproj/project.pbxproj589
-rwxr-xr-xsrc/aftereffects/xcode/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj509
-rw-r--r--src/aftereffects/xcode/ext/lcms.xcodeproj/project.pbxproj343
-rw-r--r--src/aftereffects/xcode/ext/tinyxml.xcodeproj/project.pbxproj248
-rw-r--r--src/aftereffects/xcode/ext/yaml.xcodeproj/project.pbxproj571
-rw-r--r--src/apps/ociobakelut/CMakeLists.txt46
-rw-r--r--src/apps/ociobakelut/main.cpp537
-rw-r--r--src/apps/ociobakelut/ocioicc.cpp251
-rw-r--r--src/apps/ociobakelut/ocioicc.h71
-rw-r--r--src/apps/ociocheck/CMakeLists.txt17
-rw-r--r--src/apps/ociocheck/main.cpp301
-rw-r--r--src/apps/ocioconvert/CMakeLists.txt16
-rw-r--r--src/apps/ocioconvert/main.cpp309
-rw-r--r--src/apps/ociodisplay/CMakeLists.txt11
-rw-r--r--src/apps/ociodisplay/main.cpp734
-rw-r--r--src/apps/ociolutimage/CMakeLists.txt16
-rw-r--r--src/apps/ociolutimage/main.cpp398
-rw-r--r--src/apps/share/argparse.cpp528
-rw-r--r--src/apps/share/argparse.h181
-rw-r--r--src/apps/share/pystring.cpp1658
-rw-r--r--src/apps/share/pystring.h438
-rw-r--r--src/apps/share/strutil.cpp86
-rw-r--r--src/apps/share/strutil.h83
-rw-r--r--src/core/AllocationOp.cpp128
-rw-r--r--src/core/AllocationOp.h45
-rw-r--r--src/core/AllocationTransform.cpp182
-rw-r--r--src/core/Baker.cpp297
-rw-r--r--src/core/CDLTransform.cpp776
-rw-r--r--src/core/CDLTransform.h53
-rw-r--r--src/core/CMakeLists.txt93
-rw-r--r--src/core/Caching.cpp47
-rw-r--r--src/core/ColorSpace.cpp270
-rw-r--r--src/core/ColorSpaceTransform.cpp246
-rw-r--r--src/core/Config.cpp2223
-rw-r--r--src/core/Context.cpp364
-rw-r--r--src/core/DisplayTransform.cpp410
-rw-r--r--src/core/Exception.cpp74
-rw-r--r--src/core/ExponentOps.cpp372
-rw-r--r--src/core/ExponentOps.h50
-rw-r--r--src/core/ExponentTransform.cpp151
-rw-r--r--src/core/FileFormat3DL.cpp638
-rw-r--r--src/core/FileFormatCC.cpp151
-rw-r--r--src/core/FileFormatCCC.cpp195
-rw-r--r--src/core/FileFormatCSP.cpp1112
-rw-r--r--src/core/FileFormatHDL.cpp1481
-rw-r--r--src/core/FileFormatIridasCube.cpp398
-rw-r--r--src/core/FileFormatIridasItx.cpp336
-rw-r--r--src/core/FileFormatIridasLook.cpp1356
-rw-r--r--src/core/FileFormatPandora.cpp286
-rw-r--r--src/core/FileFormatSpi1D.cpp261
-rw-r--r--src/core/FileFormatSpi3D.cpp209
-rw-r--r--src/core/FileFormatSpiMtx.cpp195
-rw-r--r--src/core/FileFormatTruelight.cpp620
-rw-r--r--src/core/FileFormatVF.cpp297
-rw-r--r--src/core/FileTransform.cpp579
-rw-r--r--src/core/FileTransform.h156
-rw-r--r--src/core/GpuShaderDesc.cpp131
-rw-r--r--src/core/GpuShaderUtils.cpp193
-rw-r--r--src/core/GpuShaderUtils.h58
-rw-r--r--src/core/GroupTransform.cpp196
-rw-r--r--src/core/HashUtils.cpp71
-rw-r--r--src/core/HashUtils.h48
-rw-r--r--src/core/ImageDesc.cpp392
-rw-r--r--src/core/ImagePacking.cpp407
-rw-r--r--src/core/ImagePacking.h71
-rw-r--r--src/core/LogOps.cpp499
-rw-r--r--src/core/LogOps.h57
-rw-r--r--src/core/LogTransform.cpp157
-rw-r--r--src/core/Logging.cpp156
-rw-r--r--src/core/Logging.h47
-rw-r--r--src/core/Look.cpp163
-rw-r--r--src/core/LookParse.cpp309
-rw-r--r--src/core/LookParse.h79
-rw-r--r--src/core/LookTransform.cpp405
-rw-r--r--src/core/Lut1DOp.cpp1038
-rw-r--r--src/core/Lut1DOp.h107
-rw-r--r--src/core/Lut3DOp.cpp982
-rw-r--r--src/core/Lut3DOp.h114
-rw-r--r--src/core/MathUtils.cpp603
-rw-r--r--src/core/MathUtils.h186
-rw-r--r--src/core/MatrixOps.cpp788
-rw-r--r--src/core/MatrixOps.h75
-rw-r--r--src/core/MatrixTransform.cpp386
-rw-r--r--src/core/Mutex.h115
-rw-r--r--src/core/NoOps.cpp641
-rw-r--r--src/core/NoOps.h67
-rw-r--r--src/core/OCIOYaml.cpp1218
-rw-r--r--src/core/OCIOYaml.h125
-rw-r--r--src/core/Op.cpp126
-rw-r--r--src/core/Op.h136
-rw-r--r--src/core/OpBuilders.h125
-rw-r--r--src/core/OpOptimizers.cpp364
-rw-r--r--src/core/ParseUtils.cpp438
-rw-r--r--src/core/ParseUtils.h89
-rw-r--r--src/core/PathUtils.cpp229
-rw-r--r--src/core/PathUtils.h95
-rw-r--r--src/core/Platform.h202
-rw-r--r--src/core/PrivateTypes.h54
-rw-r--r--src/core/Processor.cpp640
-rw-r--r--src/core/Processor.h132
-rw-r--r--src/core/SSE.h37
-rw-r--r--src/core/ScanlineHelper.cpp123
-rw-r--r--src/core/ScanlineHelper.h78
-rw-r--r--src/core/Transform.cpp175
-rw-r--r--src/core/TruelightOp.cpp395
-rw-r--r--src/core/TruelightOp.h44
-rw-r--r--src/core/TruelightTransform.cpp365
-rw-r--r--src/core/UnitTest.cpp39
-rw-r--r--src/core/UnitTest.h38
-rw-r--r--src/core/md5/md5.cpp391
-rw-r--r--src/core/md5/md5.h97
-rw-r--r--src/core/pystring/pystring.cpp1658
-rw-r--r--src/core/pystring/pystring.h438
-rw-r--r--src/core_tests/CMakeLists.txt51
-rw-r--r--src/core_tests/ocio_core_tests.sh.in8
-rw-r--r--src/jniglue/CMakeLists.txt92
-rw-r--r--src/jniglue/JNIBaker.cpp264
-rw-r--r--src/jniglue/JNIColorSpace.cpp239
-rw-r--r--src/jniglue/JNIConfig.cpp607
-rw-r--r--src/jniglue/JNIContext.cpp170
-rw-r--r--src/jniglue/JNIGlobals.cpp417
-rw-r--r--src/jniglue/JNIGpuShaderDesc.cpp125
-rw-r--r--src/jniglue/JNIImageDesc.cpp309
-rw-r--r--src/jniglue/JNILook.cpp131
-rw-r--r--src/jniglue/JNIProcessor.cpp133
-rw-r--r--src/jniglue/JNITransforms.cpp1151
-rw-r--r--src/jniglue/JNIUtil.cpp122
-rw-r--r--src/jniglue/JNIUtil.h282
-rw-r--r--src/jniglue/LoadLibrary.java.in40
-rw-r--r--src/jniglue/Manifest.txt.in7
-rw-r--r--src/jniglue/org/OpenColorIO/Allocation.java44
-rw-r--r--src/jniglue/org/OpenColorIO/AllocationTransform.java42
-rw-r--r--src/jniglue/org/OpenColorIO/Baker.java62
-rw-r--r--src/jniglue/org/OpenColorIO/BitDepth.java56
-rw-r--r--src/jniglue/org/OpenColorIO/CDLTransform.java56
-rw-r--r--src/jniglue/org/OpenColorIO/ColorSpace.java59
-rw-r--r--src/jniglue/org/OpenColorIO/ColorSpaceDirection.java44
-rw-r--r--src/jniglue/org/OpenColorIO/ColorSpaceTransform.java41
-rw-r--r--src/jniglue/org/OpenColorIO/Config.java96
-rw-r--r--src/jniglue/org/OpenColorIO/Context.java52
-rw-r--r--src/jniglue/org/OpenColorIO/DisplayTransform.java55
-rw-r--r--src/jniglue/org/OpenColorIO/ExceptionBase.java37
-rw-r--r--src/jniglue/org/OpenColorIO/ExceptionMissingFile.java37
-rw-r--r--src/jniglue/org/OpenColorIO/ExponentTransform.java39
-rw-r--r--src/jniglue/org/OpenColorIO/FileTransform.java46
-rw-r--r--src/jniglue/org/OpenColorIO/Globals.java78
-rw-r--r--src/jniglue/org/OpenColorIO/GpuLanguage.java46
-rw-r--r--src/jniglue/org/OpenColorIO/GpuShaderDesc.java46
-rw-r--r--src/jniglue/org/OpenColorIO/GroupTransform.java42
-rw-r--r--src/jniglue/org/OpenColorIO/ImageDesc.java36
-rw-r--r--src/jniglue/org/OpenColorIO/Interpolation.java48
-rw-r--r--src/jniglue/org/OpenColorIO/LogTransform.java39
-rw-r--r--src/jniglue/org/OpenColorIO/LoggingLevel.java48
-rw-r--r--src/jniglue/org/OpenColorIO/Look.java48
-rw-r--r--src/jniglue/org/OpenColorIO/LookTransform.java43
-rw-r--r--src/jniglue/org/OpenColorIO/MatrixTransform.java54
-rw-r--r--src/jniglue/org/OpenColorIO/PackedImageDesc.java59
-rw-r--r--src/jniglue/org/OpenColorIO/PlanarImageDesc.java63
-rw-r--r--src/jniglue/org/OpenColorIO/Processor.java51
-rw-r--r--src/jniglue/org/OpenColorIO/Transform.java41
-rw-r--r--src/jniglue/org/OpenColorIO/TransformDirection.java44
-rw-r--r--src/jniglue/org/OpenColorIO/TruelightTransform.java58
-rw-r--r--src/jniglue/tests/CMakeLists.txt17
-rw-r--r--src/jniglue/tests/org/OpenColorIO/BakerTest.java84
-rw-r--r--src/jniglue/tests/org/OpenColorIO/ColorSpaceTest.java41
-rw-r--r--src/jniglue/tests/org/OpenColorIO/ConfigTest.java220
-rw-r--r--src/jniglue/tests/org/OpenColorIO/ContextTest.java38
-rw-r--r--src/jniglue/tests/org/OpenColorIO/GlobalsTest.java150
-rw-r--r--src/jniglue/tests/org/OpenColorIO/GpuShaderDescTest.java24
-rw-r--r--src/jniglue/tests/org/OpenColorIO/LookTest.java35
-rw-r--r--src/jniglue/tests/org/OpenColorIO/OpenColorIOTestSuite.java30
-rw-r--r--src/jniglue/tests/org/OpenColorIO/PackedImageDescTest.java39
-rw-r--r--src/jniglue/tests/org/OpenColorIO/PlanarImageDescTest.java51
-rw-r--r--src/jniglue/tests/org/OpenColorIO/TransformsTest.java237
-rw-r--r--src/jniglue/tests/org/OpenColorIO/test.cc11
-rw-r--r--src/mari/1.4v1/README10
-rwxr-xr-xsrc/mari/1.4v1/_ocio_filter.py127
-rwxr-xr-xsrc/mari/1.4v1/_ocio_toolbar.py1279
-rwxr-xr-xsrc/mari/1.4v1/ocio.py789
-rw-r--r--src/mari/prototype/README3
-rw-r--r--src/mari/prototype/ociodisplay.py242
-rw-r--r--src/mari/prototype/ociofiletransform.py93
-rw-r--r--src/nuke/CMakeLists.txt138
-rw-r--r--src/nuke/OCIOCDLTransform/OCIOCDLTransform.cpp387
-rw-r--r--src/nuke/OCIOCDLTransform/OCIOCDLTransform.h137
-rw-r--r--src/nuke/OCIOColorSpace/OCIOColorSpace.cpp376
-rw-r--r--src/nuke/OCIOColorSpace/OCIOColorSpace.h120
-rw-r--r--src/nuke/OCIODisplay/OCIODisplay.cpp561
-rw-r--r--src/nuke/OCIODisplay/OCIODisplay.h133
-rw-r--r--src/nuke/OCIOFileTransform/OCIOFileTransform.cpp287
-rw-r--r--src/nuke/OCIOFileTransform/OCIOFileTransform.h128
-rw-r--r--src/nuke/OCIOLogConvert/OCIOLogConvert.cpp179
-rw-r--r--src/nuke/OCIOLogConvert/OCIOLogConvert.h101
-rw-r--r--src/nuke/OCIOLookTransform/OCIOLookTransform.cpp533
-rw-r--r--src/nuke/OCIOLookTransform/OCIOLookTransform.h140
-rw-r--r--src/pyglue/CMakeLists.txt106
-rw-r--r--src/pyglue/DocStrings/AllocationTransform.py54
-rw-r--r--src/pyglue/DocStrings/CDLTransform.py141
-rw-r--r--src/pyglue/DocStrings/ColorSpace.py103
-rw-r--r--src/pyglue/DocStrings/ColorSpaceTransform.py51
-rw-r--r--src/pyglue/DocStrings/Config.py527
-rw-r--r--src/pyglue/DocStrings/Constants.py43
-rw-r--r--src/pyglue/DocStrings/Context.py32
-rw-r--r--src/pyglue/DocStrings/DisplayTransform.py222
-rw-r--r--src/pyglue/DocStrings/Exception.py11
-rw-r--r--src/pyglue/DocStrings/ExceptionMissingFile.py11
-rw-r--r--src/pyglue/DocStrings/ExponentTransform.py31
-rw-r--r--src/pyglue/DocStrings/FileTransform.py19
-rw-r--r--src/pyglue/DocStrings/GroupTransform.py21
-rw-r--r--src/pyglue/DocStrings/LogTransform.py26
-rw-r--r--src/pyglue/DocStrings/Look.py35
-rw-r--r--src/pyglue/DocStrings/LookTransform.py19
-rw-r--r--src/pyglue/DocStrings/MatrixTransform.py29
-rw-r--r--src/pyglue/DocStrings/OpenColorIO.py17
-rw-r--r--src/pyglue/DocStrings/Processor.py141
-rw-r--r--src/pyglue/DocStrings/ProcessorMetadata.py34
-rw-r--r--src/pyglue/DocStrings/Transform.py19
-rw-r--r--src/pyglue/DocStrings/__init__.py23
-rw-r--r--src/pyglue/PyAllocationTransform.cpp300
-rw-r--r--src/pyglue/PyCDLTransform.cpp611
-rw-r--r--src/pyglue/PyColorSpace.cpp756
-rw-r--r--src/pyglue/PyColorSpace.h52
-rw-r--r--src/pyglue/PyColorSpaceTransform.cpp294
-rw-r--r--src/pyglue/PyConfig.cpp1220
-rw-r--r--src/pyglue/PyConfig.h52
-rw-r--r--src/pyglue/PyConstants.cpp239
-rw-r--r--src/pyglue/PyConstants.h41
-rw-r--r--src/pyglue/PyContext.cpp494
-rw-r--r--src/pyglue/PyContext.h52
-rw-r--r--src/pyglue/PyDisplayTransform.cpp577
-rw-r--r--src/pyglue/PyExponentTransform.cpp269
-rw-r--r--src/pyglue/PyFileTransform.cpp344
-rw-r--r--src/pyglue/PyGroupTransform.cpp397
-rw-r--r--src/pyglue/PyLogTransform.cpp251
-rw-r--r--src/pyglue/PyLook.cpp450
-rw-r--r--src/pyglue/PyLook.h50
-rw-r--r--src/pyglue/PyLookTransform.cpp343
-rw-r--r--src/pyglue/PyMain.cpp236
-rw-r--r--src/pyglue/PyMatrixTransform.cpp630
-rw-r--r--src/pyglue/PyProcessor.cpp500
-rw-r--r--src/pyglue/PyProcessor.h50
-rw-r--r--src/pyglue/PyProcessorMetadata.cpp245
-rw-r--r--src/pyglue/PyProcessorMetadata.h50
-rw-r--r--src/pyglue/PyTransform.cpp411
-rw-r--r--src/pyglue/PyTransform.h81
-rw-r--r--src/pyglue/PyUtil.cpp742
-rw-r--r--src/pyglue/PyUtil.h103
-rw-r--r--src/pyglue/createPyDocH.py86
-rw-r--r--src/rv/Makefile6
-rw-r--r--src/rv/Mu/rvload1
-rw-r--r--src/rv/Mu/rvload22
-rw-r--r--src/rv/Packages/.gitignore1
-rw-r--r--src/rv/Packages/rvinstall1
-rw-r--r--src/rv/Python/PACKAGE12
-rw-r--r--src/rv/Python/ociorv.py288
-rw-r--r--testdata/3dl.zipbin0 -> 47309 bytes
-rw-r--r--testdata/csp.zipbin0 -> 371798 bytes
-rw-r--r--testdata/cub.zipbin0 -> 68743 bytes
-rw-r--r--testdata/cube.zipbin0 -> 38160 bytes
-rw-r--r--testdata/iridas.zipbin0 -> 619494 bytes
-rw-r--r--testdata/itx.zipbin0 -> 45252 bytes
-rw-r--r--testdata/mga.zipbin0 -> 228540 bytes
-rw-r--r--testdata/spi.zipbin0 -> 199598 bytes
415 files changed, 83847 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7235cb8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+.DS_Store
+attic
+build*
+dist*
+mastercopy
+*.pyc
diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches
new file mode 100644
index 0000000..6857a8d
--- /dev/null
+++ b/.pc/.quilt_patches
@@ -0,0 +1 @@
+debian/patches
diff --git a/.pc/.quilt_series b/.pc/.quilt_series
new file mode 100644
index 0000000..c206706
--- /dev/null
+++ b/.pc/.quilt_series
@@ -0,0 +1 @@
+series
diff --git a/.pc/.version b/.pc/.version
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/.pc/.version
@@ -0,0 +1 @@
+2
diff --git a/.pc/0001-Fix_built-in_documentation_dependencies.patch/CMakeLists.txt b/.pc/0001-Fix_built-in_documentation_dependencies.patch/CMakeLists.txt
new file mode 100644
index 0000000..3e36ca5
--- /dev/null
+++ b/.pc/0001-Fix_built-in_documentation_dependencies.patch/CMakeLists.txt
@@ -0,0 +1,406 @@
+project(OpenColorIO)
+set(OCIO_VERSION_MAJOR 1)
+set(OCIO_VERSION_MINOR 0)
+set(OCIO_VERSION_PATCH 8)
+
+cmake_minimum_required(VERSION 2.8)
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/share/cmake)
+if(NOT DEFINED CMAKE_FIRST_RUN)
+ SET(CMAKE_FIRST_RUN 1 CACHE INTERNAL "")
+endif()
+
+###############################################################################
+### GLOBAL ###
+
+option(OCIO_BUILD_SHARED "Set to OFF to disable building the shared core library" ON)
+option(OCIO_BUILD_STATIC "Set to OFF to disable building the static core library" ON)
+option(OCIO_BUILD_TRUELIGHT "Set to OFF to disable truelight" ON)
+option(OCIO_BUILD_APPS "Set to OFF to disable command-line apps" ON)
+option(OCIO_BUILD_NUKE "Set to OFF to disable building nuke plugins" ON)
+option(OCIO_BUILD_DOCS "Specify whether to build documentation" OFF)
+option(OCIO_BUILD_TESTS "Specify whether to build unittests" OFF)
+option(OCIO_BUILD_PYGLUE "Specify whether to build python bindings" ON)
+option(OCIO_BUILD_JNIGLUE "Specify whether to build java bindings" OFF)
+option(OCIO_STATIC_JNIGLUE "Specify whether to statically link ocio to the java bindings" ON)
+
+option(OCIO_USE_SSE "Specify whether to enable SSE CPU performance optimizations" ON)
+
+# Use boost's shared_ptr by default on Windows (as <VS2010 doesn't have it),
+# Use std::tr1::shared_ptr by default on other platforms
+option(OCIO_USE_BOOST_PTR "Set to ON to enable boost shared_ptr (necessary when tr1 is not available)" WIN32)
+
+option(OCIO_PYGLUE_LINK "If ON, link the Python module to the core shared library" OFF)
+option(OCIO_PYGLUE_RESPECT_ABI "If ON, the Python module install path includes Python UCS version" OFF)
+option(OCIO_PYGLUE_SONAME "If ON, soname/soversion will be set for Python module library" OFF)
+option(OCIO_PYGLUE_LIB_PREFIX "If ON, prefix the Python module with 'lib'" OFF)
+
+if(UNIX AND NOT APPLE)
+ option(USE_EXTERNAL_YAML "Use system installed yaml-cpp library." OFF)
+ option(USE_EXTERNAL_TINYXML "Use system installed tinyxml library." OFF)
+ option(USE_EXTERNAL_LCMS "Use system install lcms2 library." OFF)
+endif()
+
+# This does not include the SOVERSION override, on purpose, so that the
+# OCIO_VERSION value will be an accurate reflection of the underlying library version.
+set(OCIO_VERSION "${OCIO_VERSION_MAJOR}.${OCIO_VERSION_MINOR}.${OCIO_VERSION_PATCH}")
+
+if(NOT SOVERSION)
+ set(SOVERSION ${OCIO_VERSION_MAJOR} CACHE STRING "Set the SO version in the SO name of the output library")
+endif()
+
+###############################################################################
+
+
+include(ParseArguments)
+include(OCIOMacros)
+include(ExternalProject)
+
+enable_language(CXX)
+
+ENABLE_TESTING()
+
+if(APPLE OR IPHONE)
+ if(NOT CMAKE_OSX_ARCHITECTURES)
+ set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
+ "Setting OSX Architectures, options are: ppc;i386;ppc64;x86_64"
+ FORCE)
+ endif()
+ if(CMAKE_FIRST_RUN)
+ message(STATUS "Setting OSX Architectures to: ${CMAKE_OSX_ARCHITECTURES}")
+ endif()
+endif()
+
+# Set the default built type
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+ FORCE)
+endif(NOT CMAKE_BUILD_TYPE)
+if(CMAKE_FIRST_RUN)
+ message(STATUS "Setting Build Type to: ${CMAKE_BUILD_TYPE}")
+endif()
+
+# Set the default namespace
+if(NOT OCIO_NAMESPACE)
+ set(OCIO_NAMESPACE OpenColorIO CACHE STRING
+ "Specify the master OCIO C++ namespace: Options include OpenColorIO OpenColorIO_<YOURFACILITY> etc."
+ FORCE)
+endif(NOT OCIO_NAMESPACE)
+messageonce("Setting Namespace to: ${OCIO_NAMESPACE}")
+
+# If CMAKE_INSTALL_EXEC_PREFIX is not specified, install binaries
+# directly into the regular install prefix
+if(NOT CMAKE_INSTALL_EXEC_PREFIX)
+ messageonce("Exec prefix not specified, defaulting to ${CMAKE_INSTALL_PREFIX}")
+ set(CMAKE_INSTALL_EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
+endif()
+
+messageonce("Use Boost Ptr: ${OCIO_USE_BOOST_PTR}")
+if(OCIO_USE_BOOST_PTR)
+ set(Boost_ADDITIONAL_VERSIONS "1.49" "1.45" "1.44" "1.43" "1.43.0" "1.42"
+ "1.42.0" "1.41" "1.41.0" "1.40"
+ "1.40.0" "1.39" "1.39.0" "1.38"
+ "1.38.0" "1.37" "1.37.0" "1.34.1"
+ "1_34_1")
+ set(Boost_USE_MULTITHREADED ON)
+ find_package(Boost 1.34)
+ if(NOT Boost_FOUND)
+ message(FATAL_ERROR "OCIO_USE_BOOST_PTR is specified, but a boost installation could not be found.")
+ else()
+ set(OCIO_USE_BOOST_PTR 1)
+ endif()
+
+ set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
+ # set(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} ${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
+else()
+ set(OCIO_USE_BOOST_PTR 0)
+endif()
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+ # Enable a bunch of compiler warnings...
+ # http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2")
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
+endif(CMAKE_COMPILER_IS_GNUCXX)
+
+if(WIN32)
+ if(PYTHON_VERSION AND PYTHON_INCLUDE AND PYTHON_LIB)
+ set(EXTDIST_PYTHONPATH ${PYTHON_LIB}/python${PYTHON_VARIANT_PATH}/site-packages)
+ set(PYTHONPATH ${EXTDIST_PYTHONPATH};$ENV{PYTHONPATH})
+ set(PYTHON_OK YES)
+ message(STATUS "Setting Python path to: ${PYTHONPATH}")
+ endif()
+else()
+ # Find Python, used for (possibly) building pyglue, and now to
+ # construct the external project path
+ OCIOFindPython()
+
+ set(EXTDIST_ROOT ${CMAKE_BINARY_DIR}/ext/dist)
+ set(EXTDIST_BINPATH ${EXTDIST_ROOT}/bin)
+ if(PYTHON_OK)
+ set(EXTDIST_PYTHONPATH ${EXTDIST_ROOT}/lib/python${PYTHON_VERSION}/site-packages)
+ set(PYTHONPATH ${EXTDIST_PYTHONPATH}:$ENV{PYTHONPATH})
+ endif()
+endif()
+
+messageonce("Setting EXTDIST_BINPATH: ${EXTDIST_BINPATH}")
+messageonce("Setting EXTDIST_PYTHONPATH: ${EXTDIST_PYTHONPATH}")
+
+###############################################################################
+### tinyxml ###
+
+if(USE_EXTERNAL_TINYXML)
+ set(TINYXML_VERSION_MIN "2.6.1")
+ find_package(TinyXML)
+ if(TINYXML_FOUND)
+ if(TINYXML_VERSION VERSION_EQUAL ${TINYXML_VERSION_MIN} OR
+ TINYXML_VERSION VERSION_GREATER ${TINYXML_VERSION_MIN})
+ message(STATUS "External TinyXML will be used.")
+ else()
+ message(FATAL_ERROR "ERROR: ${TINYXML_VERSION} found, but ${TINYXML_VERSION_MIN} or newer is required.")
+ endif()
+ else(TINYXML_FOUND)
+ message(STATUS "TinyXML was not found. Perhaps you forgot to install the development package?")
+ endif(TINYXML_FOUND)
+
+else(USE_EXTERNAL_TINYXML)
+ set(TINYXML_VERSION 2_6_1)
+ set(TINYXML_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/ext/dist)
+ if(CMAKE_TOOLCHAIN_FILE)
+ set(TINYXML_CMAKE_ARGS ${TINYXML_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
+ endif()
+ ExternalProject_Add(tinyxml
+ URL ${CMAKE_SOURCE_DIR}/ext/tinyxml_${TINYXML_VERSION}.tar.gz
+ PATCH_COMMAND patch -f -p1 < ${CMAKE_SOURCE_DIR}/ext/tinyxml_${TINYXML_VERSION}.patch
+ BINARY_DIR ext/build/tinyxml
+ INSTALL_DIR ext/dist
+ CMAKE_ARGS ${TINYXML_CMAKE_ARGS}
+ )
+ if(WIN32)
+ set(TINYXML_STATIC_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/tinyxml.lib)
+ else()
+ set(TINYXML_STATIC_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/libtinyxml.a)
+ endif()
+endif(USE_EXTERNAL_TINYXML)
+
+###############################################################################
+### YAML ###
+
+if(USE_EXTERNAL_YAML)
+ # Set minimum yaml version for non-patched sources.
+ set(YAML_VERSION_MIN "0.3.0")
+ include(FindPkgConfig)
+ pkg_check_modules(YAML_CPP yaml-cpp)
+ if(YAML_CPP_FOUND)
+ if(YAML_CPP_VERSION VERSION_EQUAL ${YAML_VERSION_MIN} OR
+ YAML_CPP_VERSION VERSION_GREATER ${YAML_VERSION_MIN})
+ message(STATUS "System yaml-cpp library will be used.")
+ include_directories(BEFORE ${YAML_CPP_INCLUDE_DIRS})
+ else()
+ message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.")
+ endif()
+ else(YAML_CPP_FOUND)
+ message(FATAL_ERROR "ERROR: System yaml-cpp library was not found. Make sure the library is installed and the pkg-config file exists.")
+ endif(YAML_CPP_FOUND)
+else(USE_EXTERNAL_YAML)
+ set(YAML_CPP_VERSION 0.3.0)
+ set(YAML_CPP_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/ext/dist -DYAML_CPP_BUILD_TOOLS:BOOL=FALSE)
+ if(CMAKE_TOOLCHAIN_FILE)
+ set(YAML_CPP_CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
+ endif()
+ ExternalProject_Add(YAML_CPP_LOCAL
+ URL ${CMAKE_SOURCE_DIR}/ext/yaml-cpp-${YAML_CPP_VERSION}.tar.gz
+ BINARY_DIR ext/build/yaml-cpp
+ PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/ext/yaml-cpp-${YAML_CPP_VERSION}.patch
+ INSTALL_DIR ext/dist
+ CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS}
+ )
+ set(YAML_CPP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ext/dist/include)
+ set(YAML_CPP_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)
+ if(WIN32)
+ set(YAML_CPP_STATIC_DEBUG_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/libyaml-cppmdd.lib)
+ set(YAML_CPP_STATIC_OPTIMIZED_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/libyaml-cppmd.lib)
+ else()
+ set(YAML_CPP_STATIC_GENERAL_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/libyaml-cpp.a)
+ endif()
+endif(USE_EXTERNAL_YAML)
+
+
+
+###############################################################################
+### Externals ###
+
+set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/ext/dist/include)
+set(EXTERNAL_COMPILE_FLAGS "-DTIXML_USE_STL")
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+ OUTPUT_VARIABLE GCC_VERSION)
+
+ if (GCC_VERSION VERSION_LESS 4.2)
+ message(STATUS "GCC Version < 4.2 - symbol visibility hiding disabled")
+ set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -fPIC")
+ else()
+ set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -fPIC -fvisibility-inlines-hidden -fvisibility=hidden")
+ endif()
+endif()
+
+set(EXTERNAL_LINK_FLAGS "")
+set(EXTERNAL_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)
+set(EXTERNAL_DEBUG_LIBRARIES ${YAML_CPP_STATIC_DEBUG_LIBRARIES})
+set(EXTERNAL_OPTIMIZED_LIBRARIES ${YAML_CPP_STATIC_OPTIMIZED_LIBRARIES})
+set(EXTERNAL_GENERAL_LIBRARIES ${TINYXML_STATIC_LIBRARIES} ${YAML_CPP_STATIC_GENERAL_LIBRARIES})
+
+###############################################################################
+### Documentation ###
+
+messageonce("Generate Documentation: ${OCIO_BUILD_DOCS}")
+
+if(OCIO_BUILD_DOCS)
+ if(PYTHON_OK)
+ add_subdirectory(docs)
+ else()
+ message(STATUS "Building the documentation requires Python, but locating Python failed: ${PYTHON_ERR}")
+ endif()
+endif()
+
+###############################################################################
+### SSE ###
+
+messageonce("SSE Optimizations: ${OCIO_USE_SSE}")
+
+if(OCIO_USE_SSE)
+ if(WIN32)
+ # SSE instructions are automatically compiled into 64-bit applications so enabling the option is redundant and
+ # actually produces an unknown option warning in Visual Studio.
+ if(NOT CMAKE_CL_64)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
+ endif()
+ else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+ endif()
+ add_definitions("-DUSE_SSE")
+endif()
+
+###############################################################################
+### TRUELIGHT ###
+
+if(OCIO_BUILD_TRUELIGHT)
+ find_package(Truelight)
+ if(TRUELIGHT_FOUND)
+ messageonce("Will build the truelight transform support against ${Truelight_LIBRARY_DIR}")
+ add_definitions(-DOCIO_TRUELIGHT_SUPPORT)
+ set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${Truelight_INCLUDE_DIR})
+ set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} ${Truelight_COMPILE_FLAGS}")
+ set(EXTERNAL_LINK_FLAGS "${EXTERNAL_LINK_FLAGS} ${Truelight_LINK_FLAGS}")
+ set(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} ${Truelight_LIBRARIES})
+ else()
+ messageonce("Not building truelight transform support. Add the flag -D TRUELIGHT_INSTALL_PATH=... or set the TRUELIGHT_ROOT environment variable")
+ endif()
+endif()
+
+###############################################################################
+### CORE ###
+
+add_subdirectory(src/core)
+
+messageonce("Build Unit Tests: ${OCIO_BUILD_TESTS}")
+if(OCIO_BUILD_TESTS)
+ add_subdirectory(src/core_tests)
+endif()
+
+###############################################################################
+### APPS ###
+
+if(OCIO_BUILD_APPS)
+ # Try to find OpenImageIO (OIIO) and OpenGL stuff
+ OCIOFindOpenImageIO()
+
+ if(OIIO_FOUND)
+ add_subdirectory(src/apps/ocioconvert)
+ add_subdirectory(src/apps/ociolutimage)
+ else()
+ messageonce("Not building ocioconvert/ociolutimage. Requirement(s) found: OIIO:${OIIO_FOUND}")
+ endif()
+
+ # ociodisplay, displays color-transformed images (uses OpenImageIO,
+ # and OpenGL)
+ OCIOFindOpenGL()
+ if(OPENGL_FOUND AND GLUT_FOUND AND GLEW_FOUND AND OIIO_FOUND)
+ add_subdirectory(src/apps/ociodisplay)
+ else()
+ messageonce("Not building ociodisplay. Requirement(s) found, OpenGL:${OPENGL_FOUND}, GLUT:${GLUT_FOUND}, GLEW:${GLEW_FOUND}, OIIO:${OIIO_FOUND}")
+ endif()
+
+ # ociocheck: verifies an OCIO config
+ add_subdirectory(src/apps/ociocheck)
+
+ # ociobakelut writes out luts
+ add_subdirectory(src/apps/ociobakelut)
+endif()
+
+###############################################################################
+### NUKE ###
+
+if(OCIO_BUILD_NUKE)
+ find_package(Nuke)
+ if(NUKE_FOUND)
+ messageonce("Will build the Nuke plugins against ${Nuke_LIBRARY_DIR}")
+ add_subdirectory(src/nuke)
+ else()
+ messageonce("Not building Nuke plugins. Add the flag -D NUKE_INSTALL_PATH=... or set the NDK_PATH environment variable")
+ endif()
+endif()
+
+###############################################################################
+### PYGLUE ###
+
+if(OCIO_BUILD_PYGLUE)
+ if(PYTHON_OK)
+ add_subdirectory(src/pyglue)
+ else()
+ messageonce("Python bindings will not be built: ${PYTHON_ERR}")
+ endif()
+endif()
+
+###############################################################################
+### JNIGLUE ###
+
+if(OCIO_BUILD_JNIGLUE)
+ OCIOFindJava()
+ if(Java_FOUND)
+ add_subdirectory(src/jniglue)
+ else()
+ messageonce("Java bindings will not be built as we can't find Java")
+ endif()
+endif()
+
+###############################################################################
+### Configure env script ###
+configure_file(${CMAKE_SOURCE_DIR}/share/ocio/setup_ocio.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh @ONLY)
+
+INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh DESTINATION share/ocio/)
+
+###############################################################################
+### CPACK ###
+
+set(CPACK_PACKAGE_VERSION_MAJOR ${SOVERSION})
+set(CPACK_PACKAGE_VERSION_MINOR ${OCIO_VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${OCIO_VERSION_PATCH})
+set(CPACK_GENERATOR None)
+set(CPACK_SOURCE_GENERATOR TGZ)
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "ocio.${OCIO_VERSION}")
+include(CPack)
+
+###############################################################################
+### CTEST ###
+
+add_custom_target(test_verbose
+ COMMAND ctest -VV
+ DEPENDS ocio_core_tests
+ COMMENT "Running ctest with verbose output")
+
+# Log CMake first run done
+SET(CMAKE_FIRST_RUN 0 CACHE INTERNAL "")
diff --git a/.pc/0001-Fix_built-in_documentation_dependencies.patch/docs/CMakeLists.txt b/.pc/0001-Fix_built-in_documentation_dependencies.patch/docs/CMakeLists.txt
new file mode 100644
index 0000000..0cbfd67
--- /dev/null
+++ b/.pc/0001-Fix_built-in_documentation_dependencies.patch/docs/CMakeLists.txt
@@ -0,0 +1,131 @@
+
+###############################################################################
+### External Doc Apps ###
+
+# setuptools
+set(SETUPTOOLS_VERSION 0.6c11)
+ExternalProject_Add(setuptools
+ URL ${CMAKE_SOURCE_DIR}/ext/setuptools-${SETUPTOOLS_VERSION}.tar.gz
+ BUILD_IN_SOURCE 1
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+ BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+ INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT}
+)
+
+# docutils
+set(DOCUTILS_VERSION 0.7)
+ExternalProject_Add(docutils
+ DEPENDS setuptools
+ URL ${CMAKE_SOURCE_DIR}/ext/docutils-${DOCUTILS_VERSION}.tar.gz
+ BUILD_IN_SOURCE 1
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+ BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+ INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT}
+)
+
+# jinja2
+set(JINJA2_VERSION 2.5.5)
+ExternalProject_Add(Jinja2
+ DEPENDS setuptools
+ URL ${CMAKE_SOURCE_DIR}/ext/Jinja2-${JINJA2_VERSION}.tar.gz
+ BUILD_IN_SOURCE 1
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+ BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+ INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT}
+)
+
+# Pygments
+set(PYGMENTS_VERSION 1.3.1)
+ExternalProject_Add(Pygments
+ DEPENDS setuptools
+ URL ${CMAKE_SOURCE_DIR}/ext/Pygments-${PYGMENTS_VERSION}.tar.gz
+ BUILD_IN_SOURCE 1
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+ BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+ INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT}
+)
+
+# sphinx
+set(SPHINX_VERSION f52b631f501a) # 1.1pre
+ExternalProject_Add(Sphinx
+ DEPENDS setuptools docutils Jinja2 Pygments
+ URL ${CMAKE_SOURCE_DIR}/ext/sphinx-${SPHINX_VERSION}.tar.gz
+ PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/ext/sphinx-${SPHINX_VERSION}.patch
+ BUILD_IN_SOURCE 1
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+ BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+ INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT} --install-scripts=${EXTDIST_ROOT}/bin
+)
+
+###############################################################################
+### Create Doc Targets ###
+
+message(STATUS "Create sphinx conf.py from conf.py.in")
+configure_file(${CMAKE_SOURCE_DIR}/docs/conf.py.in
+ ${CMAKE_BINARY_DIR}/docs/conf.py @ONLY)
+
+message(STATUS "Copying doc to staging area")
+file(COPY ${CMAKE_SOURCE_DIR}/docs/ DESTINATION ${CMAKE_BINARY_DIR}/docs)
+
+message(STATUS "Copy extra doc files to staging area")
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/README)
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/INSTALL)
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/ChangeLog)
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/LICENSE)
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/share/nuke/ocionuke/viewer.py)
+CopyFiles(RSTDOC ${DOCFILES})
+
+message(STATUS "Extracting .rst files from C++ headers")
+ExtractRstCPP(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorIO.h developers/api/OpenColorIO.rst)
+ExtractRstCPP(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorTransforms.h developers/api/OpenColorTransforms.rst)
+ExtractRstCPP(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorTypes.h developers/api/OpenColorTypes.rst)
+
+add_custom_target(doc ALL
+ COMMAND PYTHONPATH=${PYTHONPATH} ${EXTDIST_BINPATH}/sphinx-build -b html . ${CMAKE_CURRENT_BINARY_DIR}/build-html
+ DEPENDS
+ OpenColorIO
+ PyOpenColorIO
+ ${CMAKE_BINARY_DIR}/docs/conf.py
+ developers/api/OpenColorIO.rst
+ developers/api/OpenColorTransforms.rst
+ developers/api/OpenColorTypes.rst
+ ${RSTDOC_OUTPUT}
+ COMMENT "Building html docs"
+ SOURCES ${DOCFILES})
+
+# note: ExternalProject will not build when added to a add_custom_target this
+# works around this problem. This seems to be fixed in the cmake ^HEAD
+add_dependencies(doc Sphinx)
+
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build-html/
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/OpenColorIO/html
+ PATTERN .* EXCLUDE
+)
+
+find_package(LATEX)
+if(PDFLATEX_COMPILER)
+
+ add_custom_target(latex
+ COMMAND PYTHONPATH=${PYTHONPATH} ${EXTDIST_BINPATH}/sphinx-build -b latex . ${CMAKE_CURRENT_BINARY_DIR}/build-latex
+ DEPENDS
+ OpenColorIO
+ ${CMAKE_BINARY_DIR}/docs/conf.py
+ developers/api/OpenColorIO.rst
+ developers/api/OpenColorTransforms.rst
+ developers/api/OpenColorTypes.rst
+ ${RSTDOC_OUTPUT}
+ COMMENT "Building latex doc"
+ SOURCES ${DOCFILES})
+ add_dependencies(latex Sphinx)
+
+ add_custom_target(pdf ALL
+ COMMAND ${PDFLATEX_COMPILER} OpenColorIO.tex
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build-latex
+ COMMENT "Building pdf doc"
+ SOURCES ${DOCFILES})
+ add_dependencies(pdf latex)
+
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/build-latex/OpenColorIO.pdf
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/OpenColorIO/)
+
+endif()
diff --git a/.pc/applied-patches b/.pc/applied-patches
new file mode 100644
index 0000000..9db761e
--- /dev/null
+++ b/.pc/applied-patches
@@ -0,0 +1 @@
+0001-Fix_built-in_documentation_dependencies.patch
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..2b59b18
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+# travis-ci.org build file
+
+# As CMake is not officially supported we use erlang VMs
+language: erlang
+
+# Settings to try
+env:
+ - OPTIONS="-DCMAKE_BUILD_TYPE=Release -DOCIO_BUILD_TESTS=yes"
+
+# Make sure CMake is installed
+install:
+ - sudo apt-get install cmake
+
+# Run the Build script
+script:
+ - mkdir _build
+ - cd _build
+ - cmake .. -DCMAKE_INSTALL_PREFIX=../_install $OPTIONS
+ - cmake --build . --target install
+
+# Run Tests
+after_script:
+ - ctest --output-on-failure .
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..a0e6adb
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,403 @@
+project(OpenColorIO)
+set(OCIO_VERSION_MAJOR 1)
+set(OCIO_VERSION_MINOR 0)
+set(OCIO_VERSION_PATCH 8)
+
+cmake_minimum_required(VERSION 2.8)
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/share/cmake)
+if(NOT DEFINED CMAKE_FIRST_RUN)
+ SET(CMAKE_FIRST_RUN 1 CACHE INTERNAL "")
+endif()
+
+###############################################################################
+### GLOBAL ###
+
+option(OCIO_BUILD_SHARED "Set to OFF to disable building the shared core library" ON)
+option(OCIO_BUILD_STATIC "Set to OFF to disable building the static core library" ON)
+option(OCIO_BUILD_TRUELIGHT "Set to OFF to disable truelight" ON)
+option(OCIO_BUILD_APPS "Set to OFF to disable command-line apps" ON)
+option(OCIO_BUILD_NUKE "Set to OFF to disable building nuke plugins" ON)
+option(OCIO_BUILD_DOCS "Specify whether to build documentation" OFF)
+option(OCIO_BUILD_TESTS "Specify whether to build unittests" OFF)
+option(OCIO_BUILD_PYGLUE "Specify whether to build python bindings" ON)
+option(OCIO_BUILD_JNIGLUE "Specify whether to build java bindings" OFF)
+option(OCIO_STATIC_JNIGLUE "Specify whether to statically link ocio to the java bindings" ON)
+
+option(OCIO_USE_SSE "Specify whether to enable SSE CPU performance optimizations" ON)
+
+# Use boost's shared_ptr by default on Windows (as <VS2010 doesn't have it),
+# Use std::tr1::shared_ptr by default on other platforms
+option(OCIO_USE_BOOST_PTR "Set to ON to enable boost shared_ptr (necessary when tr1 is not available)" WIN32)
+
+option(OCIO_PYGLUE_LINK "If ON, link the Python module to the core shared library" OFF)
+option(OCIO_PYGLUE_RESPECT_ABI "If ON, the Python module install path includes Python UCS version" OFF)
+option(OCIO_PYGLUE_SONAME "If ON, soname/soversion will be set for Python module library" OFF)
+option(OCIO_PYGLUE_LIB_PREFIX "If ON, prefix the Python module with 'lib'" OFF)
+
+if(UNIX AND NOT APPLE)
+ option(USE_EXTERNAL_YAML "Use system installed yaml-cpp library." OFF)
+ option(USE_EXTERNAL_TINYXML "Use system installed tinyxml library." OFF)
+ option(USE_EXTERNAL_LCMS "Use system install lcms2 library." OFF)
+endif()
+
+# This does not include the SOVERSION override, on purpose, so that the
+# OCIO_VERSION value will be an accurate reflection of the underlying library version.
+set(OCIO_VERSION "${OCIO_VERSION_MAJOR}.${OCIO_VERSION_MINOR}.${OCIO_VERSION_PATCH}")
+
+if(NOT SOVERSION)
+ set(SOVERSION ${OCIO_VERSION_MAJOR} CACHE STRING "Set the SO version in the SO name of the output library")
+endif()
+
+###############################################################################
+
+
+include(ParseArguments)
+include(OCIOMacros)
+include(ExternalProject)
+
+enable_language(CXX)
+
+ENABLE_TESTING()
+
+if(APPLE OR IPHONE)
+ if(NOT CMAKE_OSX_ARCHITECTURES)
+ set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
+ "Setting OSX Architectures, options are: ppc;i386;ppc64;x86_64"
+ FORCE)
+ endif()
+ if(CMAKE_FIRST_RUN)
+ message(STATUS "Setting OSX Architectures to: ${CMAKE_OSX_ARCHITECTURES}")
+ endif()
+endif()
+
+# Set the default built type
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+ FORCE)
+endif(NOT CMAKE_BUILD_TYPE)
+if(CMAKE_FIRST_RUN)
+ message(STATUS "Setting Build Type to: ${CMAKE_BUILD_TYPE}")
+endif()
+
+# Set the default namespace
+if(NOT OCIO_NAMESPACE)
+ set(OCIO_NAMESPACE OpenColorIO CACHE STRING
+ "Specify the master OCIO C++ namespace: Options include OpenColorIO OpenColorIO_<YOURFACILITY> etc."
+ FORCE)
+endif(NOT OCIO_NAMESPACE)
+messageonce("Setting Namespace to: ${OCIO_NAMESPACE}")
+
+# If CMAKE_INSTALL_EXEC_PREFIX is not specified, install binaries
+# directly into the regular install prefix
+if(NOT CMAKE_INSTALL_EXEC_PREFIX)
+ messageonce("Exec prefix not specified, defaulting to ${CMAKE_INSTALL_PREFIX}")
+ set(CMAKE_INSTALL_EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
+endif()
+
+messageonce("Use Boost Ptr: ${OCIO_USE_BOOST_PTR}")
+if(OCIO_USE_BOOST_PTR)
+ set(Boost_ADDITIONAL_VERSIONS "1.49" "1.45" "1.44" "1.43" "1.43.0" "1.42"
+ "1.42.0" "1.41" "1.41.0" "1.40"
+ "1.40.0" "1.39" "1.39.0" "1.38"
+ "1.38.0" "1.37" "1.37.0" "1.34.1"
+ "1_34_1")
+ set(Boost_USE_MULTITHREADED ON)
+ find_package(Boost 1.34)
+ if(NOT Boost_FOUND)
+ message(FATAL_ERROR "OCIO_USE_BOOST_PTR is specified, but a boost installation could not be found.")
+ else()
+ set(OCIO_USE_BOOST_PTR 1)
+ endif()
+
+ set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
+ # set(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} ${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
+else()
+ set(OCIO_USE_BOOST_PTR 0)
+endif()
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+ # Enable a bunch of compiler warnings...
+ # http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2")
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
+endif(CMAKE_COMPILER_IS_GNUCXX)
+
+if(WIN32)
+ if(PYTHON_VERSION AND PYTHON_INCLUDE AND PYTHON_LIB)
+ set(EXTDIST_PYTHONPATH ${PYTHON_LIB}/python${PYTHON_VARIANT_PATH}/site-packages)
+ set(PYTHONPATH ${EXTDIST_PYTHONPATH};$ENV{PYTHONPATH})
+ set(PYTHON_OK YES)
+ message(STATUS "Setting Python path to: ${PYTHONPATH}")
+ endif()
+else()
+ # Find Python, used for (possibly) building pyglue, and now to
+ # construct the external project path
+ OCIOFindPython()
+
+ if(PYTHON_OK)
+ set(EXTDIST_PYTHONPATH /usr/lib/python${PYTHON_VERSION}/dist-packages)
+ set(PYTHONPATH ${EXTDIST_PYTHONPATH}:$ENV{PYTHONPATH})
+ endif()
+endif()
+
+messageonce("Setting EXTDIST_PYTHONPATH: ${EXTDIST_PYTHONPATH}")
+
+###############################################################################
+### tinyxml ###
+
+if(USE_EXTERNAL_TINYXML)
+ set(TINYXML_VERSION_MIN "2.6.1")
+ find_package(TinyXML)
+ if(TINYXML_FOUND)
+ if(TINYXML_VERSION VERSION_EQUAL ${TINYXML_VERSION_MIN} OR
+ TINYXML_VERSION VERSION_GREATER ${TINYXML_VERSION_MIN})
+ message(STATUS "External TinyXML will be used.")
+ else()
+ message(FATAL_ERROR "ERROR: ${TINYXML_VERSION} found, but ${TINYXML_VERSION_MIN} or newer is required.")
+ endif()
+ else(TINYXML_FOUND)
+ message(STATUS "TinyXML was not found. Perhaps you forgot to install the development package?")
+ endif(TINYXML_FOUND)
+
+else(USE_EXTERNAL_TINYXML)
+ set(TINYXML_VERSION 2_6_1)
+ set(TINYXML_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/ext/dist)
+ if(CMAKE_TOOLCHAIN_FILE)
+ set(TINYXML_CMAKE_ARGS ${TINYXML_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
+ endif()
+ ExternalProject_Add(tinyxml
+ URL ${CMAKE_SOURCE_DIR}/ext/tinyxml_${TINYXML_VERSION}.tar.gz
+ PATCH_COMMAND patch -f -p1 < ${CMAKE_SOURCE_DIR}/ext/tinyxml_${TINYXML_VERSION}.patch
+ BINARY_DIR ext/build/tinyxml
+ INSTALL_DIR ext/dist
+ CMAKE_ARGS ${TINYXML_CMAKE_ARGS}
+ )
+ if(WIN32)
+ set(TINYXML_STATIC_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/tinyxml.lib)
+ else()
+ set(TINYXML_STATIC_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/libtinyxml.a)
+ endif()
+endif(USE_EXTERNAL_TINYXML)
+
+###############################################################################
+### YAML ###
+
+if(USE_EXTERNAL_YAML)
+ # Set minimum yaml version for non-patched sources.
+ set(YAML_VERSION_MIN "0.3.0")
+ include(FindPkgConfig)
+ pkg_check_modules(YAML_CPP yaml-cpp)
+ if(YAML_CPP_FOUND)
+ if(YAML_CPP_VERSION VERSION_EQUAL ${YAML_VERSION_MIN} OR
+ YAML_CPP_VERSION VERSION_GREATER ${YAML_VERSION_MIN})
+ message(STATUS "System yaml-cpp library will be used.")
+ include_directories(BEFORE ${YAML_CPP_INCLUDE_DIRS})
+ else()
+ message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.")
+ endif()
+ else(YAML_CPP_FOUND)
+ message(FATAL_ERROR "ERROR: System yaml-cpp library was not found. Make sure the library is installed and the pkg-config file exists.")
+ endif(YAML_CPP_FOUND)
+else(USE_EXTERNAL_YAML)
+ set(YAML_CPP_VERSION 0.3.0)
+ set(YAML_CPP_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/ext/dist -DYAML_CPP_BUILD_TOOLS:BOOL=FALSE)
+ if(CMAKE_TOOLCHAIN_FILE)
+ set(YAML_CPP_CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
+ endif()
+ ExternalProject_Add(YAML_CPP_LOCAL
+ URL ${CMAKE_SOURCE_DIR}/ext/yaml-cpp-${YAML_CPP_VERSION}.tar.gz
+ BINARY_DIR ext/build/yaml-cpp
+ PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/ext/yaml-cpp-${YAML_CPP_VERSION}.patch
+ INSTALL_DIR ext/dist
+ CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS}
+ )
+ set(YAML_CPP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ext/dist/include)
+ set(YAML_CPP_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)
+ if(WIN32)
+ set(YAML_CPP_STATIC_DEBUG_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/libyaml-cppmdd.lib)
+ set(YAML_CPP_STATIC_OPTIMIZED_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/libyaml-cppmd.lib)
+ else()
+ set(YAML_CPP_STATIC_GENERAL_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/libyaml-cpp.a)
+ endif()
+endif(USE_EXTERNAL_YAML)
+
+
+
+###############################################################################
+### Externals ###
+
+set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/ext/dist/include)
+set(EXTERNAL_COMPILE_FLAGS "-DTIXML_USE_STL")
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+ OUTPUT_VARIABLE GCC_VERSION)
+
+ if (GCC_VERSION VERSION_LESS 4.2)
+ message(STATUS "GCC Version < 4.2 - symbol visibility hiding disabled")
+ set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -fPIC")
+ else()
+ set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -fPIC -fvisibility-inlines-hidden -fvisibility=hidden")
+ endif()
+endif()
+
+set(EXTERNAL_LINK_FLAGS "")
+set(EXTERNAL_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)
+set(EXTERNAL_DEBUG_LIBRARIES ${YAML_CPP_STATIC_DEBUG_LIBRARIES})
+set(EXTERNAL_OPTIMIZED_LIBRARIES ${YAML_CPP_STATIC_OPTIMIZED_LIBRARIES})
+set(EXTERNAL_GENERAL_LIBRARIES ${TINYXML_STATIC_LIBRARIES} ${YAML_CPP_STATIC_GENERAL_LIBRARIES})
+
+###############################################################################
+### Documentation ###
+
+messageonce("Generate Documentation: ${OCIO_BUILD_DOCS}")
+
+if(OCIO_BUILD_DOCS)
+ if(PYTHON_OK)
+ add_subdirectory(docs)
+ else()
+ message(STATUS "Building the documentation requires Python, but locating Python failed: ${PYTHON_ERR}")
+ endif()
+endif()
+
+###############################################################################
+### SSE ###
+
+messageonce("SSE Optimizations: ${OCIO_USE_SSE}")
+
+if(OCIO_USE_SSE)
+ if(WIN32)
+ # SSE instructions are automatically compiled into 64-bit applications so enabling the option is redundant and
+ # actually produces an unknown option warning in Visual Studio.
+ if(NOT CMAKE_CL_64)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
+ endif()
+ else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+ endif()
+ add_definitions("-DUSE_SSE")
+endif()
+
+###############################################################################
+### TRUELIGHT ###
+
+if(OCIO_BUILD_TRUELIGHT)
+ find_package(Truelight)
+ if(TRUELIGHT_FOUND)
+ messageonce("Will build the truelight transform support against ${Truelight_LIBRARY_DIR}")
+ add_definitions(-DOCIO_TRUELIGHT_SUPPORT)
+ set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${Truelight_INCLUDE_DIR})
+ set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} ${Truelight_COMPILE_FLAGS}")
+ set(EXTERNAL_LINK_FLAGS "${EXTERNAL_LINK_FLAGS} ${Truelight_LINK_FLAGS}")
+ set(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} ${Truelight_LIBRARIES})
+ else()
+ messageonce("Not building truelight transform support. Add the flag -D TRUELIGHT_INSTALL_PATH=... or set the TRUELIGHT_ROOT environment variable")
+ endif()
+endif()
+
+###############################################################################
+### CORE ###
+
+add_subdirectory(src/core)
+
+messageonce("Build Unit Tests: ${OCIO_BUILD_TESTS}")
+if(OCIO_BUILD_TESTS)
+ add_subdirectory(src/core_tests)
+endif()
+
+###############################################################################
+### APPS ###
+
+if(OCIO_BUILD_APPS)
+ # Try to find OpenImageIO (OIIO) and OpenGL stuff
+ OCIOFindOpenImageIO()
+
+ if(OIIO_FOUND)
+ add_subdirectory(src/apps/ocioconvert)
+ add_subdirectory(src/apps/ociolutimage)
+ else()
+ messageonce("Not building ocioconvert/ociolutimage. Requirement(s) found: OIIO:${OIIO_FOUND}")
+ endif()
+
+ # ociodisplay, displays color-transformed images (uses OpenImageIO,
+ # and OpenGL)
+ OCIOFindOpenGL()
+ if(OPENGL_FOUND AND GLUT_FOUND AND GLEW_FOUND AND OIIO_FOUND)
+ add_subdirectory(src/apps/ociodisplay)
+ else()
+ messageonce("Not building ociodisplay. Requirement(s) found, OpenGL:${OPENGL_FOUND}, GLUT:${GLUT_FOUND}, GLEW:${GLEW_FOUND}, OIIO:${OIIO_FOUND}")
+ endif()
+
+ # ociocheck: verifies an OCIO config
+ add_subdirectory(src/apps/ociocheck)
+
+ # ociobakelut writes out luts
+ add_subdirectory(src/apps/ociobakelut)
+endif()
+
+###############################################################################
+### NUKE ###
+
+if(OCIO_BUILD_NUKE)
+ find_package(Nuke)
+ if(NUKE_FOUND)
+ messageonce("Will build the Nuke plugins against ${Nuke_LIBRARY_DIR}")
+ add_subdirectory(src/nuke)
+ else()
+ messageonce("Not building Nuke plugins. Add the flag -D NUKE_INSTALL_PATH=... or set the NDK_PATH environment variable")
+ endif()
+endif()
+
+###############################################################################
+### PYGLUE ###
+
+if(OCIO_BUILD_PYGLUE)
+ if(PYTHON_OK)
+ add_subdirectory(src/pyglue)
+ else()
+ messageonce("Python bindings will not be built: ${PYTHON_ERR}")
+ endif()
+endif()
+
+###############################################################################
+### JNIGLUE ###
+
+if(OCIO_BUILD_JNIGLUE)
+ OCIOFindJava()
+ if(Java_FOUND)
+ add_subdirectory(src/jniglue)
+ else()
+ messageonce("Java bindings will not be built as we can't find Java")
+ endif()
+endif()
+
+###############################################################################
+### Configure env script ###
+configure_file(${CMAKE_SOURCE_DIR}/share/ocio/setup_ocio.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh @ONLY)
+
+INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh DESTINATION share/ocio/)
+
+###############################################################################
+### CPACK ###
+
+set(CPACK_PACKAGE_VERSION_MAJOR ${SOVERSION})
+set(CPACK_PACKAGE_VERSION_MINOR ${OCIO_VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${OCIO_VERSION_PATCH})
+set(CPACK_GENERATOR None)
+set(CPACK_SOURCE_GENERATOR TGZ)
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "ocio.${OCIO_VERSION}")
+include(CPack)
+
+###############################################################################
+### CTEST ###
+
+add_custom_target(test_verbose
+ COMMAND ctest -VV
+ DEPENDS ocio_core_tests
+ COMMENT "Running ctest with verbose output")
+
+# Log CMake first run done
+SET(CMAKE_FIRST_RUN 0 CACHE INTERNAL "")
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..0893c24
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,301 @@
+**Version 1.0.8 (Dec 11 2012):**
+ * After Effects plugin
+ * Core increased precision for matrix inversion
+ * Core md5 symbols no longer leaked
+ * CMake compatibility with OIIO 1.0 namespacing
+ * Cmake option to control python soname
+ * Nuke register_viewers defaults OCIODisplay to "all"
+ * Nuke ColorLookup <-> spi1d lut examples
+ * Windows uses boost shared_ptr by default
+ * Windows fixed csp writing
+ * Windows build fixes
+ * ociobakelut supports looks
+
+**Version 1.0.7 (April 17 2012):**
+ * IRIDAS .look support
+ * ociolutimage utility added (handles image <-> 3dlut)
+ * CMake build allows optional reliance on system libraries
+ * CMake layout changes for python and nuke installs
+ * Bumped internals to yaml 0.3.0, pystring 1.1.2
+ * Optimized internal handling of Matrix / Exponent Ops
+ * Added INTERP_BEST interpolation option
+ * Python config.clearLooks() added
+ * Python docs revamp
+ * Nuke config-dependent knob values now baked into .nk scripts
+ * Nuke OCIOLookTransform gets reload button
+ * Nuke nodes get updated help text
+
+**Version 1.0.6 (March 12 2012):**
+ * JNI (Java) updates
+ * ocioconvert arbitrary attr support
+
+**Version 1.0.5 (Feb 22 2012):**
+ * Internal optimization framework added
+ * SetLoggingLevel(..) bugfix
+ * Python API Documentation / website updates
+ * Clang compilation fix
+
+**Version 1.0.4 (Jan 25 2012):**
+ * ocio2icc deprecated (functionality merged into ociobakelut)
+ * rv integration (beta)
+ * nuke: updated channel handling
+ * Documentation / website updates
+
+**Version 1.0.3 (Dec 21 2011):**
+ * Tetrahedral 3dlut interpolation (CPU only)
+ * ociocheck and Config.sanityCheck() have improved validation
+ * Mari: updated examples
+ * Makefile: misc updates to match distro library conventions
+
+**Version 1.0.2 (Nov 30 2011):**
+ * 3D lut processing (cpu) is resiliant to nans
+ * Nuke OCIOFileTransform gains Reload buttons
+ * Installation on multi-lib *nix systems improved
+ * Installation handling of soversion for C++/python improved
+ * ociobakelut improvements
+ * Initial version of Java bindings (alpha)
+
+**Version 1.0.1 (Oct 31 2011):**
+ * Luts with incorrect extension are properly loaded
+ * ocio2icc / ociobakelut get --lut option (no longer requires ocio config)
+ * DisplayTransform looks do not apply to 'data' passes.
+
+**Version 1.0.0 (Oct 3 2011):**
+ * ABI Lockoff for 1.0 branch
+ * General API Cleanup (removed deprecated / unnecessary functions)
+ * New features can be added, but the ABI will only be extended in a binary compatible manner.
+ Profiles written from 1.0 will always be readable in future versions.
+ * Fixed Truelight Reading Bug
+ * ocio2icc no longer requires ocio config (can provide raw lut(s)
+
+
+-------------------------------------------------------------------------------
+
+
+**Version 0.8.7 (Oct 3 2011):**
+ * Fixed Truelight Reading Bug
+
+**Version 0.8.6 (Sept 7 2011):**
+ * Updated .ocio config reading / writing to be forwards compatibile with 1.0
+ (Profiles written in 0.8.6+ will be 1.0 compatible. Compatibility from prior versions is likely, though not guaranteed.)
+ * Better logging
+ * Added ColorSpace.equalitygroup (makes ColorSpace equality explicit)
+ * Substantial Nuke node updates
+ * Added support for Iridas .itx read/write
+ * Windows Build Support
+
+**Version 0.8.5 (Aug 2 2011):**
+ * Nuke OCIODisplay fixed (bug from 0.8.4)
+ * Updated Houdini HDL Reader / Writer
+
+**Version 0.8.4 (July 25 2011):**
+ * Native Look Support
+ * Core / Nuke OCIODisplay supports alpha viewing
+ * Added Houdini (.lut) writing
+ * Added Pandora (.mga,.m3d) reading
+ * Additional internal bug fixes
+
+**Version 0.8.3 (June 27 2011):**
+ * OCIO::Config symlink resolution fixed (bugfix)
+ * Nuke OCIODisplay knobs use string storage (bugfix)
+ * Makefile cleanup
+ * Documentation cleanup
+
+**Version 0.8.2 (June 7 2011):**
+ * Numerous Windows compatibility fixes
+ * Python binding improvements
+ * OCIO::Baker / ociobakelut improvements
+ * Lut1D/3D do not crash on nans (bugfix)
+ * Nuke UI doesnt crash in known corner case (bugfix)
+
+**Version 0.8.1 (May 9 2011):**
+ * New roles: TEXTURE_PAINT + MATTE_PAINT
+ * Mari API Example (src/mari)
+ * FileFormat registry updated to allow Windows + Debug support
+ * boost_ptr build compatibility option
+
+**Version 0.8.0 (Apr 19 2011):**
+ * ABI Lockoff for stable 0.8 branch
+ New features can be added, but the ABI will only be extended in a binary compatible manner
+ * Otherwise identical to 0.7.9
+
+-------------------------------------------------------------------------------
+
+**Version 0.7.9 (Apr 18 2011):**
+ * Added support for .vf luts
+ * Misc. Nuke enhancements
+ * Adds optional boost ptr support (backwards compatibility)
+ * Makefile enhancements (Nuke / CMAKE_INSTALL_EXEC_PREFIX)
+ * cdlTransform.setXML crash fix
+
+**Version 0.7.8 (March 31 2011):**
+ * Iridas lut (.cube) bugfix, DOMAIN_MIN / DOMAIN_MAX now obeyed
+ * Exposed GPU functions in python (needed for Mari)
+ * Nuke OCIODisplay cleanup: Fixed knob names and added envvar support
+ * ociobaker cleanup
+ * tinyxml ABI visibility cleaned up
+ * Removed Boost dependency, tr1::shared_ptr now used instead
+
+**Version 0.7.7 (March 1 2011):**
+ * Lut baking API + standalone app
+ * Truelight runtime support (optional)
+ * Cinespace (3d) lut writing
+ * CSP prelut support
+ * Boost argparse dependency removed
+ * SanityCheck is more exhaustive
+ * FileTransform supports relative path dirs
+ * Python enhancements (transform kwarg support)
+ * Makefile enhancements (OIIO Path)
+ * Processor API update (code compatible, binary incompatible)
+
+**Version 0.7.6 (Feb 1 2011):**
+ * Updated Config Display API (.ocio config format updated)
+ * Added ocio2icc app (ICC Profile Generation)
+ * Revamp of ASC CDL, added .cc and .ccc support
+ * Documentation Improvements
+ * Makefile enhancements (Boost_INCLUDE_DIR, etc)
+
+**Version 0.7.5 (Jan 13 2011):**
+ * ociodisplay enhancements
+ * gpu display bugfix (glsl profile 1.0 only)
+ * Makefile enhancements
+ * Nuke installation cleanup
+ * Doc generation using sphinx (html + pdf)
+
+**Version 0.7.4 (Jan 4 2011):**
+ * Added 'Context', allowing for 'per-shot' Transforms
+ * Misc API Cleanup: removed old functions + fixed const-ness
+ * Added config.sanityCheck() for validation
+ * Additional Makefile configuration options, SONAME, etc.
+
+**Version 0.7.3 (Dec 16 2010):**
+ * Added example applications: ociodisplay, ocioconvert
+ * Makefile: Add boost header dependency
+ * Makefile: Nuke plugins are now version specific
+ * Fixed bug in GLSL MatrixOp
+
+**Version 0.7.2 (Dec 9 2010):**
+ * GPUAllocation refactor (API tweak)
+ * Added AllocationTransform
+ * Added LogTransform
+ * Removed CineonLogToLinTransform
+ * A few bug fixes
+
+**Version 0.7.1 (Nov 15 2010):**
+ * Additional 3d lut formats: Truelight .cub + Iridas .cube
+ * FileTransform supports envvars and search paths
+ * Added Nuke plugins: LogConvert + FileTransform
+ * Improved OCIO profile formatting
+ * GCC visibility used (when available) to hide private symbols
+ * A few bug fixes
+
+**Version 0.7.0 (Oct 21 2010):**
+ * Switched file format from XML to Yaml
+
+-------------------------------------------------------------------------------
+
+**Version 0.6.1 (Oct 5 2010):**
+ * Exposed ExponentTransform
+ * Added CineonLogToLinTransform - a simple 'straight-line' negative
+ linearization. Not strictly needed (could be done previously
+ with LUTs) but often convenient to have.
+ * Added DisplayTransform.displayCC for post display lut CC.
+ * Many python improvements
+ * A few bug fixes
+ * A few Makefile enhancements
+
+**Version 0.6.0 (Sept 21 2010):**
+ * Start of 0.6, "stable" branch
+
+ All 0.6.x builds will be ABI compatible (forward only).
+ New features (even experimental ones) will be added to the 0.6 branch,
+ as long as binary and source compatibility is maintained.
+ Once this no longer is possible, a 0.7 "dev" branch will be forked.
+
+ * Split public header into 3 parts for improved readability
+ (you still only import <OpenColorIO/OpenColorIO.h> though)
+ * Added MatrixTransform
+ * Refactored internal unit testing
+ * Fixed many compile warnings
+
+-------------------------------------------------------------------------------
+
+**Version 0.5.16 (Sept 16 2010):**
+ * PyTransforms now use native python class inheritance
+ * OCIO namespace can now be configured at build time (for distribution in commercial apps)
+ * Updated make install behavior
+ * DisplayTransform accepts generic cc operators (instead of CDL only)
+ * A few bug fixes / compile warning fixes
+
+**Version 0.5.15 (Sept 8 2010):**
+ * OCIO is well behaved when $OCIO is unset, allowing un-color-managed use.
+ * Color Transforms can be applied in python config->getProcessor
+ * Simplification of API (getColorSpace allows cs name, role names, and cs objects)
+ * Makefile enhancements (courtesy Malcolm Humphreys)
+ * A bunch of bug fixes
+
+**Version 0.5.14 (Sept 1 2010):**
+ * Python binding enhancements
+ * Simplified class implmentations (reduced internal header count)
+
+**Version 0.5.13 (Aug 24 2010):**
+ * GPU Processing now supports High Dynamic Range color spaces
+ * Added log processing operator
+ * Numerous bug fixes
+ * Numerous enhancements to python glue
+ * Exposed PyOpenColorIO header, for use in apps that require custom python glue
+ * Matrix op is optimized for diagonal-only subcases
+ * Numerous changes to Nuke Plugin (now with an addition node, OCIODisplay)
+
+**Version 0.5.12 (Aug 18 2010):**
+ * Additional DisplayTransform improvements
+ * Additional GPU Improvements
+ * Added op hashing (processor->getGPULut3DCacheID)
+
+**Version 0.5.11 (Aug 11 2010):**
+ * Initial DisplayTransform implementation
+ * ASC CDL Support
+ * Config Luma coefficients
+
+**Version 0.5.10 (July 22 2010):**
+ * Updated Nuke Plugin, now works in OSX
+ * Fixed misc. build warnings.
+ * Continued GPU progress (still under development)
+
+**Version 0.5.9 (June 28 2010):**
+ * Renamed project, classes, namespaces to OpenColorIO (OCIO)
+ * Added single-pixel processor path
+ * Improved python path makefile detection
+ * Continued GPU progress (still under development)
+
+**Version 0.5.8 (June 22 2010):**
+ * Support for .3dl
+ * Support for matrix ops
+ * Code refactor (added Processors) to support gpu/cpu model
+ * Much better error checking
+ * Compilation support for python 2.5
+ * Compilation support for OSX
+
+**Version 0.5.7 (June 14 2010):**
+ * Python API is much more fleshed out
+ * Improved public C++ header
+
+**Version 0.5.6 (June 8 2010):**
+ * PyConfig stub implementation
+ * Dropped ImageDesc.init; added PlanarImageDesc / PackedImageDesc
+ * Dropped tr1::shared_ptr; added boost::shared_ptr
+
+**Version 0.5.5 (June 4 2010):**
+ * .ocio supports path references
+ * Switch config envvar to $OCIO
+ * Added 3D lut processing ops
+
+**Version 0.5.4 (June 1 2010):**
+ * Initial Release
+ * CMake linux support
+ * XML OCIO format parsing / saving
+ * Example colorspace configuration with a few 'trivial' colorspaces
+ * Mutable colorspace configuration API
+ * Support for 1D lut processing
+ * Support for SPI 1D fileformats.
+ * Nuke plugin
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..b6d7aa5
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1 @@
+For install instructions, see docs/setup.rst
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..6585e68
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,251 @@
+All code by Sony Pictures Imageworks except:
+
+Pystring
+http://code.google.com/p/pystring/
+
+TinyXML
+http://sourceforge.net/projects/tinyxml/
+
+yaml-cpp
+http://code.google.com/p/yaml-cpp/
+
+PTex (Mutex), courtesy of Brent Burley and Disney
+http://ptex.us/
+
+Little CMS
+http://www.littlecms.com/
+
+MD5, courtesy L. Peter Deutsch, Aladdin Enterprises.
+http://sourceforge.net/projects/libmd5-rfc/files/
+
+argparse, courtesy OpenImageIO and Larry Gritz
+http://openimageio.org
+
+---------------------------------------------------------------------
+
+Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---------------------------------------------------------------------
+
+Pystring
+
+Copyright (c) 2008-2010, Sony Pictures Imageworks Inc
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+Neither the name of the organization Sony Pictures Imageworks nor the
+names of its contributors
+may be used to endorse or promote products derived from this software
+without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---------------------------------------------------------------------
+
+TinyXML is released under the zlib license:
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+
+---------------------------------------------------------------------
+
+yaml-cpp
+
+Copyright (c) 2008 Jesse Beder.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+---------------------------------------------------------------------
+
+PTEX SOFTWARE
+Copyright 2009 Disney Enterprises, Inc. All rights reserved
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ * The names "Disney", "Walt Disney Pictures", "Walt Disney Animation
+ Studios" or the names of its contributors may NOT be used to
+ endorse or promote products derived from this software without
+ specific prior written permission from Walt Disney Pictures.
+
+Disclaimer: THIS SOFTWARE IS PROVIDED BY WALT DISNEY PICTURES AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE ARE DISCLAIMED.
+IN NO EVENT SHALL WALT DISNEY PICTURES, THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND BASED ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+---------------------------------------------------------------------
+
+Little CMS
+Copyright (c) 1998-2010 Marti Maria Saguer
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+---------------------------------------------------------------------
+
+MD5
+
+Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+L. Peter Deutsch
+ghost@aladdin.com
+
+---------------------------------------------------------------------
+
+argparse
+
+Copyright 2008 Larry Gritz and the other authors and contributors.
+All Rights Reserved.
+Based on BSD-licensed software Copyright 2004 NVIDIA Corp.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+* Neither the name of the software's owners nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(This is the Modified BSD License) \ No newline at end of file
diff --git a/README b/README
new file mode 100644
index 0000000..587d6e1
--- /dev/null
+++ b/README
@@ -0,0 +1,20 @@
+OpenColorIO (OCIO) is a complete color management solution geared towards motion
+picture production with an emphasis on visual effects and computer animation.
+OCIO provides a straightforward and consistent user experience across all
+supporting applications while allowing for sophisticated back-end configuration
+options suitable for high-end production usage. OCIO is compatible with the
+Academy Color Encoding Specification (ACES) and is LUT-format agnostic,
+supporting many popular formats.
+
+OpenColorIO is released as version 1.0 and has been in development since 2003.
+OCIO represents the culmination of years of production experience earned on such
+films as SpiderMan 2 (2004), Surf's Up (2007), Cloudy with a Chance of Meatballs
+(2009), Alice in Wonderland (2010), and many more. OpenColorIO is natively
+supported in commercial applications like Katana, Mari, Silhouette FX, and others
+coming soon.
+
+OpenColorIO is `free <http://opencolorio.org/License.html>`__ and is one of
+several open source projects actively sponsored by `Sony Imageworks
+<http://opensource.imageworks.com>`__.
+
+http://opencolorio.org
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..1b4841d
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,15 @@
+opencolorio (1.0.8~dfsg0-2) unstable; urgency=low
+
+ * debian/rules: get-orig-source stuff added
+ * debian/rules: useless dh addon removed
+ * debian/rules: License.txt duplicate removed
+ * debian/rules: SSE optimization disabled (Closes: #719174)
+ * debian/libopencolorio1.symbols: file removed (Closes: #719175)
+
+ -- Matteo F. Vescovi <mfv.debian@gmail.com> Tue, 20 Aug 2013 10:53:19 +0200
+
+opencolorio (1.0.8~dfsg0-1) unstable; urgency=low
+
+ * Initial release (Closes: #700676)
+
+ -- Matteo F. Vescovi <mfv.debian@gmail.com> Wed, 12 Jun 2013 14:54:06 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..002bece
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,171 @@
+Source: opencolorio
+Section: libs
+Priority: extra
+Maintainer: Debian PhotoTools Maintainers <pkg-phototools-devel@lists.alioth.debian.org>
+Uploaders: Matteo F. Vescovi <mfv.debian@gmail.com>
+Build-Depends:
+ cmake,
+ debhelper (>= 9),
+ junit4,
+ libglew-dev,
+ liblcms2-dev,
+ libopenimageio-dev,
+ libqt4-opengl-dev,
+ libtinyxml-dev,
+ libyaml-cpp-dev,
+ pkg-config,
+ python-dev,
+ python-docutils,
+ python-jinja2,
+ python-pygments,
+ python-setuptools,
+ python-sphinx,
+ texlive-fonts-recommended,
+ texlive-latex-base,
+ texlive-latex-extra,
+ texlive-latex-recommended
+X-Python-Version: >= 2.7
+Standards-Version: 3.9.4
+Homepage: http://opencolorio.org
+Vcs-Git: git://anonscm.debian.org/pkg-phototools/opencolorio.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-phototools/opencolorio.git
+
+Package: libopencolorio-dev
+Section: libdevel
+Architecture: any
+Depends: libopencolorio1 (= ${binary:Version}),
+ ${misc:Depends}
+Description: complete color management solution - development
+ OpenColorIO (OCIO) is a complete color management solution geared
+ towards motion picture production with an emphasis on visual effects
+ and computer animation. OCIO provides a straightforward and consistent
+ user experience across all supporting applications while allowing for
+ sophisticated back-end configuration options suitable for high-end
+ production usage. OCIO is compatible with the Academy Color Encoding
+ Specification (ACES) and is LUT-format agnostic, supporting many
+ popular formats.
+ .
+ OpenColorIO is released as version 1.0 and has been in development
+ since 2003. OCIO represents the culmination of years of production
+ experience earned on such films as SpiderMan 2 (2004), Surf's Up
+ (2007), Cloudy with a Chance of Meatballs (2009), Alice in Wonderland
+ (2010), and many more. OpenColorIO is natively supported in commercial
+ applications like Katana, Mari, Silhouette FX, and others coming soon.
+ .
+ OpenColorIO is free and is one of several open source projects
+ actively sponsored by Sony Imageworks.
+ .
+ This package provides the development files used to build applications
+ using libopencolorio.
+
+Package: libopencolorio1
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends},
+ ${shlibs:Depends}
+Description: complete color management solution - runtime
+ OpenColorIO (OCIO) is a complete color management solution geared
+ towards motion picture production with an emphasis on visual effects
+ and computer animation. OCIO provides a straightforward and consistent
+ user experience across all supporting applications while allowing for
+ sophisticated back-end configuration options suitable for high-end
+ production usage. OCIO is compatible with the Academy Color Encoding
+ Specification (ACES) and is LUT-format agnostic, supporting many
+ popular formats.
+ .
+ OpenColorIO is released as version 1.0 and has been in development
+ since 2003. OCIO represents the culmination of years of production
+ experience earned on such films as SpiderMan 2 (2004), Surf's Up
+ (2007), Cloudy with a Chance of Meatballs (2009), Alice in Wonderland
+ (2010), and many more. OpenColorIO is natively supported in commercial
+ applications like Katana, Mari, Silhouette FX, and others coming soon.
+ .
+ OpenColorIO is free and is one of several open source projects
+ actively sponsored by Sony Imageworks.
+ .
+ This package provides the runtime files used to run applications
+ built against libopencolorio.
+
+Package: opencolorio-tools
+Section: utils
+Architecture: any
+Depends: ${misc:Depends},
+ ${shlibs:Depends}
+Description: complete color management solution - utilities
+ OpenColorIO (OCIO) is a complete color management solution geared
+ towards motion picture production with an emphasis on visual effects
+ and computer animation. OCIO provides a straightforward and consistent
+ user experience across all supporting applications while allowing for
+ sophisticated back-end configuration options suitable for high-end
+ production usage. OCIO is compatible with the Academy Color Encoding
+ Specification (ACES) and is LUT-format agnostic, supporting many
+ popular formats.
+ .
+ OpenColorIO is released as version 1.0 and has been in development
+ since 2003. OCIO represents the culmination of years of production
+ experience earned on such films as SpiderMan 2 (2004), Surf's Up
+ (2007), Cloudy with a Chance of Meatballs (2009), Alice in Wonderland
+ (2010), and many more. OpenColorIO is natively supported in commercial
+ applications like Katana, Mari, Silhouette FX, and others coming soon.
+ .
+ OpenColorIO is free and is one of several open source projects
+ actively sponsored by Sony Imageworks.
+ .
+ This package provides some utilities.
+
+Package: opencolorio-doc
+Section: doc
+Architecture: all
+Depends: libjs-jquery,
+ libjs-underscore,
+ ${misc:Depends}
+Description: complete color management solution - documentation
+ OpenColorIO (OCIO) is a complete color management solution geared
+ towards motion picture production with an emphasis on visual effects
+ and computer animation. OCIO provides a straightforward and consistent
+ user experience across all supporting applications while allowing for
+ sophisticated back-end configuration options suitable for high-end
+ production usage. OCIO is compatible with the Academy Color Encoding
+ Specification (ACES) and is LUT-format agnostic, supporting many
+ popular formats.
+ .
+ OpenColorIO is released as version 1.0 and has been in development
+ since 2003. OCIO represents the culmination of years of production
+ experience earned on such films as SpiderMan 2 (2004), Surf's Up
+ (2007), Cloudy with a Chance of Meatballs (2009), Alice in Wonderland
+ (2010), and many more. OpenColorIO is natively supported in commercial
+ applications like Katana, Mari, Silhouette FX, and others coming soon.
+ .
+ OpenColorIO is free and is one of several open source projects
+ actively sponsored by Sony Imageworks.
+ .
+ This package provides the documentation.
+
+Package: python-pyopencolorio
+Section: python
+Architecture: any
+Depends: libopencolorio1 (= ${binary:Version}),
+ ${misc:Depends},
+ ${python:Depends},
+ ${shlibs:Depends}
+Description: complete color management solution - python bindings
+ OpenColorIO (OCIO) is a complete color management solution geared
+ towards motion picture production with an emphasis on visual effects
+ and computer animation. OCIO provides a straightforward and consistent
+ user experience across all supporting applications while allowing for
+ sophisticated back-end configuration options suitable for high-end
+ production usage. OCIO is compatible with the Academy Color Encoding
+ Specification (ACES) and is LUT-format agnostic, supporting many
+ popular formats.
+ .
+ OpenColorIO is released as version 1.0 and has been in development
+ since 2003. OCIO represents the culmination of years of production
+ experience earned on such films as SpiderMan 2 (2004), Surf's Up
+ (2007), Cloudy with a Chance of Meatballs (2009), Alice in Wonderland
+ (2010), and many more. OpenColorIO is natively supported in commercial
+ applications like Katana, Mari, Silhouette FX, and others coming soon.
+ .
+ OpenColorIO is free and is one of several open source projects
+ actively sponsored by Sony Imageworks.
+ .
+ This package provides Python bindings to the OpenColorIO library.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..ef075a4
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,77 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: opencolorio
+Source: https://github.com/imageworks/OpenColorIO
+
+Files: *
+Copyright: 2003-2010 Sony Pictures Imageworks Inc., et al.
+License: BSD-3-Clause
+
+Files: debian/*
+Copyright: 2013 Matteo F. Vescovi <mfv.debian@gmail.com>
+License: BSD-3-Clause
+
+Files: docs/ociotheme/static/*
+Copyright: 2008-2009, Haiku.
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Files: src/core/md5/*
+Copyright: 1999, 2002 Aladdin Enterprises
+License: zlib
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ .
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ .
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+License: BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README
diff --git a/debian/examples b/debian/examples
new file mode 100644
index 0000000..dd22b73
--- /dev/null
+++ b/debian/examples
@@ -0,0 +1 @@
+debian/cmake/share/ocio/setup_ocio.sh
diff --git a/debian/libopencolorio-dev.install b/debian/libopencolorio-dev.install
new file mode 100644
index 0000000..8c14d24
--- /dev/null
+++ b/debian/libopencolorio-dev.install
@@ -0,0 +1,3 @@
+usr/include/OpenColorIO
+usr/lib/lib*.so
+usr/lib/pkgconfig
diff --git a/debian/libopencolorio1.install b/debian/libopencolorio1.install
new file mode 100644
index 0000000..d0dbfd1
--- /dev/null
+++ b/debian/libopencolorio1.install
@@ -0,0 +1 @@
+usr/lib/lib*.so.*
diff --git a/debian/manpages/ociobakelut.1 b/debian/manpages/ociobakelut.1
new file mode 100644
index 0000000..8804c54
--- /dev/null
+++ b/debian/manpages/ociobakelut.1
@@ -0,0 +1,99 @@
+.TH OCIOBAKELUT 1
+.SH NAME
+ociobakelut \- create a new LUT or icc profile from an OCIO config or lut file(s)
+.SH SYNOPSIS
+.B ociobakelut
+.RI [ options ] " output-file" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B ociobakelut
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBociobakelut\fP is a program which bakes a color transform into various color
+lookup file formats ("a LUT")
+.PP
+This is intended for applications that have not directly integrated
+OCIO, but can load LUT files
+.PP
+.SH OPTIONS
+A summary of options is included below.
+.TP
+.BI "\-\-inputspace " space
+Input OCIO ColorSpace (or Role)
+.TP
+.BI "\-\-outputspace " space
+Output OCIO ColorSpace (or Role)
+.TP
+.BI "\-\-shaperspace " space
+the OCIO ColorSpace or Role, for the shaper
+.TP
+.BI "\-\-looks " looks
+the OCIO looks to apply
+.TP
+.BI "\-\-iconfig " configfile
+.PP
+Input .ocio configuration file (default: $OCIO)
+Config-Free LUT Baking
+.TP
+.BI "\-\-lut " lut
+Specify a LUT (forward direction)
+.TP
+.BI "\-\-invlut " lut
+Specify a LUT (inverse direction)
+.TP
+.BI "\-\-slope " "x y z"
+slope
+.TP
+.BI "\-\-offset " "x y z"
+offset (float)
+.TP
+.BI "\-\-offset10 " "x y z"
+offset (10-bit)
+.TP
+.BI "\-\-power " "x y z"
+power
+.TP
+.BI "\-\-sat " x
+saturation (ASC-CDL luma coefficients)
+.PP
+Baking options
+.TP
+.BI "\-\-format " format
+.TP
+.BI "\-\-shapersize ' n
+size of the shaper (default: format specific)
+.TP
+.BI "\-\-cubesize " n
+size of the cube (default: format specific)
+.TP
+.B "\-\-stdout"
+Write to stdout (rather than file)
+.PP
+ICC Options
+.TP
+.BI "\-\-whitepoint " n
+whitepoint for the profile (default: 6505)
+.BI "\-\-displayicc " s
+an icc profile which matches the OCIO profiles target display
+.BI "\-\-description " s
+a meaningful description, this will show up in UI like photoshop
+.BI "\-\-copyright " s
+a copyright field
+.PP
+other options
+.TP
+.B "\-\-v"
+Verbose
+.TP
+.B \-\-help
+Show summary of options.
+.TP
+.SH SEE ALSO
+.BR ociocheck (1),
+.BR ocioconvert (1),
+.BR ociolutimage (1).
+.br
+.B /usr/share/doc/opencolorio/OpenColorIO.pdf
diff --git a/debian/manpages/ociocheck.1 b/debian/manpages/ociocheck.1
new file mode 100644
index 0000000..2a17fff
--- /dev/null
+++ b/debian/manpages/ociocheck.1
@@ -0,0 +1,35 @@
+.TH OCIOCHECK 1
+.SH NAME
+ociocheck \- validate an OpenColorIO configuration
+.SH SYNOPSIS
+.B ociocheck
+.RI [ options ] " output-file" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B ociocheck
+command.
+.PP
+\fBociocheck\fP validates the specified .ocio configuration,
+and checks that all the color transforms are defined.
+For example, it is possible that the configuration may reference
+lookup tables that do not exist. ociocheck will find these cases.
+
+ociocheck can also be used to clean up formatting on an existing profile
+that has been manually edited, using the '\-o' option.
+.SH OPTIONS
+A summary of options is included below.
+.TP
+.BI "\-\-help " space
+print help message
+.TP
+.BI "\-\-iconfig " configfile
+Input .ocio configuration file (default: $OCIO)
+.TP
+.BI "\-\-oconfig " configfile
+Output .ocio file
+.SH SEE ALSO
+.BR ociobakelut (1),
+.BR ocioconvert (1),
+.BR ociolutimage (1).
+.br
+.B /usr/share/doc/opencolorio/OpenColorIO.pdf
diff --git a/debian/manpages/ocioconvert.1 b/debian/manpages/ocioconvert.1
new file mode 100644
index 0000000..e209caf
--- /dev/null
+++ b/debian/manpages/ocioconvert.1
@@ -0,0 +1,28 @@
+.TH OCIOCONVERT 1
+.SH NAME
+ocioconvert \- apply colorspace transform to an image
+.SH SYNOPSIS
+.B ocioconvert
+.RI [ options ] " output-file" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B ocioconvert
+command.
+.SH OPTIONS
+A summary of options is included below.
+.TP
+.TP
+.BI "\-\-float\-attribute " N=F
+name=float pair defining OCIO float atribute
+.TP
+.BI "\-\-int\-attribute " N=I
+name=int pair defining OCIO int atribute
+.TP
+.BI "\-\-string\-attribute " N=S
+name=string pair defining OCIO string atribute
+.SH SEE ALSO
+.BR ociobakelut (1),
+.BR ociocheck (1),
+.BR ociolutimage (1).
+.br
+.B /usr/share/doc/opencolorio/OpenColorIO.pdf
diff --git a/debian/manpages/ociolutimage.1 b/debian/manpages/ociolutimage.1
new file mode 100644
index 0000000..54100c6
--- /dev/null
+++ b/debian/manpages/ociolutimage.1
@@ -0,0 +1,43 @@
+.TH OCIOLUTIMAGE 1
+.SH NAME
+ociolutimage \- Convert a 3dlut to or from an image
+.SH SYNOPSIS
+.B ociolutimage
+.RI [ options ] " output-file" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B ociolutimage
+command.
+.PP
+.SH OPTIONS
+A summary of options is included below.
+.TP
+.BI \-\-generate
+Generate a lattice image
+.TP
+.BI \-\-extract
+Extract a 3dlut from an input image
+.TP
+.BI "\-\-input " file
+Specify the input filename
+.TP
+.BI "\-\-output " file
+Specify the output filename
+.TP
+.BI "\-\-cubesize " n
+Size of the cube (default: 32)
+.TP
+.BI "\-\-maxwidth " n
+Specify maximum width of the image (default: 2048)
+.TP
+.BI "\-\-config " file
+\&.ocio configuration file (default: $OCIO)
+.TP
+.BI "\-\-colorconvert " "in out"
+Apply a color space conversion to the image.
+.SH SEE ALSO
+.BR ociobakelut (1),
+.BR ocioconvert (1),
+.BR ocioconvert (1).
+.br
+.B /usr/share/doc/opencolorio/OpenColorIO.pdf
diff --git a/debian/opencolorio-doc.doc-base b/debian/opencolorio-doc.doc-base
new file mode 100644
index 0000000..fc19136
--- /dev/null
+++ b/debian/opencolorio-doc.doc-base
@@ -0,0 +1,11 @@
+Document: opencolorio
+Title: Debian OpenColorIO Manual
+Section: Programming/C++
+
+Format: HTML
+Index: /usr/share/doc/opencolorio/html/genindex.html
+Files: /usr/share/doc/opencolorio/html/*.html
+
+Format: Text
+Index: /usr/share/doc/opencolorio/html/_sources/index.txt
+Files: /usr/share/doc/opencolorio/html/_sources/*.txt
diff --git a/debian/opencolorio-doc.install b/debian/opencolorio-doc.install
new file mode 100644
index 0000000..e858050
--- /dev/null
+++ b/debian/opencolorio-doc.install
@@ -0,0 +1 @@
+usr/share/doc/opencolorio
diff --git a/debian/opencolorio-doc.links b/debian/opencolorio-doc.links
new file mode 100644
index 0000000..8c647fa
--- /dev/null
+++ b/debian/opencolorio-doc.links
@@ -0,0 +1,2 @@
+usr/share/javascript/jquery/jquery.js usr/share/doc/opencolorio/html/_static/jquery.js
+usr/share/javascript/underscore/underscore.js usr/share/doc/opencolorio/html/_static/underscore.js
diff --git a/debian/opencolorio-tools.install b/debian/opencolorio-tools.install
new file mode 100644
index 0000000..e772481
--- /dev/null
+++ b/debian/opencolorio-tools.install
@@ -0,0 +1 @@
+usr/bin
diff --git a/debian/opencolorio-tools.manpages b/debian/opencolorio-tools.manpages
new file mode 100644
index 0000000..4cd44fd
--- /dev/null
+++ b/debian/opencolorio-tools.manpages
@@ -0,0 +1 @@
+debian/manpages/*.1
diff --git a/debian/patches/0001-Fix_built-in_documentation_dependencies.patch b/debian/patches/0001-Fix_built-in_documentation_dependencies.patch
new file mode 100644
index 0000000..a2d4216
--- /dev/null
+++ b/debian/patches/0001-Fix_built-in_documentation_dependencies.patch
@@ -0,0 +1,116 @@
+From: "Matteo F. Vescovi" <mfv.debian@gmail.com>
+Date: Wed, 12 Jun 2013 12:21:44 +0200
+Subject: Fix_built-in_documentation_dependencies
+
+---
+ CMakeLists.txt | 5 +----
+ docs/CMakeLists.txt | 62 ++---------------------------------------------------
+ 2 files changed, 3 insertions(+), 64 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3e36ca5..a0e6adb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -135,15 +135,12 @@ else()
+ # construct the external project path
+ OCIOFindPython()
+
+- set(EXTDIST_ROOT ${CMAKE_BINARY_DIR}/ext/dist)
+- set(EXTDIST_BINPATH ${EXTDIST_ROOT}/bin)
+ if(PYTHON_OK)
+- set(EXTDIST_PYTHONPATH ${EXTDIST_ROOT}/lib/python${PYTHON_VERSION}/site-packages)
++ set(EXTDIST_PYTHONPATH /usr/lib/python${PYTHON_VERSION}/dist-packages)
+ set(PYTHONPATH ${EXTDIST_PYTHONPATH}:$ENV{PYTHONPATH})
+ endif()
+ endif()
+
+-messageonce("Setting EXTDIST_BINPATH: ${EXTDIST_BINPATH}")
+ messageonce("Setting EXTDIST_PYTHONPATH: ${EXTDIST_PYTHONPATH}")
+
+ ###############################################################################
+diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
+index 0cbfd67..e15db13 100644
+--- a/docs/CMakeLists.txt
++++ b/docs/CMakeLists.txt
+@@ -1,63 +1,5 @@
+
+ ###############################################################################
+-### External Doc Apps ###
+-
+-# setuptools
+-set(SETUPTOOLS_VERSION 0.6c11)
+-ExternalProject_Add(setuptools
+- URL ${CMAKE_SOURCE_DIR}/ext/setuptools-${SETUPTOOLS_VERSION}.tar.gz
+- BUILD_IN_SOURCE 1
+- CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+- BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+- INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT}
+-)
+-
+-# docutils
+-set(DOCUTILS_VERSION 0.7)
+-ExternalProject_Add(docutils
+- DEPENDS setuptools
+- URL ${CMAKE_SOURCE_DIR}/ext/docutils-${DOCUTILS_VERSION}.tar.gz
+- BUILD_IN_SOURCE 1
+- CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+- BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+- INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT}
+-)
+-
+-# jinja2
+-set(JINJA2_VERSION 2.5.5)
+-ExternalProject_Add(Jinja2
+- DEPENDS setuptools
+- URL ${CMAKE_SOURCE_DIR}/ext/Jinja2-${JINJA2_VERSION}.tar.gz
+- BUILD_IN_SOURCE 1
+- CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+- BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+- INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT}
+-)
+-
+-# Pygments
+-set(PYGMENTS_VERSION 1.3.1)
+-ExternalProject_Add(Pygments
+- DEPENDS setuptools
+- URL ${CMAKE_SOURCE_DIR}/ext/Pygments-${PYGMENTS_VERSION}.tar.gz
+- BUILD_IN_SOURCE 1
+- CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+- BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+- INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT}
+-)
+-
+-# sphinx
+-set(SPHINX_VERSION f52b631f501a) # 1.1pre
+-ExternalProject_Add(Sphinx
+- DEPENDS setuptools docutils Jinja2 Pygments
+- URL ${CMAKE_SOURCE_DIR}/ext/sphinx-${SPHINX_VERSION}.tar.gz
+- PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/ext/sphinx-${SPHINX_VERSION}.patch
+- BUILD_IN_SOURCE 1
+- CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTDIST_PYTHONPATH}
+- BUILD_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py build
+- INSTALL_COMMAND PYTHONPATH=${PYTHONPATH} python setup.py install --prefix=${EXTDIST_ROOT} --install-scripts=${EXTDIST_ROOT}/bin
+-)
+-
+-###############################################################################
+ ### Create Doc Targets ###
+
+ message(STATUS "Create sphinx conf.py from conf.py.in")
+@@ -81,7 +23,7 @@ ExtractRstCPP(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorTransforms.h devel
+ ExtractRstCPP(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorTypes.h developers/api/OpenColorTypes.rst)
+
+ add_custom_target(doc ALL
+- COMMAND PYTHONPATH=${PYTHONPATH} ${EXTDIST_BINPATH}/sphinx-build -b html . ${CMAKE_CURRENT_BINARY_DIR}/build-html
++ COMMAND PYTHONPATH=${PYTHONPATH} sphinx-build -b html . ${CMAKE_CURRENT_BINARY_DIR}/build-html
+ DEPENDS
+ OpenColorIO
+ PyOpenColorIO
+@@ -106,7 +48,7 @@ find_package(LATEX)
+ if(PDFLATEX_COMPILER)
+
+ add_custom_target(latex
+- COMMAND PYTHONPATH=${PYTHONPATH} ${EXTDIST_BINPATH}/sphinx-build -b latex . ${CMAKE_CURRENT_BINARY_DIR}/build-latex
++ COMMAND PYTHONPATH=${PYTHONPATH} sphinx-build -b latex . ${CMAKE_CURRENT_BINARY_DIR}/build-latex
+ DEPENDS
+ OpenColorIO
+ ${CMAKE_BINARY_DIR}/docs/conf.py
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..9db761e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Fix_built-in_documentation_dependencies.patch
diff --git a/debian/python-pyopencolorio.install b/debian/python-pyopencolorio.install
new file mode 100644
index 0000000..a99b715
--- /dev/null
+++ b/debian/python-pyopencolorio.install
@@ -0,0 +1,2 @@
+usr/include/PyOpenColorIO
+usr/lib/python2.7/site-packages/*.so usr/lib/python2.7/dist-packages/
diff --git a/debian/repack.local b/debian/repack.local
new file mode 100644
index 0000000..ea04873
--- /dev/null
+++ b/debian/repack.local
@@ -0,0 +1,2 @@
+SUFFIX=~dfsg0
+rm ext/
diff --git a/debian/repack.sh b/debian/repack.sh
new file mode 100755
index 0000000..a3bb5f9
--- /dev/null
+++ b/debian/repack.sh
@@ -0,0 +1,161 @@
+#!/bin/sh
+
+# see the repack.stub for how to use
+
+# TODO: provide example watch files and repack.locals
+# TODO: test suite. problems fixed that need to be tested:
+# * globbing
+# * whitespace and then comments in the MANIFEST
+# TODO: does / in weird places work? test suite too.
+# TODO: I actually broke stuff with the MANIFEST change not thinking..
+# TODO: allow for a sepearate (and multiple) MANIFEST files, then
+# de-uglify libsyntax-highlight-engine-kate-perl.
+# TODO: have each mv and rm check that something actually changed, and
+# if not, die
+
+set -e
+set -u
+
+usage() {
+ echo "Usage: repack.sh --upstream-version <ver> <downloaded file>"
+ exit 1
+}
+
+if [ "$#" != "3" ]; then
+ usage
+fi
+if [ "$1" != "--upstream-version" ]; then
+ usage
+fi
+if [ ! -f "$3" ]; then
+ if [ -n "$3" ]; then
+ echo "$3 doesn't exist"
+ fi
+ usage
+fi
+VER="$2"
+FILE="$3"
+PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'`
+
+SUFFIX="~dfsg"
+
+echo
+echo "Repackaging $FILE"
+echo
+
+DIR=`mktemp -d ./tmpRepackXXXXXX`
+DIR=$(readlink -f "$DIR")
+trap "/bin/rm -rf \"$DIR\"" QUIT INT EXIT
+
+# Create an extra directory to cope with rootless tarballs
+UP_BASE="$DIR/unpack"
+mkdir "$UP_BASE"
+tar xf "$FILE" -C "$UP_BASE" || unzip "$FILE" -d "$UP_BASE"
+
+if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then
+ # Tarball does contain a root directory
+ UP_BASE="$UP_BASE/`ls -1 "$UP_BASE"`"
+fi
+
+RM_OPTS="-vrf"
+
+real_rm(){
+ /bin/rm "$@"
+}
+
+real_mv(){
+ /bin/mv "$@"
+}
+
+rm(){
+ set +f
+ MYOLDPWD=$(pwd)
+ cd "$UP_BASE"
+ if [ "$MANIFEST" = "1" ]; then
+ PERM=$(stat --format=%a "MANIFEST")
+ chmod u+w "MANIFEST"
+ fi
+ for i in $@; do
+ if [ "$MANIFEST" = "1" ]; then
+ PATTERN="^$i"
+ if [ -d "$i" ]; then
+ if ! { echo "$PATTERN" | grep -q "/$" ; }; then
+ PATTERN="${PATTERN}/"
+ fi
+ else
+ PATTERN="${PATTERN}\s?"
+ fi
+ grep -Ev "$PATTERN" "MANIFEST" > "$DIR/MANIFEST"
+ real_mv "$DIR/MANIFEST" "MANIFEST"
+ fi
+ real_rm "$RM_OPTS" "$i"
+ done
+ if [ "$MANIFEST" = "1" ]; then
+ chmod $PERM "MANIFEST"
+ fi
+ cd $MYOLDPWD
+ set -f
+}
+
+mv(){
+ set +f
+ OLD=$(pwd)
+ cd $UP_BASE
+ real_mv "$@"
+ cd $OLD
+ if [ "$MANIFEST" = "1" ]; then
+ echo "MANIFEST cannot be manipulated with mv yet, patches welcome"
+ exit 1
+ fi
+ set -f
+}
+
+# bump with incompatible changes
+REPACK_VERSION=3
+
+requires_version(){
+ if [ $REPACK_VERSION -lt $1 ]; then
+ echo "repack.sh is not up to date enough for this package. you need at least version $1, while this script is only version $REPACK_VERSION"
+ exit 1
+ fi
+}
+
+MANIFEST=0
+## Remove stuff
+set -f
+MYORIGPWD=$(pwd)
+cd "$UP_BASE"
+. "$MYORIGPWD/debian/repack.local"
+cd $MYORIGPWD
+set +f
+## End
+
+REPACK_DIR="$PKG-${VER}${SUFFIX}.orig" # DevRef § 6.7.8.2
+DFSG_TAR="$(dirname $FILE)/${PKG}_${VER}${SUFFIX}.orig.tar"
+
+real_mv "$UP_BASE" "$DIR/$REPACK_DIR"
+
+# .gz or .bz2?
+FILETYPE=$(file --brief --mime-type --dereference "$FILE")
+case "$FILETYPE" in
+ application/x-gzip|application/gzip|application/zip)
+ C_PROGRAM="gzip"
+ C_SUFFIX="gz"
+ ;;
+ application/x-bzip2)
+ C_PROGRAM="bzip2"
+ C_SUFFIX="bz2"
+ ;;
+ *)
+ echo "E: Unknown filetye $FILETYPE"
+ exit 1
+ ;;
+esac
+
+# Using a pipe hides tar errors!
+tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR"
+$C_PROGRAM -9 < "$DIR/repacked.tar" > "$DIR/repacked.tar.$C_SUFFIX"
+
+real_mv "$DIR/repacked.tar.$C_SUFFIX" "$DFSG_TAR.$C_SUFFIX"
+
+echo "*** $DFSG_TAR.$C_SUFFIX ready"
diff --git a/debian/repack.stub b/debian/repack.stub
new file mode 100644
index 0000000..a07c135
--- /dev/null
+++ b/debian/repack.stub
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+: <<=cut
+=pod
+
+=head1 NAME
+
+repack.stub - script to repack upstream tarballs from uscan
+
+=head1 INSTRUCTIONS
+
+put this in debian/repack.stub and add "debian sh debian/repack.stub" to
+the end of the line in debian/watch. you will also need to add a version
+mangle to debian/watch.
+
+then create a debian/repack.local. this is a shell script that is
+sources under "set -e", so be careful to check returns codes.
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item rm
+
+rm is replaced by a function that does some magic ("rm -rv" by default), but also changes MANIFEST if $MANIFEST is 1
+
+=item mv
+
+mv is replaced by a function that just does mv (by default), but also changes MANIFEST if $MANIFEST is 1
+
+=item requires_version
+
+requires_version is there for future usage for requiring certain versions of the script
+
+=back
+
+=head1 VARIABLES
+
+=over 4
+
+=item SUFFIX
+
+defaults to ~dfsg
+
+what to append to the upstream version
+
+=item RM_OPTS
+
+defaults to -vrf
+
+options to pass to rm
+
+=item MANIFEST
+
+defaults to 0, set to 1 to turn on.
+
+this will manipulate MANIFEST files in CPAN tarballs.
+
+=item UP_BASE
+
+this is the directory where the upstream source is.
+
+=back
+
+=cut
+
+if [ -z "$REPACK_SH" ]; then
+ if [ -f ../../scripts/repack.sh ]; then
+ REPACK_SH=../../scripts/repack.sh
+ fi
+ if [ -z "$REPACK_SH" ] && which repack.sh > /dev/null; then
+ REPACK_SH=$(which repack.sh)
+ fi
+fi
+
+if [ ! -f "$REPACK_SH" ]; then
+ echo "Couldn't find a repack.sh. please put it in your PATH, put it at ../../scripts/repack.sh, or put it somewhere else and set the REPACK_SH variable"
+ echo "You can get it from http://svn.debian.org/viewsvn/pkg-perl/scripts/repack.sh"
+ exit 1
+fi
+
+exec "$REPACK_SH" "$@"
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..a4432d3
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,40 @@
+#!/usr/bin/make -f
+
+CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS)
+CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
+export LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
+export REPACK_SH=$(CURDIR)/debian/repack.sh
+BLDDIR = debian/cmake
+INSTDIR = debian/tmp
+
+%:
+ dh $@ -Scmake -B$(BLDDIR) --parallel --with python2
+
+override_dh_auto_configure:
+ dh_auto_configure -- \
+ -DCMAKE_CXX_FLAGS="$(CXXFLAGS) $(CPPFLAGS)" \
+ -DOCIO_BUILD_DOCS=ON \
+ -DOCIO_BUILD_NUKE=OFF \
+ -DOCIO_BUILD_STATIC=OFF \
+ -DOCIO_BUILD_TESTS=OFF \
+ -DOCIO_BUILD_TRUELIGHT=OFF \
+ -DOCIO_USE_SSE=OFF \
+ -DUSE_EXTERNAL_TINYXML=ON \
+ -DUSE_EXTERNAL_YAML=ON
+
+override_dh_auto_install:
+ dh_auto_install
+ rm -f $(INSTDIR)/usr/share/doc/OpenColorIO/html/_sources/License.txt
+ rm -f $(INSTDIR)/usr/share/doc/OpenColorIO/html/_static/jquery.js
+ rm -f $(INSTDIR)/usr/share/doc/OpenColorIO/html/_static/underscore.js
+
+override_dh_install:
+ mv $(INSTDIR)/usr/share/doc/OpenColorIO $(INSTDIR)/usr/share/doc/opencolorio
+ dh_install
+
+override_dh_auto_clean:
+ pyclean .
+ dh_auto_clean
+
+get-orig-source:
+ uscan --force-download
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..df02b54
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts="dversionmangle=s/\~dfsg.*//" \
+https://github.com/imageworks/OpenColorIO/tags .*/v(\d.*)\.(?:tgz|tar\.(?:gz|bz2|xz))
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 0000000..e15db13
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,73 @@
+
+###############################################################################
+### Create Doc Targets ###
+
+message(STATUS "Create sphinx conf.py from conf.py.in")
+configure_file(${CMAKE_SOURCE_DIR}/docs/conf.py.in
+ ${CMAKE_BINARY_DIR}/docs/conf.py @ONLY)
+
+message(STATUS "Copying doc to staging area")
+file(COPY ${CMAKE_SOURCE_DIR}/docs/ DESTINATION ${CMAKE_BINARY_DIR}/docs)
+
+message(STATUS "Copy extra doc files to staging area")
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/README)
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/INSTALL)
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/ChangeLog)
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/LICENSE)
+list(APPEND DOCFILES ${CMAKE_SOURCE_DIR}/share/nuke/ocionuke/viewer.py)
+CopyFiles(RSTDOC ${DOCFILES})
+
+message(STATUS "Extracting .rst files from C++ headers")
+ExtractRstCPP(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorIO.h developers/api/OpenColorIO.rst)
+ExtractRstCPP(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorTransforms.h developers/api/OpenColorTransforms.rst)
+ExtractRstCPP(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorTypes.h developers/api/OpenColorTypes.rst)
+
+add_custom_target(doc ALL
+ COMMAND PYTHONPATH=${PYTHONPATH} sphinx-build -b html . ${CMAKE_CURRENT_BINARY_DIR}/build-html
+ DEPENDS
+ OpenColorIO
+ PyOpenColorIO
+ ${CMAKE_BINARY_DIR}/docs/conf.py
+ developers/api/OpenColorIO.rst
+ developers/api/OpenColorTransforms.rst
+ developers/api/OpenColorTypes.rst
+ ${RSTDOC_OUTPUT}
+ COMMENT "Building html docs"
+ SOURCES ${DOCFILES})
+
+# note: ExternalProject will not build when added to a add_custom_target this
+# works around this problem. This seems to be fixed in the cmake ^HEAD
+add_dependencies(doc Sphinx)
+
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build-html/
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/OpenColorIO/html
+ PATTERN .* EXCLUDE
+)
+
+find_package(LATEX)
+if(PDFLATEX_COMPILER)
+
+ add_custom_target(latex
+ COMMAND PYTHONPATH=${PYTHONPATH} sphinx-build -b latex . ${CMAKE_CURRENT_BINARY_DIR}/build-latex
+ DEPENDS
+ OpenColorIO
+ ${CMAKE_BINARY_DIR}/docs/conf.py
+ developers/api/OpenColorIO.rst
+ developers/api/OpenColorTransforms.rst
+ developers/api/OpenColorTypes.rst
+ ${RSTDOC_OUTPUT}
+ COMMENT "Building latex doc"
+ SOURCES ${DOCFILES})
+ add_dependencies(latex Sphinx)
+
+ add_custom_target(pdf ALL
+ COMMAND ${PDFLATEX_COMPILER} OpenColorIO.tex
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build-latex
+ COMMENT "Building pdf doc"
+ SOURCES ${DOCFILES})
+ add_dependencies(pdf latex)
+
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/build-latex/OpenColorIO.pdf
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/OpenColorIO/)
+
+endif()
diff --git a/docs/ChangeLog.rst b/docs/ChangeLog.rst
new file mode 100755
index 0000000..3ebc244
--- /dev/null
+++ b/docs/ChangeLog.rst
@@ -0,0 +1,6 @@
+.. _changelog-main:
+
+ChangeLog
+=========
+
+.. include:: ChangeLog
diff --git a/docs/CompatibleSoftware.rst b/docs/CompatibleSoftware.rst
new file mode 100644
index 0000000..05845e6
--- /dev/null
+++ b/docs/CompatibleSoftware.rst
@@ -0,0 +1,268 @@
+.. _compatiblesoftware:
+
+Compatible Software
+===================
+
+The following sofware all supports OpenColorIO (to varying degrees).
+
+If you are interested in getting OCIO support for an application not listed
+here, please contact the ocio-dev mailing list.
+
+If you are a developer and would like assistance integration OCIO into your
+application, please contant ocio-dev as well.
+
+
+After Effects
+*************
+
+`Compositor - Adobe <http://www.adobe.com/products/aftereffects.html>`__
+
+OpenColorIO nodes are available for use in After Effects.
+
+See `src/aftereffects
+<http://github.com/imageworks/OpenColorIO/tree/master/src/aftereffects>`__
+if you are interested in building your own OCIO plugins.
+
+Pre-built binaries are also available for `download
+<http://www.fnordware.com/OpenColorIO>`__, courtesy of
+`fnordware <http://www.fnordware.com>`__.
+
+
+Krita
+*****
+
+`2D Paint - Open Source <http://www.krita.org/>`__
+
+Krita now support OpenColorIO for image viewing, allowing for the accurate
+painting of float32/OpenEXR imagery.
+
+See `krita.org
+<http://www.krita.org/item/113-krita-starts-supporting-opencolorio>`__
+for details.
+
+
+Silhouette
+**********
+
+`Roto, Paint, Keying - SilhouetteFX <http://www.silhouettefx.com/silhouette>`__
+
+OCIO is natively integrated in
+`4.5+ <http://www.silhouettefx.com/silhouette/silhouette-4.5-WhatsNew.pdf>`__
+Full support is provide for both image import/export, as well as image display.
+
+
+
+Nuke
+****
+
+`Compositor - The Foundry <http://www.thefoundry.co.uk/products/nuke>`__
+
+Nuke 6.3v7+ ships with native support for OpenColorIO. The OCIO configuration
+is selectable in the user preferences.
+
+OCIO Nodes: OCIOCDLTransform, OCIOColorSpace, OCIODisplay, OCIOFileTransform,
+OCIOLookConvert, OCIOLogConvert
+
+The OCIODisplay node is suitable for use in the Viewer as an input process (IP),
+and a register function is provides to add viewer options for each display upon
+launch.
+
+The OCIO config "nuke-default" is provided, which matches the built-in Nuke
+color processing. This profile is useful for those who want to mirror the native
+nuke color processing in other applications. (The underlying equations are
+also provided as python code in the config as well).
+
+A `video demonstration <http://vimeo.com/38773736>`__ of the Nuke OCIO workflow.
+
+Mari
+****
+
+`3D Paint - The Foundry <http://www.thefoundry.co.uk/products/mari>`__
+
+Mari 1.4v1+ ships with native support for OpenColorIO in their display toolbar.
+
+A `video demonstration <http://vimeo.com/32909648>`__ of the Mari OCIO workflow.
+
+Katana
+******
+
+`CG Pipeline / Lighting Tool - The Foundry <http://www.thefoundry.co.uk/products/katana>`__
+
+Color management in Katana (all versions) natively relies on OCIO.
+
+2D Nodes: OCIODisplay, OCIOColorSpace, OCIOCDLTransform
+Monitor Panel: Full OCIO Support
+
+Hiero
+*****
+
+`Conform & Review - The Foundry <http://www.thefoundry.co.uk/products/hiero>`__
+
+Hiero 1.0 will ship with native support for OCIO in the display and the
+equivalent of Nuke's OCIOColorSpace in the Read nodes.
+
+It comes with “nuke-default” OCIO config by default, so the Hiero viewer
+matches when sending files to Nuke for rendering.
+
+
+Photoshop
+*********
+OpenColorIO display luts can be exported as ICC profiles for use in photoshop.
+See the ociobakelut details below for additional info. The core idea is to
+create an .icc profile, with a valid description, and then to save it to the
+proper OS icc directory. (On OSX, ~/Library/ColorSync/Profiles/) Upon a
+Photoshop relaunch, Edit->Assign Profile, and then select your new OCIO lut.
+
+
+OpenImageIO
+***********
+
+`Open Source Image Library / Renderer Texture Engine <http://openimageio.org>`__
+
+Available in the current code trunk. Integration is with makecolortx (allowing
+for color space conversion during mipmap generation), and also through the
+public header `src/include/color.h <http://github.com/OpenImageIO/oiio/blob/master/src/include/color.h>`__ .
+
+Remaining integration tasks include
+`color conversion at runtime <http://github.com/OpenImageIO/oiio/issues/193>`__ .
+
+C++
+***
+The core OpenColorIO API is avaiable for use in C++. See the `export directory
+<http://github.com/imageworks/OpenColorIO/tree/master/export/OpenColorIO>`__
+for the C++ API headers. Minimal code examples are also available in the source
+code distribution. Of particular note are apps/ocioconvert and apps/ociodisplay.
+
+Python
+******
+The OpenColorIO API is available for use in python. See the "pyglue" directory
+in the codebase.
+
+
+Apps w/icc or luts
+******************
+flame (.3dl), lustre (.3dl), cinespace (.csp), houdini (.lut), iridas_itx (.itx)
+photoshop (.icc)
+
+Export capabilities through ociobakelut::
+
+ $ ociobakelut -- create a new LUT or icc profile from an OCIO config or lut file(s)
+ $
+ $ usage: ociobakelut [options] <OUTPUTFILE.LUT>
+ $
+ $ example: ociobakelut --inputspace lg10 --outputspace srgb8 --format flame lg_to_srgb.3dl
+ $ example: ociobakelut --lut filmlut.3dl --lut calibration.3dl --format flame display.3dl
+ $ example: ociobakelut --lut look.3dl --offset 0.01 -0.02 0.03 --lut display.3dl --format flame display_with_look.3dl
+ $ example: ociobakelut --inputspace lg10 --outputspace srgb8 --format icc ~/Library/ColorSync/Profiles/test.icc
+ $ example: ociobakelut --lut filmlut.3dl --lut calibration.3dl --format icc ~/Library/ColorSync/Profiles/test.icc
+ $
+ $
+ $ Using Existing OCIO Configurations
+ $ --inputspace %s Input OCIO ColorSpace (or Role)
+ $ --outputspace %s Output OCIO ColorSpace (or Role)
+ $ --shaperspace %s the OCIO ColorSpace or Role, for the shaper
+ $ --iconfig %s Input .ocio configuration file (default: $OCIO)
+ $
+ $ Config-Free LUT Baking
+ $ (all options can be specified multiple times, each is applied in order)
+ $ --lut %s Specify a LUT (forward direction)
+ $ --invlut %s Specify a LUT (inverse direction)
+ $ --slope %f %f %f slope
+ $ --offset %f %f %f offset (float)
+ $ --offset10 %f %f %f offset (10-bit)
+ $ --power %f %f %f power
+ $ --sat %f saturation (ASC-CDL luma coefficients)
+ $
+ $ Baking Options
+ $ --format %s the lut format to bake: flame (.3dl), lustre (.3dl),
+ $ cinespace (.csp), houdini (.lut), iridas_itx (.itx), icc (.icc)
+ $ --shapersize %d size of the shaper (default: format specific)
+ $ --cubesize %d size of the cube (default: format specific)
+ $ --stdout Write to stdout (rather than file)
+ $ --v Verbose
+ $ --help Print help message
+ $
+ $ ICC Options
+ $ --whitepoint %d whitepoint for the profile (default: 6505)
+ $ --displayicc %s an icc profile which matches the OCIO profiles target display
+ $ --description %s a meaningful description, this will show up in UI like photoshop
+ $ --copyright %s a copyright field
+
+
+
+See this `ocio-dev thread
+<http://groups.google.com/group/ocio-dev/browse_thread/thread/56fd58e60d98e0f6#>`__
+for additional usage discussions.
+
+When exporting an ICC Profile, you will be asked to specify your monitor’s
+profile (it will be selected for you by default). This is because ICC Profile
+are not LUTs per se. An ICC Profile describes a color space and then needs a
+destination profile to calculate the transformation. So if you have an operation
+working and looking good on the monitor you’re using (and maybe its
+profile has been properly measured using a spectrophotometer), then choose your
+display. If the transform was approved on a different monitor, then maybe you
+should choose its profile instead.
+
+
+RV (Beta)
+*********
+
+`Playback Tool - Tweak Software <http://www.tweaksoftware.com>`__
+
+`OCIO support in RV <https://github.com/imageworks/OpenColorIO/tree/master/src/rv>`__
+is currently being developed by Ben Dickson (dbr).
+
+See this `email thread <http://groups.google.com/group/ocio-dev/browse_thread/thread/955fc6271f89a28e>`__
+for additional details.
+
+This integration is currently considered a work in progress, and should not be
+relied upon for critical production work.
+
+
+Java (Beta)
+***********
+The OpenColorIO API is available for use in Java. See the `jniglue directory
+<http://github.com/imageworks/OpenColorIO/tree/master/src/jniglue>`__
+in the codebase.
+
+This integration is currently considered a work in progress, and should not be
+relied upon for critical production work.
+
+java.com
+
+
+Blender (Beta)
+**************
+`Open Source 3D Application <http://www.blender.org/>`__
+
+Blender currently has `limited support
+<http://wiki.blender.org/index.php/Dev:Source/Image/OpenColorIO#OpenColorIO_Integration>`__
+for OCIO.
+
+Xaview Thomas has begun the `Blender OCIO integration <http://github.com/thmxv/blender-ocio>`__ .
+Currently undergoing development.
+
+`Blender Developers Meeting Notes July 31, 2011
+<http://www.blendernation.com/2011/08/01/blender-developers-meeting-notes-july-31-2011>`__
+
+`YouTube Blender Example
+<http://www.youtube.com/watch?v=O43ItUVvcks>`__
+
+
+Ramen (Beta)
+************
+`Open Source Compositor <http://ramencomp.blogspot.com>`__
+
+Under development, with native OCIO color managment.
+
+
+CryEngine3 (Beta)
+*****************
+
+`Game Engine - Crytek (Cinema Sandbox) <http://mycryengine.com/index.php?conid=59>`__
+
+CryENGINE is a real-time game engine, targeting applications in the
+motion-picture market. While we don't know many details about the CryEngine
+OpenColorIO integration, we're looking forward to learning more as information
+becomes available.
+
diff --git a/docs/FAQ.rst b/docs/FAQ.rst
new file mode 100644
index 0000000..9530cec
--- /dev/null
+++ b/docs/FAQ.rst
@@ -0,0 +1,141 @@
+.. _faq:
+
+FAQ
+===
+
+License?
+********
+
+New BSD.
+
+You are welcome to include the OpenColorIO in commercial, or open source
+applications. See the :ref:`license` for further details.
+
+
+Terminology
+***********
+
+- Transform - a function that alters RGB(A) data (e.g transform an image from scene linear to sRGB)
+- Reference space - a space that connects colorspaces
+- Colorspace - a meaningful space that can be transferred to and from the reference space
+- Display - a virtual or physical display device (e.g an sRGB display device)
+- View - a meaningful view of the reference space on a Display (e.g a film emulation view on an sRGB display device)
+- Role - abstract colorspace naming (e.g specify the "lnh" colorspace as the scene_linear role)
+
+
+.. _faq-supportedlut:
+
+What LUT Formats are supported?
+*******************************
+
+========= =================================== ===============================
+Ext Details Notes
+========= =================================== ===============================
+3dl Autodesk Apps: Lustre, Flame, etc. Read + Write Support.
+ Supports shaper LUT + 3D
+ccc ASC CDL ColorCorrectionCollection Full read support.
+cc ASC CDL ColorCorrection Full read support.
+csp Cinespace (Rising Sun Research) Read + Write Support. Shaper is
+ LUT. Spline-based shaper LUT, with resampled into simple 1D LUT
+ either 1D or 3D LUT. with 2^16 samples.
+cub Truelight format. Shaper Lut + 3D Full read support.
+cube Iridas format. Either 1D or 3D Lut. Full read support
+hdl Houdini. 1D Lut, 3D lut, 1D shaper Only 'C' type is supported.
+ Lut Need to add R G B A RGB RGBA ALL.
+ No support for Sampling tag.
+ Header fields must be in strict order.
+look IRIDAS .look Read baked 3D LUT embedded in file.
+ No mask support.
+mga/m3d Pandora 3D lut Full read support.
+spi1d 1D format. Imageworks native 1D Full read support.
+ lut format. HDR friendly, supports
+ arbitrary input and output domains
+spi3d 3D format. Imageworks native 3D Full read support.
+ lut format.
+spimtx 3x3 matrix + color offset. Full read support.
+ Imageworks native color matrix
+ format
+vf Inventor 3d lut. Read support for 3d lut data
+ and global_transform element
+========= =================================== ===============================
+
+.. note::
+ Shaper LUT application in OCIO currently only supports linear interpolation.
+ For very small shaper LUT sizes this may not be sufficient. (CSP shaper luts
+ excluded; they do use spline interpolation at load-time).
+
+
+Can you query a color space by name (like "Rec709") and get back XYZ coordinates of its primaries and whitepoint?
+*****************************************************************************************************************
+
+Not currently.
+
+OCIO is a color configuration 'playback' tool that tries to be as flexible as possible;
+color information such as this is often only needed / relevant at configuration authoring time.
+Making primaries / whitepoint required would limit the pipeline OCIO could service. In the
+strictest sense, we would consider OCIO to be a 'baked' representation of color processes,
+similar to how Alembic files do not store animation rig data, but rather only the baked geometry.
+
+Also, remember that not all colorspaces using in visual effects even have strongly
+defined color space definitions. For example, scanned film negatives, when linearized with
+1d transfer curves (the historical norm in vfx), do not have defined primaries/white point.
+Each rgb value could of course individually be tied to a specific color, but if you were to
+do a sweep of the pure 'red channel', for example, you'd find that it creates a curves in
+chromaticity space, not a single point. (This is due to the 1d linearization not attempting
+to undo the subtractive processes that created the pixels in the first place.
+
+But many color spaces in OCIO *do* have very strongly defined white points/chromaticities.
+On the display side, for example, we have very precise information on this.
+
+Perhaps OCIO should include optional metadata to tag outputs? We are looking at this as
+as a OCIO 1.2 feature.
+
+Can you convert XYZ <-> named color space RGB values?
+*****************************************************
+
+OCIO includes a MatrixTransform, so the processing capability is there. But there is no convenience
+function to compute this matrix for you. (We do include other Matrix convenience functions though,
+so it already has a place to be added. See MatrixTransform in export/OpenColorTransforms.h)
+
+There's talk of extended OCIO 1.2 to have a plugin api where colorspaces could be dynamically
+added at runtime (such as after reading exr chromaticity header metadata). This would
+necessitate adding such a feature.
+
+
+What are the differences between Nuke's Vectorfield and OCIOFileTransform?
+**************************************************************************
+
+(All tests done with Nuke 6.3)
+
+========= ============================================= ===============================
+Ext Details Notes
+========= ============================================= ===============================
+3dl Matched Results
+ccc n/a
+cc n/a
+csp *Difference* Gain error. Believe OCIO is correct, but need to verify.
+cub Matched Results Note: Nuke's .cub exporter is broken (gain error)
+cube Matched Results
+hdl n/a
+mga/m3d n/a
+spi1d n/a
+spi3d n/a
+spimtx n/a
+vf *Difference* Gain error. Believe OCIO is correct, but need to verify.
+========= ============================================= ===============================
+
+All gain differences are due to a common 'gotcha' when interpolating 3d luts, related to
+internal index computation. If you have a 32x32x32 3dlut, when sampling values from (0,1)
+do you internally scale by 31.0 or 32.0? This is typically well-defined for each format,
+(in this case the answer is usually 31.0) but when incorrectly handled in an application,
+you occationally see gain errors that differ by this amount. (In the case of a 32-sized
+3dlut, 32/31 = ~3% error)
+
+
+What do ColorSpace::setAllocation() and ColorSpace::setAllocationVars() do?
+***************************************************************************
+
+These hints only come into play during GPU processing, and are used to determine proper
+colorspace allocation handling for 3D LUTs. See this page :ref:`allocationvars` for
+further information.
+
diff --git a/docs/License.rst b/docs/License.rst
new file mode 100755
index 0000000..9d35840
--- /dev/null
+++ b/docs/License.rst
@@ -0,0 +1,5 @@
+.. _license:
+
+License
+=======
+.. include:: LICENSE
diff --git a/docs/conf.py.in b/docs/conf.py.in
new file mode 100644
index 0000000..b08493b
--- /dev/null
+++ b/docs/conf.py.in
@@ -0,0 +1,110 @@
+# -*- coding: utf-8 -*-
+
+# See:
+# http://sphinx.pocoo.org/config.html
+
+import sys, os
+
+# -- Add PyOpenColorIO to sys.path
+sys.path.insert(0, "@CMAKE_BINARY_DIR@/src/pyglue")
+
+# -- General configuration -----------------------------------------------------
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.ifconfig']
+templates_path = ['templates']
+source_suffix = '.rst'
+master_doc = 'index'
+project = u'OpenColorIO'
+copyright = u'2010, Sony Pictures Imageworks'
+# The short X.Y version.
+version = '@OCIO_VERSION_MAJOR@.@OCIO_VERSION_MINOR@'
+# The full version, including alpha/beta/rc tags.
+release = '@OCIO_VERSION@'
+exclude_patterns = ['build', '*-prefix']
+#add_function_parentheses = True
+#add_module_names = True
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+#modindex_common_prefix = []
+
+rst_prolog = """
+.. |OCIO| replace:: *OCIO*
+.. |OpenColorIO| replace:: **OpenColorIO**
+.. _Sony Imageworks: http://www.imageworks.com/
+.. |Sony Imageworks| replace:: `Sony Imageworks`_
+.. _Jeremy Selan: mailto:jeremy.selan@gmail.com
+.. |Jeremy Selan| replace:: `Jeremy Selan`_
+.. _ocio-users: http://groups.google.com/group/ocio-users
+.. _ocio-dev: http://groups.google.com/group/ocio-dev
+"""
+
+# -- Options for HTML output ---------------------------------------------------
+html_theme_path = ['.']
+html_theme = 'ociotheme'
+#html_theme_options = {}
+#html_title = None
+#html_short_title = None
+#html_logo = None
+#html_favicon = None
+html_static_path = []
+#html_last_updated_fmt = '%b %d, %Y'
+#html_use_smartypants = True
+#html_sidebars = {}
+#html_additional_pages = {}
+html_domain_indices = ['cpp-modindex', 'py-modindex']
+#html_use_index = True
+#html_split_index = False
+#html_show_sourcelink = True
+#html_show_sphinx = True
+#html_show_copyright = True
+#html_use_opensearch = ''
+#html_file_suffix = None
+htmlhelp_basename = 'OpenColorIOdoc'
+
+# -- Options for LaTeX output --------------------------------------------------
+#latex_paper_size = 'letter'
+#latex_font_size = '10pt'
+latex_documents = [
+ ('index', 'OpenColorIO.tex', u'OpenColorIO Documentation',
+ u'Sony Pictures Imageworks', 'manual', False),
+]
+latex_elements = {
+ 'preamble': '\setcounter{tocdepth}{2}',
+ 'footer': 'test...123'
+}
+
+#latex_logo = None
+#latex_use_parts = False
+#latex_show_pagerefs = False
+#latex_show_urls = False
+#latex_preamble = '\setcounter{tocdepth}{2}'
+#latex_appendices = []
+latex_domain_indices = ['cpp-modindex', 'py-modindex']
+
+# -- Options for manual page output --------------------------------------------
+man_pages = [
+ ('index', 'opencolorio', u'OpenColorIO Documentation',
+ [u'Sony Pictures Imageworks'], 1)
+]
+
+# -- Options for Texinfo output ------------------------------------------------
+texinfo_documents = [
+ ('index', 'OpenColorIO', u'OpenColorIO Documentation', u'Sony Pictures Imageworks',
+ 'OpenColorIO', 'One line description of project.', 'Miscellaneous'),
+]
+texinfo_appendices = []
+
+# -- Options for Epub output ---------------------------------------------------
+epub_title = u'OpenColorIO'
+epub_author = u'Sony Pictures Imageworks'
+epub_publisher = u'Sony Pictures Imageworks'
+epub_copyright = u'2010, Sony Pictures Imageworks'
+#epub_language = ''
+#epub_scheme = ''
+#epub_identifier = ''
+#epub_uid = ''
+#epub_cover = ()
+#epub_pre_files = []
+#epub_post_files = []
+#epub_exclude_files = []
+#epub_tocdepth = 3
+#epub_tocdup = True
diff --git a/docs/configurations/allocation_vars.rst b/docs/configurations/allocation_vars.rst
new file mode 100644
index 0000000..9cb2a05
--- /dev/null
+++ b/docs/configurations/allocation_vars.rst
@@ -0,0 +1,119 @@
+.. _allocationvars:
+
+How to Configure ColorSpace Allocation
+======================================
+
+The allocation / allocation vars are utilized using during GPU 3dlut / shader
+text generation. (Processor::getGpuShaderText, Processor::getGpuLut3D).
+
+If, in the course of GPU processing, a 3D lut is required, the "allocation /
+allocation vars" direct how OCIO should sample the colorspace, with the intent
+being to maintain maximum fidelity and minimize clamping.
+
+Currently support allocations / variables:
+
+ALLOCATION_UNIFORM::
+ 2 vars: [min, max]
+
+ALLOCATION_LG2::
+ 2 vars: [lg2min, lg2max]
+ 3 vars: [lg2min, lg2max, linear_offset]
+
+So say you have an srgb image (such as an 8-bit tif), where you know the data
+ranges between 0.0 - 1.0 (after converting to float). If you wanted to apply
+a 3d lut to this data, there is no danger in samplingthat space uniformly and
+clamping data outside (0,1). So for this colorspace we would tag it:
+
+.. code-block:: yaml
+
+ allocation: uniform
+ allocationvars: [0.0, 1.0]
+
+These are the defaults, so the tagging could also be skipped.
+
+But what if you were actually first processing the data, where occasionally
+small undershoot and overshoot values were encountered? If you wanted OCIO to
+preserve this overshoot / undershoot pixel information, you would do so by
+modifying the allocation vars.
+
+.. code-block:: yaml
+
+ allocation: uniform
+ allocationvars: [-0.125, 1.125]
+
+This would mean that any image data originally within [-0.125, 1.125] will be
+preserved during GPU processing. (Protip: Data outside this range *may*
+actually be preserved in some circumstances - such as if a 3d lut is not needed
+- but it's not required to be preserved).
+
+So why not leave this at huge values (such as [-1000.0, 1000.0]) all the time?
+Well, there's a cost to supporting this larger dynamic range, and that cost is
+reduced precision within the 3D luts sample space. So in general you're best
+served by using sensible allocations (the smallest you can get away with, but
+no smaller).
+
+Now in the case of high-dynamic range color spaces (such as float linear), a
+uniform sampling is not sufficient because the max value we need to preserve is
+so high.
+
+Say you were using a 32x32x32 3d lookup table (a common size). Middle gray is
+at 0.18, and specular values are very much above that. Say the max value we
+wanted to preserve in our coding space is 256.0, each 3d lut lattice coordinates
+would represent 8.0 units of linear light! That means the vast majority of the
+perceptually significant portions of the space wouldnt be sampled at all!
+
+unform allocation from 0-256\:
+0
+8.0
+16.0
+...
+240.0
+256.0
+
+So another allocation is defined, lg2
+
+.. code-block:: yaml
+
+ - !<ColorSpace>
+ name: linear
+ description: |
+ Scene-linear, high dynamic range. Used for rendering and compositing.
+ allocation: lg2
+ allocationvars: [-8, 8]
+
+In this case, we're saying that the appropriate ways to sample the 3d lut are
+logarithmically, from 2^-8 stops to 2^8 stops.
+
+Sample locations:
+2^-8\: 0.0039
+2^-7\: 0.0078
+2^-6\: 0.0156
+...
+2^0\: 1.0
+...
+2^6\: 64.0
+2^7\: 128.0
+2^8\: 256.0
+
+Which gives us a much better perceptual sampling of the space.
+
+The one downside of this approach is that it can't represent 0.0,
+which is why we optionally allow a 3d allocation var, a black point
+offset. If you need to preserve 0.0 values, and you have a high
+dynamic range space, you can specify a small offset.
+
+Example:
+
+.. code-block:: yaml
+
+ allocation: lg2
+ allocationvars: [-8, 8, 0.00390625]
+
+The [-15.0, 6.0] values in spi-vfx come from the fact that all of the
+linearizations provided in that profile span the region from 2^-15
+stops, to 2^6 stops. One could probably change that black point to a
+higher number (such as -8), but if you raised it too much you would
+start seeing black values be clipped. Conversely, on the high end
+one could raise it a bit but if you raised it too far the precision
+would suffer around gray, and if you lowered it further you'd start to
+see highlight clipping.
diff --git a/docs/configurations/images/spi-vfx/gn10_to_linear_light.jpeg b/docs/configurations/images/spi-vfx/gn10_to_linear_light.jpeg
new file mode 100644
index 0000000..ffc228e
--- /dev/null
+++ b/docs/configurations/images/spi-vfx/gn10_to_linear_light.jpeg
Binary files differ
diff --git a/docs/configurations/images/spi-vfx/gnf_to_linear_light.jpeg b/docs/configurations/images/spi-vfx/gnf_to_linear_light.jpeg
new file mode 100644
index 0000000..25deaf4
--- /dev/null
+++ b/docs/configurations/images/spi-vfx/gnf_to_linear_light.jpeg
Binary files differ
diff --git a/docs/configurations/images/spi-vfx/lg10_to_linear_light.jpeg b/docs/configurations/images/spi-vfx/lg10_to_linear_light.jpeg
new file mode 100644
index 0000000..cbef9b4
--- /dev/null
+++ b/docs/configurations/images/spi-vfx/lg10_to_linear_light.jpeg
Binary files differ
diff --git a/docs/configurations/images/spi-vfx/lg8_to_vd8.jpeg b/docs/configurations/images/spi-vfx/lg8_to_vd8.jpeg
new file mode 100644
index 0000000..ba49ad4
--- /dev/null
+++ b/docs/configurations/images/spi-vfx/lg8_to_vd8.jpeg
Binary files differ
diff --git a/docs/configurations/images/spi-vfx/lgf_to_linear_light.jpeg b/docs/configurations/images/spi-vfx/lgf_to_linear_light.jpeg
new file mode 100644
index 0000000..8b897ed
--- /dev/null
+++ b/docs/configurations/images/spi-vfx/lgf_to_linear_light.jpeg
Binary files differ
diff --git a/docs/configurations/index.rst b/docs/configurations/index.rst
new file mode 100644
index 0000000..0284d34
--- /dev/null
+++ b/docs/configurations/index.rst
@@ -0,0 +1,22 @@
+.. _configurations:
+
+Configurations
+==============
+
+This section gives an overview of what existing (public) OCIO configuration exist,
+and how to create new ones.
+
+OCIO Configurations can be downloaded here: `.zip <http://github.com/imageworks/OpenColorIO-Configs/zipball/master>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO-Configs/tarball/master>`__ (OCIO v1.0+)
+
+If you are interested in crafting custom color configurations, and need assistance, please contact: ocio-dev_\ ``@googlegroups.com``
+
+.. toctree::
+ :maxdepth: 1
+
+ spi_pipeline
+
+ spi_vfx
+ spi_anim
+ nuke_default
+
+ allocation_vars
diff --git a/docs/configurations/nuke_default.rst b/docs/configurations/nuke_default.rst
new file mode 100644
index 0000000..7e3a7ee
--- /dev/null
+++ b/docs/configurations/nuke_default.rst
@@ -0,0 +1,19 @@
+Nuke default
+============
+
+This profile corresponds to the default Nuke color configuration (currently generated from Nuke 6.1).
+
+If you have made modifications to a nuke color configuration, and wish to re-export your own custom OCIO profile, please refer to the nuke_to_ocio utility script distributed with OpenColorIO.
+
+The following color transforms are defined:
+
+- linear
+- sRGB
+- rec709
+- Cineon
+- Gamma 1.8
+- Gamma 2.2
+- Panalog
+- REDLog
+- ViperLog
+- REDSpace
diff --git a/docs/configurations/spi_anim.rst b/docs/configurations/spi_anim.rst
new file mode 100644
index 0000000..49a7779
--- /dev/null
+++ b/docs/configurations/spi_anim.rst
@@ -0,0 +1,4 @@
+spi-anim
+========
+
+This is a real OCIO color profile in use at Sony Pictures Imageworks, and is suitable for use on animated features. The concepts utilized in this profile have been successfully validated on a variety of Sony Pictures Animation features including Cloudy With A Chance Of Meatballs, Surf's Up, and Arthur Christmas.
diff --git a/docs/configurations/spi_pipeline.rst b/docs/configurations/spi_pipeline.rst
new file mode 100644
index 0000000..c508899
--- /dev/null
+++ b/docs/configurations/spi_pipeline.rst
@@ -0,0 +1,74 @@
+Sony Pictures Imageworks Color Pipeline
+=======================================
+
+This document describes a high-level overview on how to emulate the current color management practice at Sony Imageworks. It applies equally to all profiles used at Imageworks, including both the VFX and Animation profiles. It's by no means a requirement to follow this workflow at your own facility, this is merely a guideline on how we choose to work.
+
+General Pipeline Observations
+*****************************
+
+* All images, on disk, contain colorspace information as a substring withing the filename. This is obeyed by all applications that load image, write images, or view images. File extensions and metadata are ignored with regards to color processing.
+
+ Example::
+
+ colorimage_lnf.exr : lnf
+ dataimage_ncf.exr : ncf
+ plate_lg10.dpx : lg10
+ texture_dt8.tif: dt8
+
+ Note: fileformat extension does NOT imply a color space. Not all dpx files are lg10. Note all tif images are dt8.
+
+* The common file formats we use are exr, tif, dpx.
+
+ * render outputs: exr
+ * render inputs (mipmapped-textures): exr, tif (txtif)
+ * photographic plates (scans): dpx
+ * composite outputs: dpx, exr
+ * on-set reference: (camera raw) NEF, CR2, etc.
+ * painted textures: psd, tif
+ * output proxies: jpg
+
+* All pipelines that need to be colorspace aware rely on ``Config.parseColorSpaceFromString``.
+
+* Color configurations are show specific. The $OCIO environment variable is set as part of a 'setshot' process, before other applications are launched. Artists are not allowed to work across different shows without using a fresh shell + setshot.
+
+* While the list of colorspaces can be show specific, care is taken to maintain similar naming to the greatest extent feasible. This reduces artist confusion. Even if two color spaces are not identical across shows, if they serve a similar purpose they are named the same. Example: We label 10-bit scanned film negatives as lg10. Even if two different shows use different acquisition film stocks, and rely on different linearization curves, they are both labelled lg10.
+
+* There is no explicit guarantee that image assets copied across shows will be transferable in a color-correct manner. For example, in the above film scan example, one would not expect that the linearized versions of scans processed on different shows to match. In practice, this is not a problematic issue as the colorspaces which are convenient to copy (such as texture assets) happen to be similarly defined across show profiles.
+
+
+Rendering
+*********
+
+* Rendering and shading occurs in a scene-linear floating point space, typically named "ln". Half-float (16-bit) images are labelled lnh, full float images (32-bit) are labelled lnf.
+
+
+* All image inputs should be converted to ln prior to render-time. Typically, this is done when textures are published. (See below)
+
+* Renderer outputs are always floating-point. Color outputs are typically stored as lnh (16-bit half float). Data outputs (normals, depth data, etc) are stored as ncf ("not color" data, 32-bit full float). Lossy compression is never utilized.
+
+* Render outputs are always viewed with an OCIO compatible image viewer. Thus, for typical color imagery the lnf display transform will be applied. In Nuke, this can be emulated using the OCIODisplay node. A standalone image viewer, ociodisplay, is also included with OpenColorIO src/example.
+
+
+Texture Painting / Matte Painting
+*********************************
+
+* Textures are painted in non-OCIO color-managed environment. (Photoshop, etc).
+
+* At texture publish time, before mipmaps are generated, all color processing is applied. Internally at SPI we use a modified version of OpenImageIO's maketx that also links to OpenColorIO. We intend to make this code available as soon as possible. In the meantime, the OpenColorIO 'ocioconvert' script included in examples can be relied upon. Color processing (linearization) is applied before mipmap generation in order to assure energy preservation in the render. If the opposite processing order were used, (mipmap in the original space, color convert in the shader), the apparent intensity of texture values would change as the object approached to receeded to the camera.
+
+* The original texture filenames contain the colorspace information as a substring, to signify processing intent.
+
+ * Textures that contain data (bump maps, opacity maps, blend maps, etc) are labelled with the nc colorspaces according to their bitdepth. Ex: an 8-bit opacity map -> skin_opacity_nc8.tif
+
+ * Painted textures that are intended to modulate diffuse color components are labelled dt (standing for "diffuse texture"). The dt8 colorspace is designed such that, when linearized, values will not extend above 1.0. At texture publishing time these are converted to lnh mipmapped tiffs/exr. Note that as linear textures have greater allocation requirements, a bit depth promotion is required in this case. I.e., even if the original texture as painted was only 8-bits, the mipmapped texture will be stored as a 16-bit float image.
+
+ * Painted environment maps, which may be emissive as labelled vd (standing for 'video'). These values, when linearized, have the potential to generate specular information well above 1.0. Note that in the current vd linearization curves, the top code values may be very "sensitive". I.e., very small changes in the initial code value (such as 254->255) may actually result in very large differences in the estimated scene-linear intensity. All environment maps are store as lnh mipmapped tiffs/exr. The same bit-depth promotion as in the dt8 case is required here.
+
+
+Compositing
+***********
+
+* The majority of compositing operations happen in scene-linear, lnf, colorspace.
+* All image inputs are linearized to lnf as they are loaded. Customized input nodes make this processing convenient. Rendered elements, which are stored in linear already, do not require processing. Photographic plates will typically be linearized according to their source type, (lg10 for film scans, gn10 for genesis sources, etc).
+* All output images are de-linearized from lnf when they are written. A customized output node makes this convenient.
+* On occasion log data is required for certain processing operations. (Plate resizing, pulling keys, degrain, etc). For each show, a colorspace is specified as appropriate for this operation. The artist does not have to keep track of which colorspace is appropriate to use; the OCIOLogConvert node is always intended for this purpose. (Within the OCIO profile, this is specified using the 'compositing_log' role).
diff --git a/docs/configurations/spi_vfx.rst b/docs/configurations/spi_vfx.rst
new file mode 100644
index 0000000..9e6cc96
--- /dev/null
+++ b/docs/configurations/spi_vfx.rst
@@ -0,0 +1,186 @@
+.. _config-spivfx:
+
+spi-vfx
+=======
+
+This is a real OCIO color profile in use at Sony Pictures Imageworks, and is suitable for use on visual effects (VFX) work. The concepts utilized in this profile have been successfully validated on a variety of Imageworks visual effects films, including Spider-Man, Alice In Wonderland, G-Force, and Green Lantern.
+
+**Conversion from film to/from scene-linear is a simple, trivially invertible 1D transform. The display transforms are complex, 3D film-print emulations.**
+
+In production, this profile is typically used before final color details are worked out. Although it sounds temporary, most of a film can be made off this configuration. Final color decisions for a film are often made long after significant work has been done. In some cases shots from a film can be finaled before the color details, such as which Digital Intermediate (DI) house will be used, are decided. Entire projects have been completed using this profile without modification.
+
+This profile embodies two philosophies of color management familiar to those in production: *"Keep It Simple"*, and, *"Don't Be Evil"*.
+
+The following steps outline a simplified visual effects color workflow:
+
+* Load a plate (log film scan, digital motion picture camera, etc)
+* Convert device color space to scene-linear
+* Render and composite in scene-linear
+* Convert from scene-linear to device color space
+* Output final plate
+
+It is absolutely critical to guarantee that process - end to end - is colorimetrically a no-op. Under no circumstances are any unintended modifications to the original image allowed.
+
+Thus, this profile uses very simple (1D) conversions for all input and output color space conversions. All of the complexity (the 3D LUT film emulation lifting) is handled at display time, and is never baked (or unbaked) into the imagery. For visualization, this profile includes a generic Kodak Vision print emulation suitable for display on a reference sRGB monitor or a P3 Digital Cinema projector.
+
+Caveot 1: Of course, we realize that there are many other color workflows that may be equally good (or better) than the one presented here. Please, if you have a successful alternative workflows share the details!
+
+Caveot 2: We are not distributing the code that generates the luts from their underlying curve representations. While we hope to publish this eventually, at the current time this process relies on internal tools and we don't have the spare development cycles to port this code to something suitable for distribution.
+
+
+Invertibility
++++++++++++++
+
+Elements often need to be transferred back and forth many times between different colorspaces. Since it’s impossible to know in advance how many times an image may be transferred between colorspaces it is essential for the majority of transformations to be lossless invertible transformations. By the end of the color pipeline even a 1 value difference in a 10bit transformation can become a significant issue. Invertible transformations can be taken from the source space, to linear and back with no change to the data. A higher value is placed on transformations being predictable and invertible than absolutely correct. All 1-d luts allow for forward and inverse transformations with no loss. Unless specified all channels are equally affected. The luts are 1 bit wider than stated, so lg8 actually defines 9 bits worth of entries. This allows the rounding in the inverse direction to be applied unambiguously (lossless).
+
+Non-invertible transforms contain 3d lookups. 3D transformations can not be inverted due to gamut mapping issues. Non-invertible transformations are only used for final output media (such as QuickTimes) and for display purposes.
+
+Film Emulation Inversion
+++++++++++++++++++++++++
+
+Inverse film emulation luts aren’t supported in a default configuration. Imageworks does not use a film emulation inversion lut for texture or matte paintings. In its place a film emulation preview lut, commonly as an ICC profile, is used. Although most film emulation luts are similar they do differ significantly. The DI facility creating final color is often chosen long after significant vfx work has been begun. The film luts the film will be finished on are not made until weeks, or days, before DI begins. So the ‘true’ lut that will be used for the finishing is not available until very late in the production, from a VFX perspective. There are many color gamut mapping issues that arise when inverting film to video lut. Using a film inversion lut at this stage would bake in a look that isn't quite right and is very difficult to fully un-bake. It is safer to work with images in a non-constrained way and apply a visualization that can be toggled on and off.
+
+Scene Linear
+************
+
+**lnf, lnh, ln16**
+
+**Middle Gray: 0.18**
+
+The linear space is a photometrically linear space, representing high-dynamic range (HDR) pixel values in our virtual world. Middle gray is defined to be at 0.18. While the dynamic range of lnf is technically unbounded, pixel values for natural, well exposed imagery will often fall between +/- 8 stops from gray.
+
+The scene linear colorspace is used for compositing, rendering, and is also the profile connection space. All colorspace conversions are made in relation how they transform into or out of scene linear.
+
+The colors defined in linear are implicitly bounded by film negative sensitivities. The space is based off an OCN film scan where values refer to linear light at the focal plane. 0.18 in linear will correspond to a %18 percent grey card captured on filmplane under the same lighting conditions where diffuse white is 1.0. Values above 1.0 in any channel would indicate a 'specular', or light emitting objects.
+
+lnf is a full precision (32-bit) floating point colorspace. It is used for rendering and compositing.
+
+lnh is a half precision (16-bit) floating point colorspace. It is used for rendering and compositing.
+
+ln16 is a 16 bit integer representation of the [0,1] range of lnf. This is no longer used but is kept if a legacy image needs to be loaded, or if linear images need to be loaded into an application that does not support float. Note that storing a float lnf image using an integer ln16 representation is destructive, and throws away data.
+
+
+Film Log
+********
+
+**lg8, lg10, lg16, lgf**
+
+**Middle Gray: 445 (of 1023)**
+
+The log to linear curve is based on an analysis of several commonly used Kodak acquisition stocks. It was found that Kodak 5218 is right about in the middle in terms of tone response given the input imagery we receive. The curve incorporates some toe compensation. The curve gamma closely matches 5218. The transformation does not represent any single stock. The Imageworks log conversions are not channel specific, all color channels are transformed uniformly. Compositing productivity gains have been found using the toe compensations when compared to using a straight line log to linear curve. Shoulder compensation - while technically correct - detracted from compositing quality, often creating situations where grain film noise would result in larger than desired changes in linear light.
+
+lg8, lg10, and lg16 are similar. They are all the same log to linear transformation but are explicitly defined to be lossless at the specified bit depths. The luts use nearest neighbor interpolation to search for an exact match. Significant performance gains were found when using the proper bitdepth lut. While using the lg16 conversion on an 8 bit image will yield the same result, it is measurably slower than using the 8-bit conversion (assuming 8-bits is all that is needed). This performance gap remains even on current graphics hardware.
+
+.. figure:: images/spi-vfx/lg10_to_linear_light.jpeg
+ :align: center
+
+ lg10 to linear light. The green curve represents the lg to ln conversion. The red curve show the green channel of a Kodak 5218 exposure test. The x-axis is in 10bit input lg the output is in lg base2 linear light units. 0.0 Represents diffuse white.
+
+lg spaces specify 21 of stops of dynamic range. 0 in lg10 space is 15 stops below diffuse white. 445 correspond to 18% grey and is ~2.47 below diffuse white. 1023 in lg10 space is 6 stops above diffuse white.
+
+lgf is identical on the range from 0-1 to the standard lg luts. It specifies an additional range below 0.0 and above 1.0. In 10 bit the spaces is defined from -512 to 2048. Lg color timing number from either on set color correction devices or from a DI house to be applied in a way that can be fully inverted out without loss. Lgf specifies 18 stops above the lg10 max and 36 stops below the log10 min with a total dynamic range of 85 stops. The space is designed to be bigger than needed.
+
+
+.. figure:: images/spi-vfx/lgf_to_linear_light.jpeg
+ :align: center
+
+ lgf to linear light. The green curve represents the lg to ln conversion. The red curve show the green channel of a Kodak 5218 exposure test. The x axis is in 10bit input lg the output is in log(base2) linear light units. 0 Represents diffuse white
+
+
+Panalog (Genesis)
+*****************
+
+**gn8, gn10, gn16, gnf**
+
+GN is the Imageworks Panalog space. It follows the Panalog specification and additionally extrapolates so all of the values from 0 to 1023 are defined. This was necessary due to compression artifacts that could create values below the Panalog specifications. gn8,10,16 are defined with diffuse white at 681, Max white is approximately 2.6 stops above diffuse white and black is approximately 12.6 stops below diffuse white. The dynamic range is less than that of lg.
+
+.. figure:: images/spi-vfx/gn10_to_linear_light.jpeg
+ :align: center
+
+ gn10 to linear light. the x axis is in 10bit Panalog values. The Y axis is in linear light. The green curve is the gn curve. the red curve is the Panalog data.
+
+gnf is similar in purpose and function to lgf. It is identical on the range from 0-1 to the regular gn and specifies an additional range below 0.0 and above 1.0. In 10 bit numbers gnf is defined from -255 to 3125. This allows for color timing number from either on set color correction devices or from a DI house to be applied in a way that can be fully inverted. Additionally it allows for lg10 based image data to be fully represented without clipping.
+
+gnf specifies 14.5 stops above the gn10 max and 18 of stops below the gn10 min. The entire range of gnf is 47 stops.
+
+.. figure:: images/spi-vfx/gnf_to_linear_light.jpeg
+ :align: center
+
+ gnf to linear light. the x axis is in 10bit Panalog values. The Y axis is in linear light. The green curve is the gn curve. the red curve is the Panalog data. Only a subset of the function is used to define the gnf solorspace
+
+
+Reference Art
+*************
+
+**vd8, vd16, vdf, hd10**
+
+The vd spaces are mappings of linear image data into display space. The main part of the transformation is defined as a single curve that is conceptually two parts. The first is a ln to lg conversion. The second is lg to sRGB conversion. This is based off the neutral channel response of the sRGB film emulation lut used in the profile. The dynamic range of the vd colorspace is limited. It is undesirable to map the vd max to the linear max. Such a conversion results in linear values are almost never what an artist intended. The rule of thumb is that, at the high end, single value deltas in an 8 bit image should never create over a half stop of additional linear light. The vd conversion curve is limited to prevent this case.
+
+.. figure :: images/spi-vfx/lg8_to_vd8.jpeg
+ :align: center
+
+ The curve used to map from Lg8 to vd 8. The x-axis is in lg8 units, the y-axis is in vd8 units.
+
+The dynamic range of the vd is limited to around 2.5 stops above diffuse white. This has two positive attributes. It allows vd to be used to directly on matte paintings. It also allows all of vd to be represented in a gn10 image. The last part of the transformation is a matrix transformation that moves the whitepoint of film to look correct when displayed with a d65 whitepoint.
+
+The main use of this colorspace is to import RGB images with an unknown colorspace. This colorspace no longer gets much use alone; However it is an integral part of many conversions. It is also part of the matte painting and diffuse texture pipelines.
+
+vdf works differently than the other floating spaces. It still only defines the color transformation from 0-1. This colorspace is used when we receive video space encoded exr's.
+
+HD10 is a vd based space that is used for importing and exporting REC709 range broadcast material. This works very well for broadcast camera native material and poorly for material with a film emulation lut baked in. This transformation works well exporting film based material to tape, even though it lacks a film emulation lut. It does not give an accurate color rendering but created a pleasing image that makes clients happy.
+
+Structurally the conversion is a matrix operation that scales the data then adds an offset to limit the range from 64-940. From there the standard vd transformation is applied.
+
+Texture Painting
+****************
+
+**dt8, dt16**
+
+DT 8,16 - Diffuse texture colorspaces. These colorspaces are used for the conversion of textures painted in video space into a range limited linear space for use in rendering. The Color space is based on the vd transformation but limits the conversion into linear space so that no values above diffuse white can be created. This ensures that textures do not add light to a render. This is achieved by using a matrix transformation to limit the mapping of vd to the linear value of diffuse white.
+
+Data
+****
+
+**nc8, nc10, nc16, ncf**
+
+Non-Color (NC) spaces are used to hold any data that needs to be processed though the color pipeline unaltered. These are data spaces and can hold anything such as point clouds, normals, untagged reference art, etc. These data spaces do not get transformations applied at any point.
+
+
+Display Transforms
+******************
+
+**srgb8, p3dci8, xyz16**
+
+**srgb8** bakes in the film3d emulation lut. This table can be used for either QuickTime generation or output to the sRGB display. The transformation is a 3d film emulation table with gray balance compensation, so a value of 445,445,445 in lg10 space os modified to become equal RGB values in sRGB. Additionally the lut is scaled so that at least one of the color channels on maximum white uses the display max.
+
+The transformation takes place in three parts. First the linear data is converted to the show log space. Then a film emulation table is applied. Then the grey balance and white scaling compensation are applied. This table is designed to be evaluated in a dimly lit office environment on a sRGB display.
+
+**p3dci8** is an implementation of film emulation table that has an output of DCI P3. This is only ever used for driving DLPs for display. The transformation has two parts. First the linear image data is converted to lg10 based image data then the DCI P3 film emulation lut is applied. No additional compensations are made.
+
+**xyz16** is designed for the creation of a Digital Cinema Distribution Master (DCDM). The color matches that of the P3 output (dlpqt8), but has an additional output transformation to convert to X'Y'Z'. The transformation takes the linear image data and converts it to lg, then applies the filmlook. The data is then in DCI P3 colorspace. That data is converted to display linear P3, using an inverse gamma curve. A matrix conversion is then used to transform from DCI P3’ into XYZ’. The final step is to reapply the gamma 2.6 to result in XYZ16 values.
+
+In this profile each display has three identical looks defined. The names are kept consistent between devices to minimize confusion. OCIO uses a specific tag to associate colorspaces with displays. The tags are nothing more than links to already defined colorspaces.
+
+**Film** is the image displayed though a film emulation lut. This visualization is display compensated and should visually match between a sRGB display and a P3 projector. The goal is to match how the film will look in a DI. The luts in use for this profile roughly match the Sony ColorWorks environment.
+
+**Raw** visualization shows the image data on the screen with no display compensation. This is used for image debugging purposes, for instance to see if potential image discontinuities are in the source data or the visualization.
+
+**Log** visualization displays the image as if it were converted to the show specific log. This is transformation also has no display compensation. The common use for this us to see how well elements fit into the comp without the film emulation lut disguising any flaws. Old school compositors love it for grain matching.
+
+sRGB Film : srgb8
+sRGB Raw : nc10
+sRGB Log : lg10
+
+DCIP3 Raw : nc10
+DCIP3 Log : lg10
+DCIP3 Film : dlpqt8
+
+
+Display Calibration
+*******************
+
+**sRGB** is the supported desktop display specification, calibrated to the sRGB standard and viewed in a dim office environment. As Imageworks switched from crt based display devices to LCD based devices a number of possible colorspaces were explored. It was a long decision but sRGB was chosen for a few reasons. An important one was that almost every display manufacturer can implement sRGB, reasonable well. This becomes a boon when we work needs to be done outside of our main facilities. Even a consumer display with calibration can come close to matching the sRGB standard. Since so many monitor manufacturers can hit sRGB calibration we are not tied to purchasing from a specific vendor. It becomes unnecessary to specify a specific display to with productions or external vendors. It also reduces the amount of studio specific color requirements that need to be communicated when working with other facilities. 80 cd/m^2, D65 white point, srgb gamma function (approx 2.4)
+
+**P3** was deemed especially unusable on the desktop. The full specification requires a white point of 48 cd/m^2. To adapt P3 for desktop use (in dim ambient environments), the whitepoint luminance needed to be raised. The specified 2.6 gamma is very challenging to the current display technology on very dark colors. This meant that we would have a special Imageworks video P3. A custom colorspace wouldn't make compositing better and would require a conversation, or conversion, every time video was sent out of house.
+
+**DCIP3** is a projector calibrated to DCI P3 mastering specification in a theatrical mastering environment. We use a mix of display technologies, SXRD and DLP, depending on application. Gamma 2.6. Traditional DCI calibration.
diff --git a/docs/developers/api/index.rst b/docs/developers/api/index.rst
new file mode 100644
index 0000000..eccef5c
--- /dev/null
+++ b/docs/developers/api/index.rst
@@ -0,0 +1,6 @@
+.. toctree::
+ :maxdepth: 1
+
+ OpenColorIO
+ OpenColorTransforms
+ OpenColorTypes
diff --git a/docs/developers/bindings/PythonAPI.rst b/docs/developers/bindings/PythonAPI.rst
new file mode 100644
index 0000000..839e9d2
--- /dev/null
+++ b/docs/developers/bindings/PythonAPI.rst
@@ -0,0 +1,147 @@
+##########
+Python API
+##########
+
+Description
+===========
+
+A color configuration (:py:class:`Config`) defines all the color spaces to be
+available at runtime.
+
+(:py:class:`Config`) is the main object for interacting with this library.
+It encapsulates all the information necessary to use customized
+:py:class:`PyOpenColorIO.ColorSpaceTransform` and
+:py:class:`PyOpenColorIO.DisplayTransform` operations.
+
+See the :ref:`user-guide` for more information on selecting, creating,
+and working with custom color configurations.
+
+For applications interested in using only one color configuration at
+a time (this is the vast majority of apps), their API would
+traditionally get the global configuration and use that, as
+opposed to creating a new one. This simplifies the use case
+for plugins and bindings, as it alleviates the need to pass
+around configuration handles.
+
+An example of an application where this would not be
+sufficient would be a multi-threaded image proxy server
+(daemon) that wants to handle multiple show configurations
+concurrently in a single process. This app would need to keep
+multiple configurations alive, and manage them appropriately.
+
+Roughly speaking, a novice user should select a default
+configuration that most closely approximates the use case
+(animation, visual effects, etc.), and set the :envvar:`OCIO`
+environment variable to point at the root of that configuration.
+
+.. note::
+ Initialization using environment variables is typically preferable
+ in a multi-app ecosystem, as it allows all applications to be consistently configured.
+
+.. note::
+ Paths to LUTs can be relative. The search paths are defined in :py:class:`Config`.
+
+See :ref:`developers-usageexamples`
+
+Examples of Use
+---------------
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+
+ # Load an existing configuration from the environment.
+ # The resulting configuration is read-only. If $OCIO is set, it will use that.
+ # Otherwise it will use an internal default.
+ config = OCIO.GetCurrentConfig()
+
+ # What color spaces exist?
+ colorSpaceNames = [ cs.getName() for cs in config.getColorSpaces() ]
+
+ # Given a string, can we parse a color space name from it?
+ inputString = 'myname_linear.exr'
+ colorSpaceName = config.parseColorSpaceFromString(inputString)
+ if colorSpaceName:
+ print 'Found color space', colorSpaceName
+ else:
+ print 'Could not get color space from string', inputString
+
+ # What is the name of scene-linear in the configuration?
+ colorSpace = config.getColorSpace(OCIO.Constants.ROLE_SCENE_LINEAR)
+ if colorSpace:
+ print colorSpace.getName()
+ else:
+ print 'The role of scene-linear is not defined in the configuration'
+
+ # For examples of how to actually perform the color transform math,
+ # see 'Python: Processor' docs.
+
+ # Create a new, empty, editable configuration
+ config = OCIO.Config()
+
+ # Create a new color space, and add it
+ cs = OCIO.ColorSpace(...)
+ # (See ColorSpace for details)
+ config.addColorSpace(cs)
+
+ # For additional examples of config manipulation, see
+ # https://github.com/imageworks/OpenColorIO-Configs/blob/master/nuke-default/make.py
+
+Exceptions
+==========
+
+.. autoclass:: PyOpenColorIO.Exception
+ :members:
+ :undoc-members:
+
+.. autoclass:: PyOpenColorIO.ExceptionMissingFile
+ :members:
+ :undoc-members:
+
+Global
+======
+
+.. autofunction:: PyOpenColorIO.ClearAllCaches
+
+.. autofunction:: PyOpenColorIO.GetCurrentConfig
+
+.. autofunction:: PyOpenColorIO.GetLoggingLevel
+
+.. autofunction:: PyOpenColorIO.SetCurrentConfig
+
+.. autofunction:: PyOpenColorIO.SetLoggingLevel
+
+Config
+======
+
+.. autoclass:: PyOpenColorIO.Config
+ :members:
+ :undoc-members:
+
+ColorSpace
+==========
+
+.. autoclass:: PyOpenColorIO.ColorSpace
+ :members:
+ :undoc-members:
+
+Look
+====
+
+.. autoclass:: PyOpenColorIO.Look
+ :members:
+ :undoc-members:
+
+Processor
+=========
+
+.. autoclass:: PyOpenColorIO.Processor
+ :members:
+ :undoc-members:
+
+Context
+=======
+
+.. autoclass:: PyOpenColorIO.Context
+ :members:
+ :undoc-members:
diff --git a/docs/developers/bindings/PythonTransforms.rst b/docs/developers/bindings/PythonTransforms.rst
new file mode 100644
index 0000000..d59a877
--- /dev/null
+++ b/docs/developers/bindings/PythonTransforms.rst
@@ -0,0 +1,132 @@
+Python Transforms
+=================
+
+Transform
+---------
+
+.. autoclass:: PyOpenColorIO.Transform
+ :members:
+ :undoc-members:
+
+AllocationTransform
+-------------------
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+ transform = OCIO.AllocationTransform()
+ transform.setAllocation(OCIO.Constants.ALLOCATION)
+
+.. autoclass:: PyOpenColorIO.AllocationTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+CDLTransform
+------------
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+
+ cdl = OCIO.CDLTransform()
+ # Set the slope, offset, power, and saturation for each channel.
+ cdl.setSOP([, , , , , , , , ])
+ cdl.setSat([, , ])
+ cdl.getSatLumaCoefs()
+
+.. autoclass:: PyOpenColorIO.CDLTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+ColorSpaceTransform
+-------------------
+
+This class is meant so that ColorSpace conversions can be reused, referencing ColorSpaces that already exist.
+
+.. note::
+ Careless use of this may create infinite loops, so avoid referencing the colorspace you're in.
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+ transform = OCIO.ColorSpaceTransform()
+
+.. autoclass:: PyOpenColorIO.ColorSpaceTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+DisplayTransform
+----------------
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+ transform = OCIO.DisplayTransform()
+
+.. autoclass:: PyOpenColorIO.DisplayTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+ExponentTransform
+-----------------
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+ transform = OCIO.ExponentTransform()
+
+.. autoclass:: PyOpenColorIO.ExponentTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+FileTransform
+-------------
+
+.. autoclass:: PyOpenColorIO.FileTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+GroupTransform
+--------------
+
+.. autoclass:: PyOpenColorIO.GroupTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+LogTransform
+------------
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+
+:py:class:`LogTransform` is used to define a log transform. The direction of
+the transform and its numerical base can be specified.
+
+.. autoclass:: PyOpenColorIO.LogTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+LookTransform
+-------------
+
+.. autoclass:: PyOpenColorIO.LookTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+MatrixTransform
+---------------
+
+.. autoclass:: PyOpenColorIO.MatrixTransform
+ :members:
+ :undoc-members:
+ :inherited-members:
diff --git a/docs/developers/bindings/PythonTypes.rst b/docs/developers/bindings/PythonTypes.rst
new file mode 100644
index 0000000..074e65e
--- /dev/null
+++ b/docs/developers/bindings/PythonTypes.rst
@@ -0,0 +1,9 @@
+Python Types
+============
+
+Constants
+---------
+
+.. automodule:: PyOpenColorIO.Constants
+ :members:
+ :undoc-members:
diff --git a/docs/developers/coding_guidelines.rst b/docs/developers/coding_guidelines.rst
new file mode 100644
index 0000000..742b0f8
--- /dev/null
+++ b/docs/developers/coding_guidelines.rst
@@ -0,0 +1,109 @@
+Coding guidelines
+=================
+
+There are only two important rules:
+
+1. When making changes, conform to the style and conventions of the surrounding code.
+
+2. Strive for clarity, even if that means occasionally breaking the guidelines. Use your head and ask for advice if your common sense seems to disagree with the conventions.
+
+File Conventions
+****************
+
+C++ implementation should be named ``*.cpp``. Headers should be named ``*.h``.
+All source files should begin with the copyright and license, which can be cut and pasted from other source files). For NEW source files, please do change the copyright year to the present. However DO NOT edit existing files just to update the copyright year, it just creates pointless deltas and offers no increased protection
+
+Line Length
+***********
+
+Each line of text in your code should be at most 80 characters long.
+
+Generally the only exceptions are for comments with example commands or URLs - to make cut and paste easier.
+
+The other exception is for those rare cases where letting a line be longer (and wrapping on an 80-character window) is actually a better and clearer alternative than trying to split it into two lines. Sometimes this happens, but it's rare.
+
+DO NOT alter somebody else's code to re-wrap lines (or change whitespace) just because you found something that violates the rules. Let the group/author/leader know, and resist the temptation to change it yourself.
+
+Formatting
+**********
+
+* Indent 4 spaces at a time, and use actual spaces, not tabs. This is particularly critical on python code. The only exception currently allowed in within Makefiles, where tab characters are sometimes required.
+
+* Opening brace on the line following the condition or loop.
+
+* The contents of namespaces are not indented.
+
+* Function names should be on the same line as their return values.
+
+* Function calls should NOT have a space between the function name and the opening parenthesis. A single space should be added after each required comma.
+
+Here is a short code fragement that shows these concepts in action:
+
+.. code-block:: c++
+
+ namespace
+ {
+
+
+ int MungeMyNumbers(int a, int b)
+ {
+ int x = a + b;
+
+ if (a == 0 || b==0)
+ {
+ x += 1;
+ x += 2;
+ }
+ else
+ {
+ for (int i=0; i<16; ++i)
+ {
+ x += a * i;
+ }
+ }
+
+ return x;
+ }
+
+
+ } // namespace
+
+Misc. Rules
+***********
+
+* Avoid macros when possible.
+
+* Anonymous namespaces are preferred when sensible.
+
+* Variable names should be camelCase, as well as longAndExplicit.
+
+* Avoid long function implementations. Break up work into small, manageable chunks.
+
+* Use "TODO:" comments for code that is temporary, a short-term solution, or good-enough but not perfect. This is vastly preferred to leaving subtle corner cases undocumented.
+
+* Always initialize variables on construction.
+
+* Do not leave dead code paths around. (This is what revision history is for)
+
+* Includes should always be ordered as follows: C library, C++ library, other libraries' .h, OCIO public headers, OCIO private headers. Includes within a category should be alphabetized.
+
+* The C++ "using" directive is not allowed.
+
+* Static / global variables should be avoided at all costs.
+
+* Use const whenever it makes sense to do so.
+
+* The use of Boost is not allowed, except for unit_test_framework and shared_ptr.
+
+* Default function arguments are not allowed.
+
+Bottom Line
+***********
+
+When in doubt, look elsewhere in the code base for examples of similar structures and try to format your code in the same manner.
+
+
+Portions of this document have been blatantly lifted from OpenImageIO, and Google.
+
+http://openimageio.org/wiki/index.php?title=Coding_Style_Guide
+http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml \ No newline at end of file
diff --git a/docs/developers/getting_started.rst b/docs/developers/getting_started.rst
new file mode 100644
index 0000000..88f61ae
--- /dev/null
+++ b/docs/developers/getting_started.rst
@@ -0,0 +1,47 @@
+Getting started
+===============
+
+Checking Out The Codebase
+*************************
+
+The master code repository is available on Github: http://github.com/imageworks/OpenColorIO
+
+For those unfamiliar with git, the wonderful part about it is that even though only a limited number people have write access to the master repository, anyone is free to create, and even check in, changes to their own local git repository. Your local changes will not automatically be pushed back to the master repository, so everyone feel free to informally play around with the codebase. Also - unlike svn - when you download the git repository you have a full copy of the project's history (including revision history, logs, etc), so the majority of code changes you will make, including commits, do not require network server access.
+
+The first step is to install git on your system. For those new to the world of git, github has an excellent tutorial stepping you through the process, available at: http://help.github.com/
+
+To check out a read-only version of the repository (no github signup required)::
+
+ git clone git://github.com/imageworks/OpenColorIO.git ocio
+
+For write-access, you must first register for a Github account (free). Then, you must create a local fork of the OpenColorIO repository by visiting http://github.com/imageworks/OpenColorIO and clicking the "Fork" icon. If you get hung up on this, further instructions on this process are available at http://help.github.com/forking/
+
+To check out a read-write version of the repository (github acct required)::
+
+ git clone git@github.com:yourgitusername/OpenColorIO.git ocio
+
+ Initialized empty Git repository in /mcp/ocio/.git/
+ remote: Counting objects: 2220, done.
+ remote: Compressing objects: 100% (952/952), done.
+ remote: Total 2220 (delta 1434), reused 1851 (delta 1168)
+ Receiving objects: 100% (2220/2220), 2.89 MiB | 2.29 MiB/s, done.
+ Resolving deltas: 100% (1434/1434), done.
+
+Both read + read/write users should then add the Imageworks (SPI) master branch as a remote. This will allow you to more easily fetch updates as they become available::
+
+ cd ocio
+ git remote add spi git://github.com/imageworks/OpenColorIO.git
+
+Optionally, you may then add any additional users who have individual working forks (just as you've done). This will allow you to track, view, and potentially merge intermediate changes before they're been pushed into the main trunk. (For really bleeding edge folks). For example, to add Jeremy Selan's working fork::
+
+ git remote add js git://github.com/jeremyselan/OpenColorIO.git
+
+You should then do a git fetch, and git merge (detailed below) to download the remote branches you've just added.
+
+
+Merging changes
+***************
+
+More detailed guide coming soon, for now, see http://help.github.com/remotes/
+
+.. TODO: Write this \ No newline at end of file
diff --git a/docs/developers/index.rst b/docs/developers/index.rst
new file mode 100644
index 0000000..67a2da2
--- /dev/null
+++ b/docs/developers/index.rst
@@ -0,0 +1,45 @@
+.. _developer-guide:
+
+Developer guide
+===============
+
+Some information on contributing to OCIO:
+
+.. toctree::
+ :maxdepth: 1
+
+ getting_started
+ coding_guidelines
+ submitting_changes
+ issues
+
+Instructions on using OCIO:
+
+.. toctree::
+ :maxdepth: 1
+
+ usage_examples
+
+C++ API documentation:
+
+.. toctree::
+ :maxdepth: 1
+
+ api/index
+
+Python API documentation:
+
+.. toctree::
+ :maxdepth: 1
+
+ bindings/PythonAPI
+ bindings/PythonTransforms
+ bindings/PythonTypes
+
+Internal Architecture:
+
+.. toctree::
+ :maxdepth: 1
+
+ internal_architecture
+
diff --git a/docs/developers/internal_architecture.rst b/docs/developers/internal_architecture.rst
new file mode 100644
index 0000000..d74bd0d
--- /dev/null
+++ b/docs/developers/internal_architecture.rst
@@ -0,0 +1,287 @@
+Internal Architecture Overview
+==============================
+
+External API
+************
+
+
+Configs
+~~~~~~~
+
+At the highest level, we have OCIO::Configs. This represents the entirety of the
+current color "universe". Configs are serialized as .ocio files, read at runtime,
+and are often used in a 'read-only' context.
+
+Config are loaded at runtime to allow for customized color handling in a show-
+dependent manner.
+
+Example Configs:
+
+* ACES (Acacdemy's standard color workflow)
+* spi-vfx (Used on some Imageworks VFX shows such as spiderman, etc).
+* and others
+
+
+ColorSpaces
+~~~~~~~~~~~
+
+The meat of an OCIO::Config is a list of named ColorSpaces. ColorSpace often
+correspond to input image states, output image states, or image states used for
+internal processing.
+
+Example ColorSpaces (from ACES configuration):
+
+* aces (HDR, scene-linear)
+* adx10 (log-like density encoding space)
+* slogf35 (sony F35 slog camera encoding)
+* rrt_srgb (baked in display transform, suitable for srgb display)
+* rrt_p3dci (baked in display transform, suitable for dcip3 display)
+
+
+
+Transforms
+~~~~~~~~~~
+
+ColorSpaces contain an ordered list of transforms, which define the conversion
+to and from the Config's "reference" space.
+
+Transforms are the atomic units available to the designer in order to specify a
+color conversion.
+
+Examples of OCIO::Transforms are:
+
+* File-based transforms (1d lut, 3d lut, mtx... anything, really.)
+* Math functions (gamma, log, mtx)
+* The 'meta' GroupTransform, which contains itself an ordered lists of transforms
+* The 'meta' LookTransform, which contains an ordered lists of transforms
+
+For example, the adx10 ColorSpace (in one particular ACES configuration)
+-Transform FROM adx, to our reference ColorSpace:
+
+#. Apply FileTransform adx_adx10_to_cdd.spimtx
+#. Apply FileTransform adx_cdd_to_cid.spimtx
+#. Apply FileTransform adx_cid_to_rle.spi1d
+#. Apply LogTransform base 10 (inverse)
+#. Apply FileTransform adx_exp_to_aces.spimtx
+
+If we have an image in the reference ColorSpace (unnamed), we can convert TO
+adx by applying each in the inverse direction:
+
+#. Apply FileTransform adx_exp_to_aces.spimtx (inverse)
+#. Apply LogTransform base 10 (forward)
+#. Apply FileTransform adx_cid_to_rle.spi1d (inverse)
+#. Apply FileTransform adx_cdd_to_cid.spimtx (inverse)
+#. Apply FileTransform adx_adx10_to_cdd.spimtx (inverse)
+
+Note that this isn't possible in all cases (what if a lut or matrix is not
+invertible?), but conceptually it's a simple way to think about the design.
+
+
+
+Summary
+~~~~~~~
+
+Configs and ColorSpaces are just a bookkeeping device used to get and ordered
+lists of Transforms corresponding to image color transformation.
+
+Transforms are visible to the person AUTHORING the OCIO config, but are
+NOT visible to the client applications. Client apps need only concern themselves
+with Configs and Processors.
+
+
+
+
+OCIO::Processors
+~~~~~~~~~~~~~~~~
+
+A processor corresponds to a 'baked' color transformation. You specify two arguments
+when querying a processor: the :ref:`colorspace_section` you are coming from,
+and the :ref:`colorspace_section` you are going to.
+
+Once you have the processor, you can apply the color transformation using the
+"apply" function. For the CPU veseion, first wrap your image in an
+ImageDesc class, and then call apply to process in place.
+
+Example:
+
+.. code-block:: cpp
+
+ #include <OpenColorIO/OpenColorIO.h>
+ namespace OCIO = OCIO_NAMESPACE;
+
+ try
+ {
+ // Get the global OpenColorIO config
+ // This will auto-initialize (using $OCIO) on first use
+ OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
+
+ // Get the processor corresponding to this transform.
+ // These strings, in this example, are specific to the above
+ // example. ColorSpace names should NEVER be hard-coded into client
+ // software, but should be dynamically queried at runtime from the library
+ OCIO::ConstProcessorRcPtr processor = config->getProcessor("adx10", "aces");
+
+ // Wrap the image in a light-weight ImageDescription
+ OCIO::PackedImageDesc img(imageData, w, h, 4);
+
+ // Apply the color transformation (in place)
+ processor->apply(img);
+ }
+ catch(OCIO::Exception & exception)
+ {
+ std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+ }
+
+
+The GPU code path is similar. You get the processor from the config, and then
+query the shaderText and the lut3d. The client loads these to the GPU themselves,
+and then makes the appropriate calls to the newly defined function.
+
+See `src/apps/ociodisplay` for an example.
+
+
+
+Internal API
+************
+
+
+The Op Abstraction
+~~~~~~~~~~~~~~~~~~
+
+It is a useful abstraction, both for code-reuse and optimization, to not relying
+on the transforms to do pixel processing themselves.
+
+Consider that the FileTransform represents a wide-range of image processing
+operations (basically all of em), many of which are really complex. For example,
+the houdini lut format in a single file may contain a log convert, a 1d lut, and
+then a 3d lut; all of which need to be applied in a row! If we dont want the
+FileTransform to know how to process all possible pixel operations, it's much
+simpler to make light-weight processing operations, which the transforms can
+create to do the dirty work as needed.
+
+All image processing operations (ops) are a class that present the same
+interface, and it's rather simple:
+(src/core/Op.h)
+
+.. code-block:: cpp
+
+ virtual void apply(float* rgbaBuffer, long numPixels)
+
+Basically, given a packed float array with the specified number of pixels, process em.
+
+Examples of ops include Lut1DOp, Lut3DOp, MtxOffsetOp, LogOp, etc.
+
+Thus, the job of a transform becomes much simpler and they're only responsible
+for converting themselves to a list of ops. A simple FileTransform that only has
+a single 1D lut internally may just generate a single Lut1DOp, but a
+FileTransform that references a more complex format (such as the houdini lut case
+referenced above) may generate a few ops:
+
+.. code-block:: cpp
+
+ void FileFormatHDL::BuildFileOps(OpRcPtrVec & ops,
+ const Config& /*config*/,
+ const ConstContextRcPtr & /*context*/,
+ CachedFileRcPtr untypedCachedFile,
+ const FileTransform& fileTransform,
+ TransformDirection dir) const {
+
+ // Code omitted which loads the lut file into the file cache...
+
+ CreateLut1DOp(ops, cachedFile->lut1D,
+ fileTransform.getInterpolation(), dir);
+ CreateLut3DOp(ops, cachedFile->lut3D,
+ fileTransform.getInterpolation(), dir);
+
+See (src/core/*Ops.h) for the available ops.
+
+Note that while compositors often have complex, branching trees of image processing
+operations, we just have a linear list of ops, lending itself very well to
+optimization.
+
+Before the ops are run, they are optimized. (Collapsed with appropriate neighbors, etc).
+
+
+An Example
+~~~~~~~~~~
+
+Let us consider the internal steps when getProcessor() is called to convert
+from ColorSpace 'adx10' to ColorSpace 'aces'.
+
+* The first step is to turn this ColorSpace conversion into an ordered list of
+transforms. We do this by creating a single of the conversions from 'adx10'
+to reference, and then adding the transforms required to go from reference to
+'aces'.
+
+* The Transform list is then converted into a list of ops. It is during this
+stage luts, are loaded, etc.
+
+
+
+CPU CODE PATH
+~~~~~~~~~~~~~
+
+The master list of ops is then optimized, and stored internally in the processor.
+
+.. code-block:: cpp
+
+ FinalizeOpVec(m_cpuOps);
+
+During Processor::apply(...), a subunit of pixels in the image are formatted into a sequential rgba block. (Block size is optimized for computational (SSE) simplicity and performance, and is typically similar in size to an image scanline)
+
+.. code-block:: cpp
+
+ float * rgbaBuffer = 0;
+ long numPixels = 0;
+ while(true) {
+ scanlineHelper.prepRGBAScanline(&rgbaBuffer, &numPixels);
+ ...
+
+Then for each op, op->apply is called in-place.
+
+.. code-block:: cpp
+
+ for(OpRcPtrVec::size_type i=0, size = m_cpuOps.size(); i<size; ++i)
+ {
+ m_cpuOps[i]->apply(rgbaBuffer, numPixels);
+ }
+
+After all ops have been applied, the results are copied back to the source
+
+.. code-block:: cpp
+
+ scanlineHelper.finishRGBAScanline();
+
+
+
+GPU CODE PATH
+~~~~~~~~~~~~~
+
+#. The master list of ops is partitioned into 3 ordered lists:
+
+- As many ops as possible from the BEGINNING of the op-list that can be done
+ analytically in shader text. (called gpu-preops)
+- As many ops as possible from the END of the op-list that can be done
+ analytically in shader text. (called gpu-postops)
+- The left-over ops in the middle that cannot support shader text, and thus
+ will be baked into a 3dlut. (called gpu-lattice)
+
+#. Between the first an the second lists (gpu-preops, and gpu-latticeops), we
+anaylze the op-stream metadata and determine the appropriate allocation to use.
+(to minimize clamping, quantization, etc). This is accounted for here by
+interserting a forward allocation to the end of the pre-ops, and the inverse
+allocation to the start of the lattice ops.
+
+See https://github.com/imageworks/OpenColorIO/blob/master/src/core/NoOps.cpp#L183
+
+#. The 3 lists of ops are then optimized individually, and stored on the processor.
+The Lut3d is computed by applying the gpu-lattice ops, on the CPU, to a lut3d
+image.
+
+The shader text is computed by calculating the shader for the gpu-preops, adding
+a sampling function of the 3d lut, and then calculating the shader for the gpu
+post ops.
+
+
+
+
diff --git a/docs/developers/issues.rst b/docs/developers/issues.rst
new file mode 100644
index 0000000..e26bd3b
--- /dev/null
+++ b/docs/developers/issues.rst
@@ -0,0 +1,4 @@
+Issues
+======
+
+Please visit http://github.com/imageworks/OpenColorIO/issues for an up to date listing of bugs, feature requests etc \ No newline at end of file
diff --git a/docs/developers/submitting_changes.rst b/docs/developers/submitting_changes.rst
new file mode 100644
index 0000000..ca1169d
--- /dev/null
+++ b/docs/developers/submitting_changes.rst
@@ -0,0 +1,14 @@
+Submitting Changes
+==================
+
+Code Review
+***********
+
+Ask early, and ask often!
+
+All new contributors are highly encouraged to post development ideas, questions,
+or any other thoughts to the :ref:`mailing_lists` before starting to code. This
+greatly improves the process and quality of the resulting library. Code
+reviews (particularly for non-trivial changes) are typically far simpler if the
+reviewers are aware of a development task beforehand. (And, who knows? Maybe they
+will have implementation suggestions as well!)
diff --git a/docs/developers/usage_examples.rst b/docs/developers/usage_examples.rst
new file mode 100644
index 0000000..8dace70
--- /dev/null
+++ b/docs/developers/usage_examples.rst
@@ -0,0 +1,357 @@
+.. _developers-usageexamples:
+
+Usage Examples
+==============
+
+Some examples of using the OCIO API, via both C++ and the Python bindings.
+
+For further examples, see the ``src/apps/`` directory in the git repository
+
+.. _usage_applybasic:
+
+Applying a basic ColorSpace transform, using the CPU
+****************************************************
+This describes what code is used to convert from a specified source
+:cpp:class:`ColorSpace` to a specified destination :cpp:class:`ColorSpace`.
+If you are using the OCIO Nuke plugins, the OCIOColorSpace node performs these
+steps internally.
+
+#. **Get the Config.**
+ This represents the entirety of the current color "universe". It can either
+ be initialized by your app at startup or created explicitly. In common
+ usage, you can just query :cpp:func:`GetCurrentConfig`, which will auto
+ initialize on first use using the :envvar:`OCIO` environment variable.
+
+#. **Get Processor from the Config.**
+ A processor corresponds to a 'baked' color transformation. You specify two
+ arguments when querying a processor: the :ref:`colorspace_section` you are
+ coming from, and the :ref:`colorspace_section` you are going to.
+ :ref:`cfgcolorspaces_section` ColorSpaces can be either explicitly named
+ strings (defined by the current configuration) or can be
+ :ref:`cfgroles_section` (essentially :ref:`colorspace_section` aliases)
+ which are consistent across configurations. Constructing a
+ :cpp:class:`Processor` object is likely a blocking operation (thread-wise)
+ so care should be taken to do this as infrequently as is sensible. Once per
+ render 'setup' would be appropriate, once per scanline would be
+ inappropriate.
+
+#. **Convert your image, using the Processor.**
+ Once you have the processor, you can apply the color transformation using
+ the "apply" function. In :ref:`usage_applybasic_cpp`, you apply the
+ processing in-place, by first wrapping your image in an
+ :cpp:class:`ImageDesc` class. This approach is intended to be used in high
+ performance applications, and can be used on multiple threads (per scanline,
+ per tile, etc). In :ref:`usage_applybasic_python` you call
+ "applyRGB" / "applyRGBA" on your sequence of pixels. Note that in both
+ languages, it is far more efficient to call "apply" on batches of pixels at
+ a time.
+
+.. _usage_applybasic_cpp:
+
+C++
+---
+
+.. code-block:: cpp
+
+ #include <OpenColorIO/OpenColorIO.h>
+ namespace OCIO = OCIO_NAMESPACE;
+
+ try
+ {
+ OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
+ ConstProcessorRcPtr processor = config->getProcessor(OCIO::ROLE_COMPOSITING_LOG,
+ OCIO::ROLE_SCENE_LINEAR);
+
+ OCIO::PackedImageDesc img(imageData, w, h, 4);
+ processor->apply(img);
+ }
+ catch(OCIO::Exception & exception)
+ {
+ std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+ }
+
+.. _usage_applybasic_python:
+
+Python
+------
+
+.. code-block:: py
+
+ import PyOpenColorIO as OCIO
+
+ try:
+ config = OCIO.GetCurrentConfig()
+ processor = config.getProcessor(OCIO.Constants.ROLE_COMPOSITING_LOG,
+ OCIO.Constants.ROLE_SCENE_LINEAR)
+
+ # Apply the color transform to the existing RGBA pixel data
+ img = processor.applyRGBA(img)
+ except Exception, e:
+ print "OpenColorIO Error",e
+
+.. _usage_displayimage:
+
+Displaying an image, using the CPU (simple ColorSpace conversion)
+*****************************************************************
+Converting an image for display is similar to a normal color space conversion.
+The only difference is that one has to first determine the name of the display
+(destination) ColorSpace by querying the config with the device name and
+transform name.
+
+#. **Get the Config.**
+ See :ref:`usage_applybasic` for details.
+
+#. **Lookup the display ColorSpace.**
+ The display :cpp:class:`ColorSpace` is queried from the configuration using
+ :cpp:func:`Config::getDisplayColorSpaceName`. If the user has specified
+ value for the ``device`` or the ``displayTransformName``, use them. If these
+ values are unknown default values can be queried (as shown below).
+
+#. **Get the processor from the Config.**
+ See :ref:`usage_applybasic` for details.
+
+#. **Convert your image, using the processor.**
+ See :ref:`usage_applybasic` for details.
+
+C++
+---
+
+.. code-block:: cpp
+
+ #include <OpenColorIO/OpenColorIO.h>
+ namespace OCIO = OCIO_NAMESPACE;
+
+ OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
+
+ // If the user hasn't picked a display, use the defaults...
+ const char * device = config->getDefaultDisplayDeviceName();
+ const char * transformName = config->getDefaultDisplayTransformName(device);
+ const char * displayColorSpace = config->getDisplayColorSpaceName(device, transformName);
+
+ ConstProcessorRcPtr processor = config->getProcessor(OCIO::ROLE_SCENE_LINEAR,
+ displayColorSpace);
+
+ OCIO::PackedImageDesc img(imageData, w, h, 4);
+ processor->apply(img);
+
+Python
+------
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+
+ config = OCIO.GetCurrentConfig()
+
+ device = config.getDefaultDisplayDeviceName()
+ transformName = config.getDefaultDisplayTransformName(device)
+ displayColorSpace = config.getDisplayColorSpaceName(device, transformName)
+
+ processor = config.getProcessor(OCIO.Constants.ROLE_SCENE_LINEAR, displayColorSpace)
+
+ processor.applyRGB(imageData)
+
+
+Displaying an image, using the CPU (Full Display Pipeline)
+**********************************************************
+
+This alternative version allows for a more complex displayTransform, allowing
+for all of the controls typically added to real-world viewer interfaces. For
+example, options are allowed to control which channels (red, green, blue,
+alpha, luma) are visible, as well as allowing for optional color corrections
+(such as an exposure offset in scene linear). If you are using the OCIO Nuke
+plugins, the OCIODisplay node performs these steps internally.
+
+#. **Get the Config.**
+ See :ref:`usage_applybasic` for details.
+#. **Lookup the display ColorSpace.**
+ See :ref:`usage_displayimage` for details
+#. **Create a new DisplayTransform.**
+ This transform will embody the full 'display' pipeline you wish to control.
+ The user is required to call
+ :cpp:func:`DisplayTransform::setInputColorSpaceName` to set the input
+ ColorSpace, as well as
+ :cpp:func:`DisplayTransform::setDisplayColorSpaceName` (with the results of
+ :cpp:func:`Config::getDisplayColorSpaceName`).
+#. **Set any additional DisplayTransform options.**
+ If the user wants to specify a channel swizzle, a scene-linear exposure
+ offset, an artistic look, this is the place to add it. See below for an
+ example. Note that although we provide recommendations for display, any
+ transforms are allowed to be added into any of the slots. So if for your app
+ you want to add 3 transforms into a particular slot (chained together), you
+ are free to wrap them in a :cpp:class:`GroupTransform` and set it
+ accordingly!
+#. **Get the processor from the Config.**
+ The processor is then queried from the config passing the new
+ :cpp:class:`DisplayTransform` as the argument. Once the processor has been
+ returned, the original :cpp:class:`DisplayTransform` is no longer necessary
+ to hold onto. (Though if you'd like to for re-use, there is no problem doing
+ so).
+#. **Convert your image, using the processor.**
+ See :ref:`usage_applybasic` for details.
+
+C++
+---
+
+.. code-block:: cpp
+
+ // Step 1: Get the config
+ OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
+
+ // Step 2: Lookup the display ColorSpace
+ const char * device = config->getDefaultDisplayDeviceName();
+ const char * transformName = config->getDefaultDisplayTransformName(device);
+ const char * displayColorSpace = config->getDisplayColorSpaceName(device, transformName);
+
+ // Step 3: Create a DisplayTransform, and set the input and display ColorSpaces
+ // (This example assumes the input is scene linear. Adapt as needed.)
+
+ OCIO::DisplayTransformRcPtr transform = OCIO::DisplayTransform::Create();
+ transform->setInputColorSpaceName( OCIO::ROLE_SCENE_LINEAR );
+ transform->setDisplayColorSpaceName( displayColorSpace );
+
+ // Step 4: Add custom transforms for a 'canonical' Display Pipeline
+
+ // Add an fstop exposure control (in SCENE_LINEAR)
+ float gain = powf(2.0f, exposure_in_stops);
+ const float slope3f[] = { gain, gain, gain };
+ OCIO::CDLTransformRcPtr cc = OCIO::CDLTransform::Create();
+ cc->setSlope(slope3f);
+ transform->setLinearCC(cc);
+
+ // Add a Channel view 'swizzle'
+
+ // 'channelHot' controls which channels are viewed.
+ int channelHot[4] = { 1, 1, 1, 1 }; // show rgb
+ //int channelHot[4] = { 1, 0, 0, 0 }; // show red
+ //int channelHot[4] = { 0, 0, 0, 1 }; // show alpha
+ //int channelHot[4] = { 1, 1, 1, 0 }; // show luma
+
+ float lumacoef[3];
+ config.getDefaultLumaCoefs(lumacoef);
+
+ float m44[16];
+ float offset[4];
+ OCIO::MatrixTransform::View(m44, offset, channelHot, lumacoef);
+ OCIO::MatrixTransformRcPtr swizzle = OCIO::MatrixTransform::Create();
+ swizzle->setValue(m44, offset);
+ transform->setChannelView(swizzle);
+
+ // And then process the image normally.
+ OCIO::ConstProcessorRcPtr processor = config->getProcessor(transform);
+
+ OCIO::PackedImageDesc img(imageData, w, h, 4);
+ processor->apply(img);
+
+Python
+------
+
+.. code-block:: python
+
+ import PyOpenColorIO as OCIO
+
+ # Step 1: Get the config
+ config = OCIO.GetCurrentConfig()
+
+ # Step 2: Lookup the display ColorSpace
+ device = config.getDefaultDisplayDeviceName()
+ transformName = config.getDefaultDisplayTransformName(device)
+ displayColorSpace = config.getDisplayColorSpaceName(device, transformName)
+
+ # Step 3: Create a DisplayTransform, and set the input and display ColorSpaces
+ # (This example assumes the input is scene linear. Adapt as needed.)
+
+ transform = OCIO.DisplayTransform()
+ transform.setInputColorSpaceName(OCIO.Constants.ROLE_SCENE_LINEAR)
+ transform.setDisplayColorSpaceName(displayColorSpace)
+
+ # Step 4: Add custom transforms for a 'canonical' Display Pipeline
+
+ # Add an fstop exposure control (in SCENE_LINEAR)
+ gain = 2**exposure
+ slope3f = (gain, gain, gain)
+
+ cc = OCIO.CDLTransform()
+ cc.setSlope(slope3f)
+
+ transform.setLinearCC(cc)
+
+ # Add a Channel view 'swizzle'
+
+ channelHot = (1, 1, 1, 1) # show rgb
+ # channelHot = (1, 0, 0, 0) # show red
+ # channelHot = (0, 0, 0, 1) # show alpha
+ # channelHot = (1, 1, 1, 0) # show luma
+
+ lumacoef = config.getDefaultLumaCoefs()
+
+ m44, offset = OCIO.MatrixTransform.View(channelHot, lumacoef)
+
+ swizzle = OCIO.MatrixTransform()
+ swizzle.setValue(m44, offset)
+ transform.setChannelView(swizzle)
+
+ # And then process the image normally.
+ processor = config.getProcessor(transform)
+
+ print processor.applyRGB(imageData)
+
+
+Displaying an image, using the GPU
+**********************************
+
+Applying OpenColorIO's color processing using GPU processing is
+straightforward, provided you have the capability to upload custom shader code
+and a custom 3D Lookup Table (3DLUT).
+
+#. **Get the Processor.**
+ This portion of the pipeline is identical to the CPU approach. Just get the
+ processor as you normally would have, see above for details.
+#. **Create a GpuShaderDesc.**
+#. **Query the GPU Shader Text + 3D LUT.**
+#. **Configure the GPU State.**
+#. **Draw your image.**
+
+C++
+---
+
+This example is available as a working app in the OCIO source: src/apps/ociodisplay.
+
+.. code-block:: cpp
+
+ // Step 0: Get the processor using any of the pipelines mentioned above.
+ OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
+ const char * device = config->getDefaultDisplayDeviceName();
+ const char * transformName = config->getDefaultDisplayTransformName(device);
+ const char * displayColorSpace = config->getDisplayColorSpaceName(device, transformName);
+ ConstProcessorRcPtr processor = config->getProcessor(OCIO::ROLE_SCENE_LINEAR,
+ displayColorSpace);
+
+ // Step 1: Create a GPU Shader Description
+ GpuShaderDesc shaderDesc;
+ shaderDesc.setLanguage(OCIO::GPU_LANGUAGE_GLSL_1_0);
+ shaderDesc.setFunctionName("OCIODisplay");
+ const int LUT3D_EDGE_SIZE = 32;
+ shaderDesc.setLut3DEdgeLen(LUT3D_EDGE_SIZE);
+
+ // Step 2: Compute and the 3D LUT
+ // Optional Optimization:
+ // Only do this the 3D LUT's contents
+ // are different from the last drawn frame.
+ // Use getGpuLut3DCacheID to compute the cacheID.
+ // cheaply.
+ //
+ // std::string lut3dCacheID = processor->getGpuLut3DCacheID(shaderDesc);
+ int num3Dentries = 3*LUT3D_EDGE_SIZE*LUT3D_EDGE_SIZE*LUT3D_EDGE_SIZE;
+ std::vector<float> g_lut3d;
+ g_lut3d.resize(num3Dentries);
+ processor->getGpuLut3D(&g_lut3d[0], shaderDesc);
+
+ // Load the data into an OpenGL 3D Texture
+ glGenTextures(1, &g_lut3d_textureID);
+ glBindTexture(GL_TEXTURE_3D, g_lut3d_textureID);
+ glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB,
+ LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
+ 0, GL_RGB,GL_FLOAT, &g_lut3d[0]);
+
+ // Step 3: Query
diff --git a/docs/downloads.rst b/docs/downloads.rst
new file mode 100644
index 0000000..d5e6615
--- /dev/null
+++ b/docs/downloads.rst
@@ -0,0 +1,41 @@
+.. _downloads:
+
+Downloads
+=========
+
+* Sample OCIO Configurations -- `.zip <http://github.com/imageworks/OpenColorIO-Configs/zipball/master>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO-Configs/tarball/master>`__
+* Reference Images v1.0v4 -- `.tgz <http://code.google.com/p/opencolorio/downloads/detail?name=ocio-images.1.0v4.tgz>`__
+* Core Library v1.0.8 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.8>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.8>`__
+* Core Library latest -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/master>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/master>`__
+
+Per-version updates: :ref:`changelog-main`.
+
+Build instructions: :ref:`building-from-source`.
+
+.. _contributor-license-agreements:
+
+Contributor License Agreements
+******************************
+Please see the `Imageworks Open Source website <http://opensource.imageworks.com/cla/>`__
+
+Deprecated Downloads
+********************
+* Reference Images v1.0v2 `tgz <http://code.google.com/p/opencolorio/downloads/detail?name=ocio-images.1.0v2.tgz>`__
+* Reference Images v1.0v1 `tgz <http://code.google.com/p/opencolorio/downloads/detail?name=ocio-images.1.0v1.tgz>`__
+
+* Core Library v1.0.7 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.7>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.7>`__
+* Core Library v1.0.6 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.6>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.6>`__
+* Core Library v1.0.5 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.5>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.5>`__
+* Core Library v1.0.4 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.4>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.4>`__
+* Core Library v1.0.3 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.3>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.3>`__
+* Core Library v1.0.2 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.2>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.2>`__
+* Core Library v1.0.1 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.1>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.1>`__
+* Core Library v1.0.0 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v1.0.0>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v1.0.0>`__
+
+* Color Config v0.7v4 `tgz <http://code.google.com/p/opencolorio/downloads/detail?name=ocio-configs.0.7v4.tgz>`__ (OCIO v0.7.6+)
+* Core Library v0.8.7 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v0.8.7>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v0.8.7>`__
+* Core Library v0.7.9 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v0.7.9>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v0.7.9>`__
+* Core Library v0.6.1 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v0.6.1>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v0.6.1>`__
+* Core Library v0.5.16 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v0.5.16>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v0.5.16>`__
+* Core Library v0.5.8 -- `.zip <http://github.com/imageworks/OpenColorIO/zipball/v0.5.8>`__ `.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/v0.5.8>`__
+
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..3757b66
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,77 @@
+Home
+====
+
+.. include:: README
+
+.. _mailing_lists:
+
+Mailing lists
+"""""""""""""
+
+There are two mailing lists associated with OpenColorIO:
+
+`ocio-users <http://groups.google.com/group/ocio-users>`__\ ``@googlegroups.com``
+ For end users (artists, often) interested in OCIO profile design,
+ facility color management, and workflow.
+
+`ocio-dev <http://groups.google.com/group/ocio-dev>`__\ ``@googlegroups.com``
+ For developers interested OCIO APIs, code integration, compilation, etc.
+
+Using OpenColorIO
+"""""""""""""""""
+
+Most users will likely want to use the OpenColorIO that comes precompiled with
+their applications. See the :ref:`compatiblesoftware` for further details on
+each application.
+
+Note that OCIO configurations aren't required to do any 'real' work, and are
+available separately on the :ref:`downloads` section of this site. Example
+images are also available. For assistance customizing .ocio configurations,
+contact the ocio-users email alias.
+
+- Step 1: set the OCIO environment-variable to /path/to/your/profile.ocio
+- Step 2: Launch supported application.
+
+If you are on a platform that is not envvar friendly, most applications also
+provide a menu option to select a different OCIO configuration after launch.
+
+Please be sure to select a profile that matches your color workflow (VFX work
+typically requires a different profile than animated features). If you need
+assistance picking a profile, email ocio-users.
+
+Downloading and building the code
+"""""""""""""""""""""""""""""""""
+
+Source code is available on Github at
+http://github.com/imageworks/OpenColorIO
+
+Download a `.zip <http://github.com/imageworks/OpenColorIO/zipball/master>`_ or
+`.tar.gz <http://github.com/imageworks/OpenColorIO/tarball/master>`_ of the
+current state of the repository.
+
+Please see the :ref:`developer-guide` for more info, and contact ocio-dev with any
+questions.
+
+.. toctree::
+ :hidden:
+ :maxdepth: 2
+
+ self
+ CompatibleSoftware
+
+ configurations/index
+ installation
+
+ userguide/index
+
+ developers/index
+
+ FAQ
+ downloads
+
+ ChangeLog
+ License
+
+:ref:`search`
+
+:ref:`genindex`
diff --git a/docs/installation.rst b/docs/installation.rst
new file mode 100644
index 0000000..e6e26e2
--- /dev/null
+++ b/docs/installation.rst
@@ -0,0 +1,234 @@
+Installation
+============
+
+.. _building-from-source:
+
+Building from source
+********************
+
+While there is a huge range of possible setups, the following steps
+should work on OS X and most Linux distros.
+
+The basic requirements are:
+
+- cmake >= 2.8
+- (optional) Python 2.x (for the Python bindings)
+- (optional) Nuke 6.x (for the Nuke nodes)
+- (optional) OpenImageIO (for apps including ocioconvert)
+- (optional) Truelight SDK (for TruelightTransform)
+
+To keep things simple, this guide will use the following example
+paths - these will almost definitely be different for you:
+
+- source code: ``/source/ocio``
+- the temporary build location: ``/tmp/ociobuild``
+- the final install directory: ``/software/ocio``
+
+First make the build directory and cd to it::
+
+ $ mkdir /tmp/ociobuild
+ $ cd /tmp/ociobuild
+
+Next step is to run cmake, which looks for things such as the
+compiler's required arguments, optional requirements like Python,
+Nuke, OpenImageIO etc
+
+As we want to install OCIO to a custom location (instead of the
+default ``/usr/local``), we will run cmake with
+``CMAKE_INSTALL_PREFIX``
+
+Still in ``/tmp/ociobuild``, run::
+
+ $ cmake -D CMAKE_INSTALL_PREFIX=/software/ocio /source/ocio
+
+The last argument is the location of the OCIO source code (containing
+the main CMakeLists.txt file). You should see something along the
+lines of::
+
+ -- Configuring done
+ -- Generating done
+ -- Build files have been written to: /tmp/ociobuild
+
+Next, build everything (with the ``-j`` flag to build using 8
+threads)::
+
+ $ make -j8
+
+This should complete in a few minutes. Finally, install the files into
+the specified location::
+
+ $ make install
+
+If nothing went wrong, ``/software/ocio`` should look something like
+this::
+
+ $ cd /software/ocio
+ $ ls
+ bin/ include/ lib/
+ $ ls bin/
+ ocio2icc ociobakelut ociocheck
+ $ ls include/
+ OpenColorIO/ PyOpenColorIO/ pkgconfig/
+ $ ls lib/
+ libOpenColorIO.a libOpenColorIO.dylib
+
+
+.. _enabling-optional-components:
+
+Enabling optional components
+----------------------------
+
+The OpenColorIO library is probably not all you want - the Python
+libraries bindings, the Nuke nodes and several applications are only
+built if their dependencies are found.
+
+In the case of the Python bindings, the dependencies are the Python
+headers for the version you wish to use. These may be picked up by
+default - if so, when you run cmake you would see::
+
+ -- Python 2.6 okay, will build the Python bindings against .../include/python2.6
+
+If not, you can point cmake to correct Python executable using the
+``-D PYTHON=...`` cmake flag::
+
+ $ cmake -D PYTHON=/my/custom/python2.6 /source/ocio
+
+Same process with Nuke (although it less likely to be picked up
+automatically). Point cmake to your Nuke install directory by adding
+``-D NUKE_INSTALL_PATH``::
+
+ $ cmake -D PYTHON=/my/custom/python2.6 -D NUKE_INSTALL_PATH=/Applications/Nuke6.2v1/Nuke6.2v1.app/Contents/MacOS/ /source/ocio
+
+The ``NUKE_INSTALL_PATH`` directory should contain the Nuke executable
+(e.g Nuke6.2v1), and a ``include/`` directory containing ``DDImage/``
+and others.
+
+If set correctly, you will see something similar to::
+
+ -- Found Nuke: /Applications/Nuke6.2v1/Nuke6.2v1.app/Contents/MacOS/include
+ -- Nuke_API_VERSION: --6.2--
+
+The Nuke plugins are installed into ``lib/nuke$MAJOR.$MINOR/``, e.g
+``lib/nuke6.2/OCIODisdplay.so``
+
+
+.. note::
+
+ If you are using the Nuke plugins, you should compile the Python
+ bindings for the same version of Python that Nuke uses
+ internally. For Nuke 6.0 and 6.1 this is Python 2.5, and for 6.2
+ it is Python 2.6
+
+The applications included with OCIO have various dependencies - to
+determine these, look at the CMake output when first run::
+
+ -- Not building ocioconvert. Requirement(s) found: OIIO:FALSE
+
+
+.. _quick-env-config:
+
+Quick environment configuration
+*******************************
+
+The quickest way to set the required :ref:`environment-setup` is to
+source the ``share/ocio/setup_ocio.sh`` script installed with OCIO.
+
+For a simple single-user setup, add the following to ``~/.bashrc``
+(assuming you are using bash, and the example install directory of
+``/software/ocio``)::
+
+ source /software/ocio/share/ocio/setup_ocio.sh
+
+The only environment variable you must configure manually is
+:envvar:`OCIO`, which points to the configuration file you wish to
+use. For prebuilt config files, see the
+:ref:`downloads` section
+
+To do this, you would add a line to ``~/.bashrc`` (or a per-project
+configuration script etc), for example::
+
+ export OCIO="/path/to/my/config.ocio"
+
+
+.. _nuke-configuration:
+
+Nuke Configuration
+******************
+
+If you specified the ``NUKE_INSTALL_PATH`` option when running cmake,
+you should have a ``/software/ocio/lib/nuke6.2`` directory containing
+various files.
+
+If you have followed :ref:`quick-env-config`, the plugins should be
+functional. However, one common additional configuration step is to
+register an OCIODisplay node for each display device/view specified in
+the config.
+
+To do this, in a menu.py on :envvar:`NUKE_PATH` (e.g
+``~/.nuke/menu.py`` for a single user setup), add the following:
+
+.. code-block:: python
+
+ import ocionuke.viewer
+ ocionuke.viewer.populate_viewer(also_remove = "default")
+
+The ``also_remove`` argument can be set to either "default" to remove
+the default sRGB/rec709 options, "all" to remove everything, or "none"
+to leave existing viewer processes untouched.
+
+Alternatively, if your workflow has different requirements, you can
+copy the function and modify it as required, or use it as reference to
+write your own, better viewer setup function!
+
+.. literalinclude:: viewer.py
+ :language: python
+
+
+.. _environment-setup:
+
+Environment variables
+*********************
+
+.. envvar:: OCIO
+
+ This variable needs to point to the global OCIO config file, e.g
+ ``config.ocio``
+
+.. envvar:: DYLD_LIBRARY_PATH
+
+ The ``lib/`` folder (containing ``libOpenColorIO.dylib``) must be
+ on the ``DYLD_LIBRARY_PATH`` search path, or you will get an error
+ similar to::
+
+ dlopen(.../OCIOColorSpace.so, 2): Library not loaded: libOpenColorIO.dylib
+ Referenced from: .../OCIOColorSpace.so
+ Reason: image not found
+
+ This applies to anything that links against OCIO, including the
+ Nuke nodes, and the ``PyOpenColorIO`` Python bindings.
+
+.. envvar:: LD_LIBRARY_PATH
+
+ Equivalent to the ``DYLD_LIBRARY_PATH`` on Linux
+
+.. envvar:: PYTHONPATH
+
+ Python's module search path. If you are using the PyOpenColorIO
+ module, you must add ``lib/python2.x`` to this search path (e.g
+ ``python/2.5``), or importing the module will fail::
+
+ >>> import PyOpenColorIO
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ ImportError: No module named PyOpenColorIO
+
+ Note that :envvar:`DYLD_LIBRARY_PATH` or :envvar:`LD_LIBRARY_PATH`
+ must be set correctly for the module to work.
+
+.. envvar:: NUKE_PATH
+
+ Nuke's customisation search path, where it will look for plugins,
+ gizmos, init.py and menu.py scripts and other customisations.
+
+ This should point to both ``lib/nuke6.2/`` (or whatever version
+ the plugins are built against), and ``share/nuke/``
diff --git a/docs/ociotheme/layout.html b/docs/ociotheme/layout.html
new file mode 100644
index 0000000..43a5858
--- /dev/null
+++ b/docs/ociotheme/layout.html
@@ -0,0 +1,74 @@
+{#
+ haiku/layout.html
+ ~~~~~~~~~~~~~~~~~
+
+ Sphinx layout template for the haiku theme.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "basic/layout.html" %}
+{% set script_files = script_files + ['_static/theme_extras.js'] %}
+{% set css_files = css_files + ['_static/print.css'] %}
+
+{% block relbar1 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
+
+{% block htmltitle %}
+ <title>OpenColorIO</title>
+{% endblock %}
+
+{% macro nav() %}
+ <p>
+ {%- block haikurel1 %}
+ {%- endblock %}
+ {%- block haikurel2 %}
+ {%- endblock %}
+ </p>
+{% endmacro %}
+
+{% block content %}
+ <div class="header">
+ {%- block haikuheader %}
+ {%- if theme_full_logo != "false" %}
+ <a href="{{ pathto('index') }}">
+ <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ </a>
+ {%- else %}
+ {%- if logo -%}
+ <img class="rightlogo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ {%- endif -%}
+ <h1 class="heading"><a href="{{ pathto('index') }}">
+ <span>OpenColorIO</span></a></h1>
+ <h2 class="heading"><span>Open Source Color Management</span></h2>
+ {%- endif %}
+ {%- endblock %}
+ </div>
+ <div class="topnav">
+ {{ shorttitle|e }}
+ </div>
+ <div class="content">
+ {#{%- if display_toc %}
+ <div id="toc">
+ <h3>Table Of Contents</h3>
+ {{ toc }}
+ </div>
+ {%- endif %}#}
+ <table width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="200">
+ <div class="sidebar2">
+ {{toctree()}}
+ {%- include "searchbox.html" %}
+ </div>
+ </td>
+ <td width="100%" id="bodycontent">
+ {% block body %}{% endblock %}
+ </td>
+ </tr></table>
+ <br>
+ </div>
+ <div class="bottomnav">
+ {{ nav() }}
+ </div>
+{% endblock %}
diff --git a/docs/ociotheme/page.html b/docs/ociotheme/page.html
new file mode 100644
index 0000000..6442a17
--- /dev/null
+++ b/docs/ociotheme/page.html
@@ -0,0 +1,29 @@
+{#
+ basic/page.html
+ ~~~~~~~~~~~~~~~
+
+ Master template for simple pages.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "layout.html" %}
+{% block body %}
+{{ body }}
+ {% if pagename == "index" %}
+ <td width="275">
+ <div class="imageBar">
+ <p style="text-align: center; font-size: small;"><b>Color Transform Example</b></p>
+ <img src="{{ pathto('_static/clo_res19_vd16.0101.jpg', 1) }}">
+ <div class="caption">Final Image: sRGB</div>
+ <img src="{{ pathto('_static/clo_res19_lm10.0101.jpg', 1) }}">
+ <div class="caption">Digital Intermediate (DI): log dpx</div>
+ <img src="{{ pathto('_static/clo_res19_lnf.0101.jpg', 1) }}">
+ <div class="caption">Render: scene-linear exr</div>
+ <p style="text-align: right">Images from "Cloudy With A Chance of Meatballs"</p>
+ <p style="text-align: right">Copyright 2011 Sony Pictures Inc. All Rights Reserved.</p>
+ <p style="text-align: right">spi-animation profile, available here.</p>
+ </div>
+ </td>
+ {% endif %}
+{% endblock %}
diff --git a/docs/ociotheme/searchbox.html b/docs/ociotheme/searchbox.html
new file mode 100644
index 0000000..e631a35
--- /dev/null
+++ b/docs/ociotheme/searchbox.html
@@ -0,0 +1,12 @@
+
+<div id="searchbox" style="display: none">
+ <h3>{{ _('Quick search') }}</h3>
+ <form class="search" action="{{ pathto('search') }}" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="{{ _('Go') }}" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+
diff --git a/docs/ociotheme/static/alert_info_32.png b/docs/ociotheme/static/alert_info_32.png
new file mode 100644
index 0000000..05b4fe8
--- /dev/null
+++ b/docs/ociotheme/static/alert_info_32.png
Binary files differ
diff --git a/docs/ociotheme/static/alert_warning_32.png b/docs/ociotheme/static/alert_warning_32.png
new file mode 100644
index 0000000..f13611c
--- /dev/null
+++ b/docs/ociotheme/static/alert_warning_32.png
Binary files differ
diff --git a/docs/ociotheme/static/bg-page.png b/docs/ociotheme/static/bg-page.png
new file mode 100644
index 0000000..c6f3bc4
--- /dev/null
+++ b/docs/ociotheme/static/bg-page.png
Binary files differ
diff --git a/docs/ociotheme/static/bullet_orange.png b/docs/ociotheme/static/bullet_orange.png
new file mode 100644
index 0000000..7171fd5
--- /dev/null
+++ b/docs/ociotheme/static/bullet_orange.png
Binary files differ
diff --git a/docs/ociotheme/static/clo_res19_lm10.0101.jpg b/docs/ociotheme/static/clo_res19_lm10.0101.jpg
new file mode 100644
index 0000000..121f814
--- /dev/null
+++ b/docs/ociotheme/static/clo_res19_lm10.0101.jpg
Binary files differ
diff --git a/docs/ociotheme/static/clo_res19_lnf.0101.jpg b/docs/ociotheme/static/clo_res19_lnf.0101.jpg
new file mode 100644
index 0000000..0d5f4c5
--- /dev/null
+++ b/docs/ociotheme/static/clo_res19_lnf.0101.jpg
Binary files differ
diff --git a/docs/ociotheme/static/clo_res19_vd16.0101.jpg b/docs/ociotheme/static/clo_res19_vd16.0101.jpg
new file mode 100644
index 0000000..1e8ec02
--- /dev/null
+++ b/docs/ociotheme/static/clo_res19_vd16.0101.jpg
Binary files differ
diff --git a/docs/ociotheme/static/ocio.css_t b/docs/ociotheme/static/ocio.css_t
new file mode 100644
index 0000000..f991bba
--- /dev/null
+++ b/docs/ociotheme/static/ocio.css_t
@@ -0,0 +1,469 @@
+/*
+ * haiku.css_t
+ * ~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- haiku theme.
+ *
+ * Adapted from http://haiku-os.org/docs/Haiku-doc.css.
+ * Original copyright message:
+ *
+ * Copyright 2008-2009, Haiku. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Francois Revol <revol@free.fr>
+ * Stephan Assmus <superstippi@gmx.de>
+ * Braden Ewing <brewin@gmail.com>
+ * Humdinger <humdingerb@gmail.com>
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+@import url("basic.css");
+
+html {
+ margin: 0px;
+ padding: 0px;
+ background: #FFF url(bg-page.png) top left repeat-x;
+}
+
+body {
+ line-height: 1.5;
+ margin: auto;
+ padding: 0px;
+ font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
+ min-width: 59em;
+ color: {{ theme_textcolor }};
+}
+
+div.footer {
+ /* padding: 8px; */
+ font-size: 11px;
+ text-align: center;
+ letter-spacing: 0.5px;
+}
+
+/* Sidebar */
+
+/* link colors and text decoration */
+
+a:link {
+ font-weight: bold;
+ text-decoration: none;
+ color: {{ theme_linkcolor }};
+}
+
+a:visited {
+ font-weight: bold;
+ text-decoration: none;
+ color: {{ theme_visitedlinkcolor }};
+}
+
+a:hover, a:active {
+ text-decoration: underline;
+ color: {{ theme_hoverlinkcolor }};
+}
+
+/* Some headers act as anchors, don't give them a hover effect */
+
+h1 a:hover, a:active {
+ text-decoration: none;
+ color: {{ theme_headingcolor }};
+}
+
+h2 a:hover, a:active {
+ text-decoration: none;
+ color: {{ theme_headingcolor }};
+}
+
+h3 a:hover, a:active {
+ text-decoration: none;
+ color: {{ theme_headingcolor }};
+}
+
+h4 a:hover, a:active {
+ text-decoration: none;
+ color: {{ theme_headingcolor }};
+}
+
+a.headerlink {
+ color: #a7ce38;
+ padding-left: 5px;
+}
+
+a.headerlink:hover {
+ color: #a7ce38;
+}
+
+/* basic text elements */
+
+div.content {
+ margin-top: 20px;
+ margin-left: 0px;
+ margin-right: 0px;
+ margin-bottom: 50px;
+ font-size: 0.9em;
+}
+
+/* heading and navigation */
+
+div.header {
+ position: relative;
+ left: 0px;
+ top: 0px;
+ height: 85px;
+ /* background: #eeeeee; */
+ padding: 0 40px;
+}
+div.header h1 {
+ font-size: 1.6em;
+ font-weight: normal;
+ letter-spacing: 1px;
+ color: {{ theme_headingcolor }};
+ border: 0;
+ margin: 0;
+ padding-top: 15px;
+}
+div.header h1 a {
+ font-weight: normal;
+ color: {{ theme_headingcolor }};
+}
+div.header h2 {
+ font-size: 1.3em;
+ font-weight: normal;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+ color: #aaa;
+ border: 0;
+ margin-top: -3px;
+ padding: 0;
+}
+
+div.header img.rightlogo {
+ float: right;
+}
+
+
+div.title {
+ font-size: 1.3em;
+ font-weight: bold;
+ color: {{ theme_headingcolor }};
+ border-bottom: dotted thin #e0e0e0;
+ margin-bottom: 25px;
+}
+div.topnav {
+ background: #e0e0e0;
+ font-size: 0.8em;
+ text-align: right;
+}
+div.topnav p {
+ margin-top: 0;
+ margin-left: 40px;
+ margin-right: 40px;
+ margin-bottom: 0px;
+ text-align: right;
+ font-size: 0.8em;
+}
+div.bottomnav {
+ background: #eeeeee;
+}
+div.bottomnav p {
+ margin-right: 40px;
+ text-align: right;
+ font-size: 0.8em;
+}
+
+a.uplink {
+ font-weight: normal;
+}
+
+
+/* contents box */
+
+table.index {
+ /*margin: 0px 0px 30px 30px;*/
+ padding: 1px;
+ border-width: 1px;
+ border-style: dotted;
+ border-color: #e0e0e0;
+}
+table.index tr.heading {
+ background-color: #e0e0e0;
+ text-align: center;
+ font-weight: bold;
+ font-size: 1.1em;
+}
+table.index tr.index {
+ background-color: #eeeeee;
+}
+table.index td {
+ padding: 5px 20px;
+}
+
+table.index a:link, table.index a:visited {
+ font-weight: normal;
+ text-decoration: none;
+ color: {{ theme_linkcolor }};
+}
+table.index a:hover, table.index a:active {
+ text-decoration: underline;
+ color: {{ theme_hoverlinkcolor }};
+}
+
+
+/* Haiku User Guide styles and layout */
+
+/* Rounded corner boxes */
+/* Common declarations */
+div.admonition {
+ -webkit-border-radius: 10px;
+ -khtml-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border-radius: 10px;
+ border-style: dotted;
+ border-width: thin;
+ border-color: #dcdcdc;
+ padding: 10px 15px 10px 15px;
+ margin-bottom: 15px;
+ margin-top: 15px;
+}
+div.note {
+ padding: 10px 15px 10px 80px;
+ background: #e4ffde url(alert_info_32.png) 15px 15px no-repeat;
+ min-height: 42px;
+}
+div.warning {
+ padding: 10px 15px 10px 80px;
+ background: #fffbc6 url(alert_warning_32.png) 15px 15px no-repeat;
+ min-height: 42px;
+}
+div.seealso {
+ background: #e4ffde;
+}
+
+/* More layout and styles */
+h1 {
+ font-size: 1.3em;
+ font-weight: bold;
+ color: {{ theme_headingcolor }};
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 30px;
+}
+
+h2 {
+ font-size: 1.2em;
+ font-weight: normal;
+ color: {{ theme_headingcolor }};
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 30px;
+}
+
+h3 {
+ font-size: 1.1em;
+ font-weight: normal;
+ color: {{ theme_headingcolor }};
+ margin-top: 30px;
+}
+
+h4 {
+ font-size: 1.0em;
+ font-weight: normal;
+ color: {{ theme_headingcolor }};
+ margin-top: 30px;
+}
+
+p {
+ text-align: justify;
+}
+
+p.last {
+ margin-bottom: 0;
+}
+
+ol {
+ padding-left: 20px;
+}
+
+ul {
+ padding-left: 5px;
+ margin-top: 3px;
+}
+
+li {
+ line-height: 1.3;
+}
+
+div.content ul > li {
+ -moz-background-clip:border;
+ -moz-background-inline-policy:continuous;
+ -moz-background-origin:padding;
+ background: transparent url(bullet_orange.png) no-repeat scroll left 0.45em;
+ list-style-image: none;
+ list-style-type: none;
+ padding: 0 0 0 1.666em;
+ margin-bottom: 3px;
+ font-weight: normal;
+}
+
+td {
+ vertical-align: top;
+}
+
+tt {
+ background-color: #e2e2e2;
+ font-size: 1.0em;
+ font-family: monospace;
+}
+
+pre {
+ border-color: #0c3762;
+ border-style: dotted;
+ border-width: thin;
+ margin: 0 0 12px 0;
+ padding: 0.8em;
+ background-color: #f0f0f0;
+}
+
+hr {
+ border-top: 1px solid #ccc;
+ border-bottom: 0;
+ border-right: 0;
+ border-left: 0;
+ margin-bottom: 10px;
+ margin-top: 20px;
+}
+
+/* printer only pretty stuff */
+@media print {
+ .noprint {
+ display: none;
+ }
+ /* for acronyms we want their definitions inlined at print time */
+ acronym[title]:after {
+ font-size: small;
+ content: " (" attr(title) ")";
+ font-style: italic;
+ }
+ /* and not have mozilla dotted underline */
+ acronym {
+ border: none;
+ }
+ div.topnav, div.bottomnav, div.header, table.index {
+ display: none;
+ }
+ div.content {
+ margin: 0px;
+ padding: 0px;
+ }
+ html {
+ background: #FFF;
+ }
+}
+
+.viewcode-back {
+ font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+ margin: -1px -12px;
+ padding: 0 12px;
+}
+
+div.imageBar {
+ font-size:x-small;
+ text-align: right;
+ padding: 10px;
+ margin-left: 15px;
+ margin-right: 10px;
+ margin-top: 10px;
+ border: 1px solid #000000;
+ background-color: #DDDDDD;
+}
+
+div.tocBar {
+
+ text-align: left;
+ padding: 10px;
+ margin-left: 15px;
+ margin-right: 10px;
+ margin-top: 10px;
+ border: 1px solid #000000;
+ background-color: #DDDDDD;
+}
+
+div.content div.tocBar ul > li.toctree-l1 {
+ width: 400;
+ font-family: Arial, sans-serif;
+ color: #0C3762;
+ font-size: 1.2em;
+ font-weight: normal;
+ margin: 0; /** reset the margins back to 0**/
+ padding: 2px 5px;
+ /**text-shadow: 1px 1px 0 white;**/
+ background: #ddd;
+ font-size: 1.1em;
+}
+
+p.caption {
+ font-size:x-small;
+ text-align: right;
+ background-color: #cdcdcd;
+}
+
+div.sidebar2 {
+ width: 200px;
+ font-size: 0.75em;
+ line-height: 1.5em;
+ margin: 10px;
+ /*
+ padding-left: 10px;
+ padding-right: 10px;
+ */
+}
+
+div.content div.sidebar2 ul > li.toctree-l1 {
+ font-family: Arial, sans-serif;
+ color: #0C3762;
+ font-size: 1.2em;
+ font-weight: normal;
+ margin: 0; /** reset the margins back to 0**/
+ padding: 2px 5px;
+ /**text-shadow: 1px 1px 0 white;**/
+ background: #ddd;
+ font-size: 1.1em;
+}
+
+div.content ul > li.toctree-l1 > ul {
+ margin: 0;
+}
+
+div.sidebar2 h3 a {
+ color: #444;
+}
+
+div.sidebar2 ul {
+ /** This is the selected sidebar text **/
+ margin: 5px 10px;
+ /**
+ padding: 5px;
+ **/
+ padding-left: 0px;
+ /**background-color: #cdcdcd;**/
+}
+
+div.sidebar2 li {
+ padding:3px;
+}
+
+div.sidebar2 a {
+ color: #444;
+}
+
+#bodycontent {
+ padding: 4px;
+}
diff --git a/docs/ociotheme/theme.conf b/docs/ociotheme/theme.conf
new file mode 100644
index 0000000..d8118b4
--- /dev/null
+++ b/docs/ociotheme/theme.conf
@@ -0,0 +1,13 @@
+[theme]
+inherit = basic
+stylesheet = ocio.css
+pygments_style = autumn
+
+[options]
+full_logo = false
+textcolor = #333333
+headingcolor = #0c3762
+linkcolor = #dc3c01
+visitedlinkcolor = #892601
+hoverlinkcolor = #ff4500
+rightsidebar = true
diff --git a/docs/userguide/baking_luts.rst b/docs/userguide/baking_luts.rst
new file mode 100644
index 0000000..7085bf5
--- /dev/null
+++ b/docs/userguide/baking_luts.rst
@@ -0,0 +1,359 @@
+.. _userguide-bakelut:
+
+Baking LUT's
+============
+
+Sometimes it is necessary to write a color transform as a
+lookup-table file
+
+This is usually because an application does not natively support OCIO
+(unlike, say, Nuke which various OCIO nodes), but can load a LUT of
+some kind. This would currently include applications like Autodesk
+Flame, Adobe Photoshop, SideFX's MPlay (Houdini's "Image Viewer")
+
+Remember that baking a LUT is not a perfect solution. Different LUT
+formats have various limitations. Certain applications might apply
+LUT's differently (often incorrectly), and some formats simply cannot
+accurately represent certain transforms. Others might require
+carefully selecting shaper spaces and so on.
+
+Be sure to carefully test the generated LUT in the target
+application. Burning the LUT into a test image (such as Marcie!), and
+carefully comparing to a reference is often the only way to be sure a
+LUT is correct.
+
+Config-based baking
+*******************
+
+This section assumes you have a working OCIO config.
+
+The config can either be specified by setting the OCIO environment variable::
+
+ bash$ export OCIO=~/path/to/spi-vfx/config.ocio
+
+Alternatively the config can be specified as a command-line argument
+to the ociobakelut command, ``--iconfig ~/path/to/spi-vfx/config.ocio``
+
+These examples will use the :ref:`config-spivfx` config, specifically the
+following colorspaces
+
+* ``lnf`` - scene-referred linear light colorspace (reference colorspace)
+* ``lg10`` - film log colorspace (0-1 colorspace)
+* ``srgb8`` - sRGB display colorspace
+
+Remember these are just for the examples - you can of course use any
+config and any colorspaces
+
+Log-input display LUT
++++++++++++++++++++++
+
+Say we have a ``lg10`` image in MPlay (maybe a ".cin" film scan), and
+wish to view it in our main display colorspace, ``srgb8``
+
+The available formats are listed in the ``ociobakelut --help`` - for
+MPlay, we use the "houdini" format (see :ref:`the FAQ<faq-supportedlut>`
+for a more detailed list)
+
+So, to create a LUT that transforms from ``lg10`` to ``srgb8``::
+
+ bash$ ociobakelut --format houdini --inputspace lg10 --outputspace srgb8 log_to_display.lut
+
+We could then load this LUT into MPlay and view a lg10 image
+correctly! (note that by MPlay tries to linearise ".cin" files by
+default, which can be disabled in the preferences, "Convert form 10bit
+Log")
+
+For most other applications, we could simply change the ``--format``
+
+Shaper spaces
++++++++++++++
+
+Before we create a LUT to view linear-light images, it's important to
+understand shaper-spaces and preluts.
+
+The two main types of LUT's are 1D and 3D. Such LUT formats typically
+require input values in the 0.0-1.0 range. Such a LUT would be
+unsuitable for linear-light values input images (where values are
+often over 1)
+
+To address this, various LUT formats contain a smaller "prelut" (or
+"shaper LUT") which is applied before the main LUT. This is used to
+transform the input values into a 0-1 range (typically a linear-to-log
+type transform)
+
+In terms of color-transforms, the prelut transforms from
+"input-space" to "shaper-space", then the main LUT transforms from
+"shaper-space" to "output-space"
+
+Some formats do not support such a shaper LUT - these are typically
+used in applications which do not work with floating-point images (e.g
+Lustre often works with 10-bit integer DPX's, so it's natively
+supported "--format lustre" (3DL) format has no need for a prelut)
+
+
+Linear-light input display LUT
+++++++++++++++++++++++++++++++
+
+With shaper-spaces explained, lets say we have a ``lnf`` linear light
+image in MPlay, and wish to view it in the ``srgb8`` colorspace.
+
+To create this LUT accurately, without clipping, we will use the LUT's
+prelut to transform from ``lnf`` to ``lg10``, then the 3D LUT will
+transform from ``lg10`` to ``srgb8``
+
+Sounds complicated, but the command is almost the same as before, just
+with the ``--shaperspace`` argument (and ``--inputspace`` changed, of
+course)::
+
+ bash$ ociobakelut --format houdini --inputspace lnf --shaperspace lg10 --outputspace srgb8 lin_to_display.lut
+
+Allocation-based prelut
++++++++++++++++++++++++
+
+If your :ref:`allocation variables<allocationvars>` are setup
+correctly, you can omit the ``--shaperspace`` argument, and a prelut
+will be automatically created based on the allocation vars (see the
+linked page for more information)
+
+Since the colorspaces in the config we are using (:ref:`config-spivfx`) have
+their allocation variables set correctly, we could simplify the
+``lnf`` to ``srgb8`` bake command::
+
+ bash$ ociobakelut --format houdini --inputspace lnf --outputspace srgb8 lin_to_display_allocbased.lut
+
+This command creates a very different prelut to the explicitly
+specified ``--shaperspace lg10`` in the previous example. Explicitly
+specifying a shaper can produce better results, however the
+allocation-based prelut usually works nicely, and is convinient
+
+Note that allocation-var based preluts is baker-format dependant, and
+not all formats currently implement them
+
+
+Config-free baking
+******************
+
+You can perform baking without using a OCIO config. This means you
+don't have to create a temporary config just to, say, convert from one
+LUT format to another.
+
+Converting between formats
+++++++++++++++++++++++++++
+
+Say we have a houdini LUT named ``log_to_display.lut``. To convert
+this to a Flame compatible 3dl file, simply run::
+
+ ociobakelut --format flame --lut log_to_display.lut for_flame.3dl
+
+
+Reversing a 1D LUT
+++++++++++++++++++
+
+You can apply a LUT in reverse, and write this to a new LUT (this does
+not work for 3D LUT's, but will for 1D LUT's)::
+
+ bash$ ociobakelut --format flame --invlut logtosrgb.3dl srgbtolog.3dl
+
+Creating a grade LUT
+++++++++++++++++++++
+
+You can create a LUT which applies CDL-compliant grades::
+
+ ociobakelut --format cinespace --slope 1.2 1.0 0.9 mygrade.csp
+
+Combining options
++++++++++++++++++
+
+These options can be used together, or used multiple times.
+
+For example, to perform a slope offset, then apply "mylut.csp", saving
+it out for Lustre::
+
+ bash$ ociobakelut --format lustre --slope 2.0 1.5 0.4 --lut mylut.csp output.3dl
+
+
+ICC profiles (Photoshop)
+************************
+
+Photoshop is very focused around print and graphic-design, industries
+with very different color management concerns to modern feature-film
+VFX. As such, it can be a pain to integrate.
+
+The main issue is current versions of Photoshop (CS5) are only
+practical for working with 16-bit integer images (not floating
+point/linear-light images as is common in compositing software)
+
+The second issue is there is no simple way to load a simple 1D or 3D
+LUT into Photoshop (and it's API does not make this easy either!)
+
+A working space
++++++++++++++++
+
+First, we need to decide on a colorspace to use for the images in
+Photoshop. This is the colorspace in which matte-paintings will be
+performed (likely a different colorspace that used for
+texture-painting, as these have different requirements)
+
+The working space should be a "0-1 colorspace", reversable, and for
+matte-paintings ideally allow painting values over "diffuse white" (in
+other words, to paint values over 1.0 when converted to linear-light
+in comp)
+
+This is a facility-dependant workflow choice.
+
+For this example we will use the ``vd16`` colorspace, as described by
+the :ref:`config-spivfx`
+
+Creating display LUT
+++++++++++++++++++++
+
+"Proofing profiles" in Photoshop can be used in a very similar way to
+a display LUT in applications like Nuke. This proof-profile can be
+used to apply a 3D color transform from the working-space to a
+display space (e.g transform from ``vd16`` to ``srgb8`` in the spi-vfx
+config)
+
+These proofing-profiles are ICC profiles - a rather print-specific
+technology and relatively complex format
+
+Luckily, ``ociobakelut`` can be used to create these... but, first,
+there are some important considerations:
+
+It is important to match the ``--displayicc`` option to the profile
+used for the display.
+
+Secondly, Photoshop has a lot of print-focused color-management
+options, some of which can cause problems.
+
+Determine display ICC
++++++++++++++++++++++
+
+On OS X, launch "System Preferences", open "Displays" and click
+"Color" tab. The currently active ICC profile is selected.
+
+If you just want something simple that "probably matches" a Linux
+machine, say, it is easiest to uncheck "Show profiles for this display
+only" and select the "sRGB IEC61966-2.1" profile. You can skip the
+rest of this section in this case.
+
+.. figure:: images/ps_icc/psicc_open_current_profile.png
+ :align: center
+
+However, if you have a specific display-profile selected (maybe
+created by monitor-calibration software), you should do the following:
+
+Click "Open Profile", and right-click the icon in the top of the window, and click the folder:
+
+.. figure:: images/ps_icc/psicc_reveal_profile.png
+ :align: center
+
+This reveals the current profile in Finder. You can drag the file onto
+a Terminal.app window to get the full path (or, type it manually)
+
+.. TODO: Is there a standard way to find this on Windows?
+
+Create the ICC profile
+++++++++++++++++++++++
+
+Almost done now. We can write the ICC profile!
+
+The full command is, using our example colorspaces of ``vd16`` and ``srgb8``::
+
+ bash$ ociobakelut --format icc --inputspace vd16 --outputspace srgb8 --displayicc /path/to/my/monitorprofile.icc --description "vd16 to srgb8"
+
+
+The first three options are the same as any other LUT::
+
+ bash$ ociobakelut --format icc --inputspace vd16 --outputspace srgb8 [...]
+
+Then we specify the display ICC profile::
+
+ [...] --displayicc /path/to/my/monitorprofile.icc [...]
+
+We can set the description (shown in Photoshop), and as the last argument, specify::
+
+ [...] --description "vd16 to srgb8" [...]
+
+Finally an argument for the output file:
+
+ [...] vd16_to_srgb.icc
+
+
+If you selected the "sRGB IEC61966-2.1" display profile, you can omit
+the ``--displayicc`` argument (it defaults to an standard sRGB
+profile)::
+
+ bash$ ociobakelut --format icc --inputspace vd16 --outputspace srgb8 --description "vd16 to srgb8"
+
+Loading the "display LUT"
++++++++++++++++++++++++++
+
+Last step is to load the ICC profile into Photoshop, and enable it.
+
+On OS X, these can be put into::
+
+ /Library/ColorSync/Profiles/
+
+(or the equivelant directory in your home-directory)
+
+On Windows, right-click the profile and select "Install profile"
+
+
+Then on either platform, click "View > Proof Setup > Custom..."
+
+.. figure:: images/ps_icc/psicc_proof_setup.png
+ :align: center
+
+Select your profile from the "Device to simulate" dropdown (the name
+is what you supplied with ``--description``):
+
+.. figure:: images/ps_icc/psicc_select_profile.png
+ :align: center
+
+As pictured, selecting "Preserve RGB numbers", and deselecting
+"Simulate Black Ink" is a good starting point (see the next section on
+"Other color settings")
+
+Finally, you can load an image in your working space, and click "View
+> Proof Colors", or hit cmd+y (or ctrl+y)
+
+When active, the profile name is shown in the window title (e.g
+".... (RGB/16#/vd16 to srgb8", where the part after the "#/" is the
+profile name, "RGB/16" indicates the current image mode)
+
+Other color settings
++++++++++++++++++++++
+
+(note this guide is based on Photoshop CS5, and written while checking
+the OS X version, although most of these apply similarly on Windows 7)
+
+It is usually possible to get a matte-painting to look identical in
+Photoshop as it does in a more VFX-friendly application such as Nuke.
+
+However, as mentioned Photoshop has a lot of color-management related
+options, many of which can impair the match between it and other
+applications. The operating system also has some controls (as seen
+before with the ColorSync display profile)
+
+The settings that require tweaking have a tendency to change with OS
+versions, Photoshop versions and the phase of the moon. The only way
+to be sure is to compare Photoshop side-by-side with a
+LUT-reference-image (ideally toggling between Photoshop and Nuke):
+
+.. figure:: images/ps_icc/psicc_itworks.png
+ :align: center
+
+
+The most improtant settings are in the "View > Proof Setup > Custom
+..." menu.
+
+The recommended "Preserve RGB" setting works sometimes. Other times
+disabling "Preserve RGB Numbers" and selecting "Rendering Intent:
+Relative Colorimetric" can be closer.
+
+It is safest to not assign a profile to the images you are working
+on - this is done by clicking "Edit > Assign Profile", and selecting
+"Don't Color Manage This Document".
+
+In closing, of course none of this matters if you don't have a
+calibrated monitor!
diff --git a/docs/userguide/contexts.rst b/docs/userguide/contexts.rst
new file mode 100644
index 0000000..262f158
--- /dev/null
+++ b/docs/userguide/contexts.rst
@@ -0,0 +1,361 @@
+Contexts
+========
+
+OCIO's allows different LUT's or grades to be applied based on the
+current context.
+
+These contexts are usually based on environment variables, but also
+allows on-the-fly context switching in applications that operate on
+multiple shots (such as playback tools)
+
+Typically these would be used as part of the display transform, to
+apply shot-specific looks (such as a CDL color correction, or a 1D
+grade LUT)
+
+
+.. _context_per_shot_luts:
+
+A contrived example
+*******************
+
+The simplest way to explain this feature is with examples. Say we have
+two shots, ``ab-123`` and ``sf-432``, and each shot requires a
+different LUT to view. The current shot name is stored in the
+environment variable SHOT.
+
+In the OCIO config, you can use this SHOT environment variable to
+construct the LUT's path/filename. This path can be absolute (e.g
+``/example/path/${SHOT}.spi1d``), or relative to any directory on the
+OCIO search path, which includes the resource path (e.g
+``${SHOT}.spi1d``)
+
+This is a simplified example, to demonstrate the context
+feature. Typically this "contextual LUT" would be used in conjuction
+with other LUT's (e.g before a scene-linear to log transform, followed
+by a 3D film emulation LUT), this will be covered in
+:ref:`context_per_shot_grade`
+
+So, we have our empty OCIO config in ``~/showcfg``, and our two LUTs
+in ``~/showcfg/luts`` which are named ``af-123.spi1d`` and
+``sf-432.spi1d``::
+
+ ~/showcfg/
+ config.ocio
+ luts/
+ af-123.spi1d
+ sf-432.spi1d
+
+In the config, we first specify the config version, and the resource
+path (usually this is relative to the directory containing
+``config.ocio``, although can be an absolute path)::
+
+ ocio_profile_version: 1
+ resource_path: luts
+
+Next, we define a colorspace that transforms from the show reference
+space to the display colorspace:
+
+.. code-block:: yaml
+
+ colorspaces:
+ - !<ColorSpace>
+ name: srgb8
+ family: srgb
+ bitdepth: 8ui
+ from_reference: !<FileTransform> {src: ${SHOT}.spi1d}
+
+Then add a display alias for this transform:
+
+.. code-block:: yaml
+
+ displays:
+ - !<Display> {device: sRGB, name: "Shot LUT", colorspace: srgb8}
+
+
+Finally, we point the OCIO env-variable to the config, set the SHOT
+env-variable to the shot being worked on, and launch Nuke (or any
+other OCIO-enabled application)::
+
+ export OCIO=~/showcfg/config.ocio
+ export SHOT=af-123
+ nuke
+
+In Nuke, we create an OCIODisplay node, select our "sRGB" device with
+the "Shot LUT" transform, and this will apply the ``af-123.spi1d``
+LUT.
+
+.. _context_per_shot_grade:
+
+Per-shot grades
+***************
+
+Similarly to LUTs, we use a ``.cc`` file (an XML file containing a
+single ASC CDL ``<ColorCorrection>``), or a ``.ccc`` file (an XML file
+containing multiple ASC CDL color corrections, each with a unique ID)
+
+The ``.cc`` file is applied identically to a regular LUT files, using
+a ``FileTransform``. For example, if we have ``af-123.cc`` in the
+``luts/`` directory:
+
+.. code-block:: xml
+
+ <ColorCorrection id="mygrade">
+ <SOPNode>
+ <Slope>2 1 1</Slope>
+ <Offset>0 0 0</Offset>
+ <Power>1 1 1</Power>
+ </SOPNode>
+ <SATNode>
+ <Saturation>1</Saturation>
+ </SATNode>
+ </ColorCorrection>
+
+
+We wish to apply this grade on the scene-linear image, then transform
+into log and apply a 3D print emulation LUT. Since this requires
+multiple transforms, instead of using a single ``FileTransform``, we
+use a ``GroupTransform`` (which is is just a collection of other
+transforms):
+
+.. code-block:: yaml
+
+ colorspaces:
+ - !<ColorSpace>
+ name: lnh
+ family: ln
+ bitdepth: 16f:
+ isdata: false
+
+ - !<ColorSpace>
+ name: lg10
+ family: lg
+ bitdepth: 10ui
+ isdata: false
+ to_reference: !<FileTransform> {src: lg10.spi1d, interpolation: nearest}
+
+ - !<ColorSpace>
+ name: srgb8
+ family: srgb
+ bitdepth: 8ui
+ isdata: false
+ from_reference: !<GroupTransform>
+ children:
+ - !<FileTransform> {src: ${SHOT}.cc}
+ - !<ColorSpaceTransform> {src: lnh, dst: lg10}
+ - !<FileTransform> {src: film_emulation.spi3d, interpolation: linear}
+
+A .ccc file is a collection of ``<ColorCorrection>``'s. The only
+difference is when defining the ``FileTransform``, you must specify
+the ``cccdid`` key, which you can also construct using the context's
+environment variables. This means we could create a ``grades.ccc``
+file containing the grade for all our shots:
+
+.. code-block:: xml
+
+ <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
+ <ColorCorrection id="af-123">
+ <SOPNode>
+ <Slope>2 1 1</Slope>
+ <Offset>0 0 0</Offset>
+ <Power>1 1 1</Power>
+ </SOPNode>
+ <SATNode>
+ <Saturation>1</Saturation>
+ </SATNode>
+ </ColorCorrection>
+ <ColorCorrection id="mygrade">
+ <SOPNode>
+ <Slope>0.9 0.7 0.9</Slope>
+ <Offset>0 0 0</Offset>
+ <Power>1 1 1</Power>
+ </SOPNode>
+ <SATNode>
+ <Saturation>1</Saturation>
+ </SATNode>
+ </ColorCorrection>
+ </ColorCorrectionCollection>
+
+And the colorspace definition to utilise this:
+
+.. code-block:: yaml
+
+ - !<ColorSpace>
+ name: srgb8
+ family: srgb
+ bitdepth: 8ui
+ isdata: false
+ from_reference: !<GroupTransform>
+ children:
+ - !<FileTransform> {src: grades.ccc, cccid: ${SHOT}}
+ - !<ColorSpaceTransform> {src: lnh, dst: lg10}
+ - !<FileTransform> {src: film_emulation.spi3d, interpolation: linear}
+
+
+.. _context_complete_example:
+
+A complete example
+******************
+
+.. warning::
+ This is incomplete, the lnh_graded space is likely wrong
+
+The context feature can be used to accommodate complex grading
+pipelines. In this example, we have a "neutral grade" for each shot,
+to neutralise color casts and exposure variations, keeping plates
+consistent throughout a sequence.
+
+To view a shot, we reverse this neutral grade, apply a "beauty grade",
+then apply the display transform (the usual lin-to-log and a film
+emulation LUT)
+
+We will use the same two example shots from before, af-123 (which is
+in the af sequence) and sg-432 (in the sg sequence). Imagine we have
+many shots in each sequence, so we wish to put the grades for each
+sequence in a separate file.
+
+Using the same directory structure as above, in ``~/showcfg/luts`` we
+first create two grade files, ``grades_af.ccc``:
+
+.. code-block:: xml
+
+ <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
+ <ColorCorrection id="af/af-123/neutral">
+ <SOPNode>
+ <Slope>2 1 1</Slope>
+ <Offset>0 0 0</Offset>
+ <Power>1 1 1</Power>
+ </SOPNode>
+ <SATNode>
+ <Saturation>1</Saturation>
+ </SATNode>
+ </ColorCorrection>
+
+ <ColorCorrection id="af/af-123/beauty">
+ <SOPNode>
+ <Slope>1.5 1.2 0.9</Slope>
+ <Offset>0 0 0</Offset>
+ <Power>1 1 1</Power>
+ </SOPNode>
+ <SATNode>
+ <Saturation>0.8</Saturation>
+ </SATNode>
+ </ColorCorrection>
+
+ <!-- More ColorCorrection's... -->
+ </ColorCorrectionCollection>
+
+
+And ``grades_sg.ccc``:
+
+.. code-block:: xml
+
+ <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
+ <ColorCorrection id="sg/sg-432/neutral">
+ <SOPNode>
+ <Slope>0.9 0.7 0.9</Slope>
+ <Offset>0 0 0</Offset>
+ <Power>1 1 1</Power>
+ </SOPNode>
+ <SATNode>
+ <Saturation>1</Saturation>
+ </SATNode>
+ </ColorCorrection>
+
+ <ColorCorrection id="sg/sg-432/beauty">
+ <SOPNode>
+ <Slope>1.1 0.9 0.8</Slope>
+ <Offset>0 0 0</Offset>
+ <Power>1.2 0.9 1.5</Power>
+ </SOPNode>
+ <SATNode>
+ <Saturation>1</Saturation>
+ </SATNode>
+ </ColorCorrection>
+
+ <!-- More ColorCorrection's.. -->
+ </ColorCorrectionCollection>
+
+
+Next, we create the ``config.ocio`` file, containing a colorspace to
+define several colorspaces:
+
+* ``lnh``, the scene-linear, 16-bit half-float space in which
+ compositing will happen
+
+* ``lg10``, the 10-bit log space in which material will be received
+ (e.g in .dpx format)
+
+* ``srgb8``, the display colorspace, for viewing the neutrally graded
+ footage on an sRGB display
+
+* ``srgb8graded``, another display colorspace, for viewing the final
+ "beauty grade"
+
+
+.. code-block:: yaml
+
+ ocio_profile_version: 1
+
+ # The directory relative to the location of this config
+ resource_path: "luts"
+
+ roles:
+ scene_linear: lnh
+ compositing_log: lgf
+
+ displays:
+ # Reference to display transform, without reversing the working grade
+ - !<Display> {device: sRGB, name: Film1D, colorspace: srgb8}
+
+ # Reference to display, reversing the working grade, and applying
+ # the beauty grade
+ - !<Display> {device: sRGB, name: Film1DGraded, colorspace: srgb8graded}
+
+ colorspaces:
+
+ # The source space, containing a log to scene-linear LUT
+ - !<ColorSpace>
+ name: lg10
+ family: lg
+ bitdepth: 10ui
+ isdata: false
+ to_reference: !<FileTransform> {src: lg10.spi1d, interpolation: nearest}
+
+ # Our scene-linear space (reference space)
+ - !<ColorSpace>
+ name: lnh
+ family: ln
+ bitdepth: 16f
+ isdata: false
+
+ # Neutrally graded scene-linear
+ - !<ColorSpace>
+ name: lnh_graded
+ family: ln
+ bitdepth: 16f
+ isdata: false
+ to_reference: !<FileTransform> {src: "grades_${SEQ}.ccc", cccid: "${SEQ}/${SHOT}/neutral"}
+
+
+ # The display colorspace - how to get from scene-linear to sRGB
+ - !<ColorSpace>
+ name: srgb8
+ family: srgb
+ bitdepth: 8ui
+ isdata: false
+ from_reference: !<GroupTransform>
+ children:
+ - !<ColorSpaceTransform> {src: lnh, dst: lg10}
+ - !<FileTransform> {src: lg_to_srgb.spi3d, interpolation: linear}
+
+ # Display color, with neutral grade reversed, and beauty grade applied
+ - !<ColorSpace>
+ name: srgb8graded
+ family: srgb
+ bitdepth: 8ui
+ isdata: false
+ from_reference: !<GroupTransform>
+ children:
+ - !<FileTransform> {src: "grades_${SEQ}.ccc", cccid: "${SEQ}/${SHOT}/neutral", direction: inverse}
+ - !<FileTransform> {src: "grades_${SEQ}.ccc", cccid: "${SEQ}/${SHOT}/beauty", direction: forward}
+ - !<ColorSpaceTransform> {src: lnh, dst: srgb8}
diff --git a/docs/userguide/images/ps_icc/psicc_itworks.png b/docs/userguide/images/ps_icc/psicc_itworks.png
new file mode 100644
index 0000000..242db00
--- /dev/null
+++ b/docs/userguide/images/ps_icc/psicc_itworks.png
Binary files differ
diff --git a/docs/userguide/images/ps_icc/psicc_open_current_profile.png b/docs/userguide/images/ps_icc/psicc_open_current_profile.png
new file mode 100644
index 0000000..1654ae6
--- /dev/null
+++ b/docs/userguide/images/ps_icc/psicc_open_current_profile.png
Binary files differ
diff --git a/docs/userguide/images/ps_icc/psicc_proof_setup.png b/docs/userguide/images/ps_icc/psicc_proof_setup.png
new file mode 100644
index 0000000..179eb8e
--- /dev/null
+++ b/docs/userguide/images/ps_icc/psicc_proof_setup.png
Binary files differ
diff --git a/docs/userguide/images/ps_icc/psicc_reveal_profile.png b/docs/userguide/images/ps_icc/psicc_reveal_profile.png
new file mode 100644
index 0000000..07ad56c
--- /dev/null
+++ b/docs/userguide/images/ps_icc/psicc_reveal_profile.png
Binary files differ
diff --git a/docs/userguide/images/ps_icc/psicc_select_profile.png b/docs/userguide/images/ps_icc/psicc_select_profile.png
new file mode 100644
index 0000000..06fecef
--- /dev/null
+++ b/docs/userguide/images/ps_icc/psicc_select_profile.png
Binary files differ
diff --git a/docs/userguide/index.rst b/docs/userguide/index.rst
new file mode 100644
index 0000000..256d89d
--- /dev/null
+++ b/docs/userguide/index.rst
@@ -0,0 +1,15 @@
+.. _user-guide:
+
+User Guide
+==========
+
+These guides will focus on a specific task (for example, writing a basic config, or setting up per-shot LUT's).
+For a "broader picture" expiation of how to use OCIO, see the :ref:`configurations` section
+
+.. toctree::
+ :maxdepth: 2
+
+ tool_overview
+ baking_luts
+ contexts
+ looks
diff --git a/docs/userguide/looks.rst b/docs/userguide/looks.rst
new file mode 100644
index 0000000..591d835
--- /dev/null
+++ b/docs/userguide/looks.rst
@@ -0,0 +1,139 @@
+Looks
+=====
+
+A "look" is a named color transform, intended to modify the look of an
+image in a "creative" manner (as opposed to a colorspace definion
+which tends to be technically/mathematically defined)
+
+Examples of looks may be a neutral grade, to be applied to film scans
+prior to VFX work, or a per-shot DI grade decided on by the director,
+to be applied just before the viewing transform
+
+Looks are defined similarly to colorspaces, you specify a name and a
+transform (possibly a GroupTransform containing several other
+transforms), and optionally an inverse transform.
+
+Where looks differ from colorspace definions are in how they are
+applied. With a look, you also specify the "process space" - the
+colorspace in which the transform is applied.
+
+Example configuration
+*********************
+
+Step 1: Setup a Look
+
+A look is a top-level OCIO configuration object. Conceptually, it's a
+named transform which gets applied in a specific color space. All of the
+changes below to the .ocio configs can be done manually by editing the
+text, or using the Python API.
+
+Example look definition in a OCIO config:
+
+.. code-block:: yaml
+
+ looks:
+ - !<Look>
+ name: di
+ process_space: rclg16
+ transform: !<FileTransform> {src: look_di.cc, interpolation: linear}
+
+
+The src file can be any LUT type that OCIO supports (in this case, it's a
+file that contains the ``<ColorCorrection>`` element from a CDL file.) You
+could also specify a .3dl, etc.
+
+Once you define a look in your configuration, you'll see that the
+``OCIOLookTransform`` node in Nuke will provide the named option. In
+this example, the 'DI' look conceptually represents a look that will
+be applied in DI. Other look names we often used are 'onset',
+'editorial', etc. The ``process_space`` specifies that the transform
+should be applied in that space. In this example, if you provide
+linear input to the ``OCIOLookTransform`` node, the pixels will be
+converted to ``rclg16`` before applying the ``look_di.cc``
+file-transform.
+
+Step 2: Update the Display to use a look.
+
+You can specify an optional 'looks' tag in the View tag, which will
+apply the specified look(s). This lets application in the viewer
+provide options which use the looks.
+
+Example:
+
+.. code-block:: yaml
+
+ displays:
+ DLP:
+ - !<View> {name: Raw, colorspace: nc10}
+ - !<View> {name: Log, colorspace: rclg10}
+ - !<View> {name: Film, colorspace: p3dci16}
+ - !<View> {name: Film DI, colorspace: p3dci16, looks: di}
+ sRGB:
+ - !<View> {name: Raw, colorspace: nc10}
+ - !<View> {name: Log, colorspace: rclg10}
+ - !<View> {name: Film, colorspace: srgb10}
+ - !<View> {name: Film DI, colorspace: srgb10, looks: di}
+
+
+Option for advanced users: The looks tag is actually a comma-delimited
+list supporting +/- modifiers. So if you you wanted to specify a View
+that undoes DI, and then adds Onset, you could do "-di,+onset".
+
+Step 3: Get per-shot looks supported.
+
+In the top example, look_di.cc, being a relative path location, will check
+each location in the config's search_path. The first file that's found
+will be used.
+
+So if your config contains::
+
+ search_path: luts
+
+... then only the 'luts' subdir relative to the OCIO config will be
+checked.
+
+However if you specify::
+
+ search_path: /shots/show/$SHOT/cc/data:luts
+
+...the directory '/shots/show/$SHOT/cc/data/' will be evaluated first,
+and only if not found will the 'luts' directory be checked.
+
+env-vars, absolute, and relative paths can be used both in the config's
+``search_path``, as well as the View's src specification.
+
+Example:
+
+.. code-block:: yaml
+
+ - !<Look>
+ name: di
+ process_space: rclg16
+ transform: !<FileTransform> {src: looks/$SHOT_di/current/look_$SHOT_di.cc, interpolation: linear}
+
+
+Note that if the per-shot lut is not found, you can control whether a
+fallback LUT succeeds based on if it's in the master location. You can
+also use this for multiple levels (show, shot, etc).
+
+Advanced option: If some shots use .cc files, and some use 3d-luts
+currently there's no simple way to handle this. What we'd recommend as a
+work around is to label all of your files with the same extension (such as
+.cc), and then rely on OCIO's resiliance to misnamed lut files to just load
+them anyways. Caveat: this only works in 1.0.1+ (commit sha-1: 6da3411ced)
+
+Advanced option: In the Nuke OCIO nodes, you often want to preview
+looks 'across shots' (often for reference, same-as, etc). You can
+override the env-vars in each node, using the 'Context' menu. For
+example, if you know that $SHOT is being used, in the context key1 you
+should specify 'SHOT', and the in value1 specify the shot to use (such
+as dev.lookdev). You can also use expressions, to say parse a shot
+name out of ``[metadata "input/filename"]``
+
+Advanced option: If you are writing your own OCIO integration code,
+``getProcessor`` will fail if the per-shot lut is not found, and you
+may want to distinguish this error from other OCIO errors. For this
+reason, we provide OCIO::ExceptionMissingFile, which can be explicitly
+caught (this can then handled using
+``OCIO::DisplayTransform::setLooksOverride()``). I'd expect image
+flipbook applications to use this approach.
diff --git a/docs/userguide/tool_overview.rst b/docs/userguide/tool_overview.rst
new file mode 100644
index 0000000..f9ac0e4
--- /dev/null
+++ b/docs/userguide/tool_overview.rst
@@ -0,0 +1,168 @@
+.. _userguide-tooloverview:
+
+Tool overview
+=============
+
+OCIO is comprised of many parts. At the lowest level there is the C++ API.
+This API can be used in applications and plugins
+
+Note that all these plugins use the same config file to define color spaces,
+roles and so on. For information on setting up configurations, see
+:ref:`configurations`
+
+The API
+*******
+
+Most users will never directly interact with the C++ API. However the API is used by all the supplied applications (e.g :ref:`overview-ocio2icc`) and plugins (e.g
+the :ref:`overview-nukeplugins`)
+
+To get started with the API, see the :ref:`developer-guide`
+
+.. _overview-ociocheck:
+
+ociocheck
+*********
+
+This is a command line tool which shows an overview of an OCIO config
+file, and check for obvious errors
+
+For example, the following shows the output of a config with a typo -
+the colorspace used for ``compositing_log`` is not incorrect::
+
+ $ ociocheck --iconfig example.ocio
+
+ OpenColorIO Library Version: 0.8.3
+ OpenColorIO Library VersionHex: 525056
+ Loading example.ocio
+
+ ** General **
+ Search Path: luts
+ Working Dir: /tmp
+
+ Default Display: sRGB
+ Default View: Film
+
+ ** Roles **
+ ncf (default)
+ lnf (scene_linear)
+ NOT DEFINED (compositing_log)
+
+ ** ColorSpaces **
+ lnf
+ lgf
+ ncf
+ srgb8 -- output only
+
+ ERROR: Config failed sanitycheck. The role 'compositing_log' refers to a colorspace, 'lgff', which is not defined.
+
+ Tests complete.
+
+It cannot verify the defined color transforms are "correct", only that the
+config file can be loaded by OCIO without error.
+
+As with all the OCIO command line tools, you can use the `--help` argument to
+read a description and see the other arguments accepted::
+
+ $ ociocheck --help
+ ociocheck -- validate an OpenColorIO configuration
+
+ usage: ociocheck [options]
+
+ --help Print help message
+ --iconfig %s Input .ocio configuration file (default: $OCIO)
+ --oconfig %s Output .ocio file
+
+
+.. _overview-ociobakelut:
+
+ociobakelut
+************
+
+A command line tool which bakes a color transform into various color
+lookup file formats ("a LUT")
+
+This is intended for applications that have not directly integrated
+OCIO, but can load LUT files
+
+If we want to create a ``lnf`` to ``srgb8`` viewer LUT for Houdini's
+MPlay::
+
+ $ ociobakelut --inputspace scene_linear --shaperspace lg10 --outputspace srgb8 --format houdini houdini__lnf_to_lg10_to_srgb8.lut
+
+The ``--inputspace`` and ``-outputspace`` options specify the
+colorspace of the input image, and the displayed image.
+
+Since a 3D LUT can only practically operate on 0-1 (e.g a Log image),
+the ``--shaperspace`` option is specified. This uses the Houdini LUT's
+1D "pretransform" LUT to do "lnf" to "lg10", then the 3D LUT part to
+go from "lg10" to "srgb8" (basically creating a single file containing
+a 1D linear-to-log LUT, and a 3D log-to-sRGB LUT)
+
+To make a log to sRGB LUT for Flame, the usage is similar, except the
+shaperspace option is omitted, as the input colorspace does not have
+values outside 0.0-1.0 (being a Log space)::
+
+ $ ociobakelut --inputspace lg10 --outputspace srgb8 --format flame flame__lg10_to_srgb.3dl
+
+See the :ref:`faq-supportedlut` section for a list of formats that
+support baking
+
+.. TODO: For more information on baking LUT's, see :ref:`userguide-bakelut`
+
+
+.. _overview-ocio2icc:
+
+ocio2icc
+********
+
+A command line tool to generate an ICC "proofing" profile from a color space
+transform, which can be used in applications such as Photoshop.
+
+A common workflow is for matte-painters to work on sRGB files in Photoshop. An
+ICC profile is used to view the work with the same film emulation transform as
+used in other departments.
+
+.. TODO: Link to more elaborate description
+
+
+.. _overview-ocioconvert:
+
+ocioconvert
+***********
+
+Loads an image, applies a color transform, and saves it to a new file.
+
+OpenImageIO is used to open and save the file, so a wide range of formats are supported.
+
+.. TODO: Link to more elaborate description
+
+
+.. _overview-ociodisplay:
+
+ociodisplay
+***********
+
+A basic image viewer. Uses OpenImageIO to load images, and displays them using OCIO and typical viewer controls (scene-linear exposure control and a post-display gamma control)
+
+May be useful to users to quickly check colorspace configuration, but
+primarily a demonstration of the OCIO API
+
+.. TODO: Link to more elaborate description
+
+
+.. _overview-nukeplugins:
+
+Nuke plugins
+************
+
+A set of OCIO nodes for The Foundry's Nuke, including:
+
+* OCIOColorSpace, transforms between two color spaces (similar to the built-in "ColorSpace" node, but the colorspaces are described in the OCIO config file)
+
+* OCIODisplay to be used as viewer processes
+
+* OCIOFileTransform loads a transform from a file (e.g a 1D or 3D LUT), and applies it
+
+* OCIOCDLTransform applies CDL-compliant grades, and includes utilities to create/load ASC CDL files
+
+.. TODO - Link to more elaborate description
diff --git a/export/OpenColorIO/OpenColorABI.h.in b/export/OpenColorIO/OpenColorABI.h.in
new file mode 100644
index 0000000..d39d586
--- /dev/null
+++ b/export/OpenColorIO/OpenColorABI.h.in
@@ -0,0 +1,89 @@
+/*
+Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef INCLUDED_OCIO_OPENCOLORABI_H
+#define INCLUDED_OCIO_OPENCOLORABI_H
+
+// Makefile configuration options
+#define OCIO_NAMESPACE @OCIO_NAMESPACE@
+#define OCIO_USE_BOOST_PTR @OCIO_USE_BOOST_PTR@
+#define OCIO_VERSION "@OCIO_VERSION@"
+#define OCIO_VERSION_NS v@SOVERSION@
+
+/* Version as a single 4-byte hex number, e.g. 0x01050200 == 1.5.2
+ Use this for numeric comparisons, e.g. #if OCIO_VERSION_HEX >= ...
+ Note: in the case where SOVERSION is overridden at compile-time,
+ this will reflect the original API version number.
+ */
+#define OCIO_VERSION_HEX ((@OCIO_VERSION_MAJOR@ << 24) | \
+ (@OCIO_VERSION_MINOR@ << 16) | \
+ (@OCIO_VERSION_PATCH@ << 8))
+
+
+// Namespace / version mojo
+#define OCIO_NAMESPACE_ENTER namespace OCIO_NAMESPACE { namespace OCIO_VERSION_NS
+#define OCIO_NAMESPACE_EXIT using namespace OCIO_VERSION_NS; }
+#define OCIO_NAMESPACE_USING using namespace OCIO_NAMESPACE;
+
+// shared_ptr / dynamic_pointer_cast
+#if OCIO_USE_BOOST_PTR
+#include <boost/shared_ptr.hpp>
+#define OCIO_SHARED_PTR boost::shared_ptr
+#define OCIO_DYNAMIC_POINTER_CAST boost::dynamic_pointer_cast
+#elif __GNUC__ >= 4
+#include <tr1/memory>
+#define OCIO_SHARED_PTR std::tr1::shared_ptr
+#define OCIO_DYNAMIC_POINTER_CAST std::tr1::dynamic_pointer_cast
+#else
+#error OCIO needs gcc 4 or later to get access to <tr1/memory> (or specify USE_BOOST_PTR instead)
+#endif
+
+// If supported, define OCIOEXPORT, OCIOHIDDEN
+// (used to choose which symbols to export from OpenColorIO)
+#if defined __linux__ || __APPLE__
+ #if __GNUC__ >= 4
+ #define OCIOEXPORT __attribute__ ((visibility("default")))
+ #define OCIOHIDDEN __attribute__ ((visibility("hidden")))
+ #else
+ #define OCIOEXPORT
+ #define OCIOHIDDEN
+ #endif
+#elif defined(_WIN32) || defined(_WIN64) || defined(_WINDOWS) || defined(_MSC_VER)
+ // Windows requires you to export from the main library and then import in any others
+ #if defined OpenColorIO_EXPORTS
+ #define OCIOEXPORT __declspec(dllexport)
+ #else
+ #define OCIOEXPORT __declspec(dllimport)
+ #endif
+ #define OCIOHIDDEN
+#else // Others platforms not supported atm
+ #define OCIOEXPORT
+ #define OCIOHIDDEN
+#endif
+
+#endif // INCLUDED_OCIO_OPENCOLORABI_H
diff --git a/export/OpenColorIO/OpenColorIO.h b/export/OpenColorIO/OpenColorIO.h
new file mode 100644
index 0000000..b83538f
--- /dev/null
+++ b/export/OpenColorIO/OpenColorIO.h
@@ -0,0 +1,1238 @@
+/*
+Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#ifndef INCLUDED_OCIO_OPENCOLORIO_H
+#define INCLUDED_OCIO_OPENCOLORIO_H
+
+#include <exception>
+#include <iosfwd>
+#include <string>
+#include <cstddef>
+
+#include "OpenColorABI.h"
+#include "OpenColorTypes.h"
+#include "OpenColorTransforms.h"
+
+/*!rst::
+C++ API
+=======
+
+**Usage Example:** *Compositing plugin that converts from "log" to "lin"*
+
+.. code-block:: cpp
+
+ #include <OpenColorIO/OpenColorIO.h>
+ namespace OCIO = OCIO_NAMESPACE;
+
+ try
+ {
+ // Get the global OpenColorIO config
+ // This will auto-initialize (using $OCIO) on first use
+ OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
+
+ // Get the processor corresponding to this transform.
+ OCIO::ConstProcessorRcPtr processor = config->getProcessor(OCIO::ROLE_COMPOSITING_LOG,
+ OCIO::ROLE_SCENE_LINEAR);
+
+ // Wrap the image in a light-weight ImageDescription
+ OCIO::PackedImageDesc img(imageData, w, h, 4);
+
+ // Apply the color transformation (in place)
+ processor->apply(img);
+ }
+ catch(OCIO::Exception & exception)
+ {
+ std::cerr << "OpenColorIO Error: " << exception.what() << std::endl;
+ }
+
+*/
+
+OCIO_NAMESPACE_ENTER
+{
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Exceptions
+ // **********
+
+ //!cpp:class:: An exception class to throw for errors detected at
+ // runtime.
+ //
+ // .. warning::
+ // All functions in the Config class can potentially throw this exception.
+ class OCIOEXPORT Exception : public std::exception
+ {
+ public:
+ //!cpp:function:: Constructor that takes a string as the exception message.
+ Exception(const char *) throw();
+ //!cpp:function:: Constructor that takes an exception pointer.
+ Exception(const Exception&) throw();
+ //!cpp:function:: Constructor that takes an exception pointer and returns an exception pointer (???).
+ Exception& operator=(const Exception&) throw();
+ //!cpp:function::
+ virtual ~Exception() throw();
+ //!cpp:function::
+ virtual const char* what() const throw();
+
+ private:
+ std::string msg_;
+ };
+
+ //!cpp:class:: An exception class for errors detected at
+ // runtime, thrown when OCIO cannot find a file that is expected to
+ // exist. This is provided as a custom type to
+ // distinguish cases where one wants to continue looking for
+ // missing files, but wants to properly fail
+ // for other error conditions.
+
+ class OCIOEXPORT ExceptionMissingFile : public Exception
+ {
+ public:
+ //!cpp:function::
+ ExceptionMissingFile(const char *) throw();
+ //!cpp:function::
+ ExceptionMissingFile(const ExceptionMissingFile&) throw();
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Global
+ // ******
+
+ //!cpp:function::
+ // OpenColorIO, during normal usage, tends to cache certain information
+ // (such as the contents of LUTs on disk, intermediate results, etc.).
+ // Calling this function will flush all such information.
+ // Under normal usage, this is not necessary, but it can be helpful in particular instances,
+ // such as designing OCIO profiles, and wanting to re-read luts without
+ // restarting.
+
+ extern OCIOEXPORT void ClearAllCaches();
+
+ //!cpp:function:: Get the version number for the library, as a
+ // dot-delimited string (e.g., "1.0.0"). This is also available
+ // at compile time as OCIO_VERSION.
+
+ extern OCIOEXPORT const char * GetVersion();
+
+ //!cpp:function:: Get the version number for the library, as a
+ // single 4-byte hex number (e.g., 0x01050200 for "1.5.2"), to be used
+ // for numeric comparisons. This is also available
+ // at compile time as OCIO_VERSION_HEX.
+
+ extern OCIOEXPORT int GetVersionHex();
+
+ //!cpp:function:: Get the global logging level.
+ // You can override this at runtime using the :envvar:`OCIO_LOGGING_LEVEL`
+ // environment variable. The client application that sets this should use
+ // :cpp:func:`SetLoggingLevel`, and not the environment variable. The default value is INFO.
+
+ extern OCIOEXPORT LoggingLevel GetLoggingLevel();
+
+ //!cpp:function:: Set the global logging level.
+ extern OCIOEXPORT void SetLoggingLevel(LoggingLevel level);
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Config
+ // ******
+ //
+ // A config defines all the color spaces to be available at runtime.
+ //
+ // The color configuration (:cpp:class:`Config`) is the main object for
+ // interacting with this library. It encapsulates all of the information
+ // necessary to use customized :cpp:class:`ColorSpaceTransform` and
+ // :cpp:class:`DisplayTransform` operations.
+ //
+ // See the :ref:`user-guide` for more information on
+ // selecting, creating, and working with custom color configurations.
+ //
+ // For applications interested in using only one color config at
+ // a time (this is the vast majority of apps), their API would
+ // traditionally get the global configuration and use that, as opposed to
+ // creating a new one. This simplifies the use case for
+ // plugins and bindings, as it alleviates the need to pass around configuration
+ // handles.
+ //
+ // An example of an application where this would not be sufficient would be
+ // a multi-threaded image proxy server (daemon), which wished to handle
+ // multiple show configurations in a single process concurrently. This
+ // app would need to keep multiple configurations alive, and to manage them
+ // appropriately.
+ //
+ // Roughly speaking, a novice user should select a
+ // default configuration that most closely approximates the use case
+ // (animation, visual effects, etc.), and set the :envvar:`OCIO` environment
+ // variable to point at the root of that configuration.
+ //
+ // .. note::
+ // Initialization using environment variables is typically preferable in
+ // a multi-app ecosystem, as it allows all applications to be
+ // consistently configured.
+ //
+ // See :ref:`developers-usageexamples`
+
+ //!cpp:function:: Get the current configuration.
+
+ extern OCIOEXPORT ConstConfigRcPtr GetCurrentConfig();
+
+ //!cpp:function:: Set the current configuration. This will then store a copy of the specified config.
+ extern OCIOEXPORT void SetCurrentConfig(const ConstConfigRcPtr & config);
+
+
+ //!cpp:class::
+ class OCIOEXPORT Config
+ {
+ public:
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _cfginit_section:
+ //
+ // Initialization
+ // ^^^^^^^^^^^^^^
+
+ //!cpp:function:: Constructor...ELABORATE
+ static ConfigRcPtr Create();
+ //!cpp:function::
+ static ConstConfigRcPtr CreateFromEnv();
+ //!cpp:function::
+ static ConstConfigRcPtr CreateFromFile(const char * filename);
+ //!cpp:function::
+ static ConstConfigRcPtr CreateFromStream(std::istream & istream);
+
+ //!cpp:function::
+ ConfigRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ // This will throw an exception if the config is malformed. The most
+ // common error occurs when references are made to colorspaces that do not
+ // exist.
+ void sanityCheck() const;
+
+ //!cpp:function::
+ const char * getDescription() const;
+ //!cpp:function::
+ void setDescription(const char * description);
+
+ //!cpp:function::
+ // Returns the string representation of the Config in YAML text form.
+ // This is typically stored on disk in a file with the extension .ocio.
+ void serialize(std::ostream & os) const;
+
+ //!cpp:function::
+ // This will produce a hash of the all colorspace definitions, etc.
+ // All external references, such as files used in FileTransforms, etc.,
+ // will be incorporated into the cacheID. While the contents of
+ // the files are not read, the file system is queried for relavent
+ // information (mtime, inode) so that the config's cacheID will
+ // change when the underlying luts are updated.
+ // If a context is not provided, the current Context will be used.
+ // If a null context is provided, file references will not be taken into
+ // account (this is essentially a hash of Config::serialize).
+ const char * getCacheID() const;
+ //!cpp:function::
+ const char * getCacheID(const ConstContextRcPtr & context) const;
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _cfgresource_section:
+ //
+ // Resources
+ // ^^^^^^^^^
+ // Given a lut src name, where should we find it?
+
+ //!cpp:function::
+ ConstContextRcPtr getCurrentContext() const;
+
+ //!cpp:function::
+ const char * getSearchPath() const;
+ void setSearchPath(const char * path);
+
+ //!cpp:function::
+ const char * getWorkingDir() const;
+ void setWorkingDir(const char * dirname);
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _cfgcolorspaces_section:
+ //
+ // ColorSpaces
+ // ^^^^^^^^^^^
+
+ //!cpp:function::
+ int getNumColorSpaces() const;
+ //!cpp:function:: This will null if an invalid index is specified
+ const char * getColorSpaceNameByIndex(int index) const;
+
+ //!rst::
+ // .. note::
+ // These fcns all accept either a color space OR role name.
+ // (Colorspace names take precedence over roles.)
+
+ //!cpp:function:: This will return null if the specified name is not
+ // found.
+ ConstColorSpaceRcPtr getColorSpace(const char * name) const;
+ //!cpp:function::
+ int getIndexForColorSpace(const char * name) const;
+
+ //!cpp:function::
+ // .. note::
+ // If another color space is already registered with the same name,
+ // this will overwrite it. This stores a copy of the specified
+ // color space.
+ void addColorSpace(const ConstColorSpaceRcPtr & cs);
+ //!cpp:function::
+ void clearColorSpaces();
+
+ //!cpp:function:: Given the specified string, get the longest,
+ // right-most, colorspace substring that appears.
+ //
+ // * If strict parsing is enabled, and no color space is found, return
+ // an empty string.
+ // * If strict parsing is disabled, return ROLE_DEFAULT (if defined).
+ // * If the default role is not defined, return an empty string.
+ const char * parseColorSpaceFromString(const char * str) const;
+
+ //!cpp:function::
+ bool isStrictParsingEnabled() const;
+ //!cpp:function::
+ void setStrictParsingEnabled(bool enabled);
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _cfgroles_section:
+ //
+ // Roles
+ // ^^^^^
+ // A role is like an alias for a colorspace. You can query the colorspace
+ // corresponding to a role using the normal getColorSpace fcn.
+
+ //!cpp:function::
+ // .. note::
+ // Setting the ``colorSpaceName`` name to a null string unsets it.
+ void setRole(const char * role, const char * colorSpaceName);
+ //!cpp:function::
+ int getNumRoles() const;
+ //!cpp:function:: Return true if the role has been defined.
+ bool hasRole(const char * role) const;
+ //!cpp:function:: Get the role name at index, this will return values
+ // like 'scene_linear', 'compositing_log'.
+ // Return empty string if index is out of range.
+ const char * getRoleName(int index) const;
+
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _cfgdisplayview_section:
+ //
+ // Display/View Registration
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^
+ //
+ // Looks is a potentially comma (or colon) delimited list of lookNames,
+ // Where +/- prefixes are optionally allowed to denote forward/inverse
+ // look specification. (And forward is assumed in the absense of either)
+
+ //!cpp:function::
+ const char * getDefaultDisplay() const;
+ //!cpp:function::
+ int getNumDisplays() const;
+ //!cpp:function::
+ const char * getDisplay(int index) const;
+
+ //!cpp:function::
+ const char * getDefaultView(const char * display) const;
+ //!cpp:function::
+ int getNumViews(const char * display) const;
+ //!cpp:function::
+ const char * getView(const char * display, int index) const;
+
+ //!cpp:function::
+ const char * getDisplayColorSpaceName(const char * display, const char * view) const;
+ //!cpp:function::
+ const char * getDisplayLooks(const char * display, const char * view) const;
+
+ //!cpp:function:: For the (display,view) combination,
+ // specify which colorSpace and look to use.
+ // If a look is not desired, then just pass an empty string
+
+ void addDisplay(const char * display, const char * view,
+ const char * colorSpaceName, const char * looks);
+
+ //!cpp:function::
+ void clearDisplays();
+
+ // $OCIO_ACTIVE_DISPLAYS envvar can, at runtime, optionally override the allowed displays.
+ // It is a comma or colon delimited list.
+ // Active displays that are not in the specified profile will be ignored, and the
+ // left-most defined display will be the default.
+
+ //!cpp:function:: Comma-delimited list of display names.
+ void setActiveDisplays(const char * displays);
+ //!cpp:function::
+ const char * getActiveDisplays() const;
+
+ // $OCIO_ACTIVE_VIEWS envvar can, at runtime, optionally override the allowed views.
+ // It is a comma or colon delimited list.
+ // Active views that are not in the specified profile will be ignored, and the
+ // left-most defined view will be the default.
+
+ //!cpp:function:: Comma-delimited list of view names.
+ void setActiveViews(const char * views);
+ //!cpp:function::
+ const char * getActiveViews() const;
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _cfgluma_section:
+ //
+ // Luma
+ // ^^^^
+ //
+ // Get the default coefficients for computing luma.
+ //
+ // .. note::
+ // There is no "1 size fits all" set of luma coefficients. (The
+ // values are typically different for each colorspace, and the
+ // application of them may be nonsensical depending on the
+ // intensity coding anyways). Thus, the 'right' answer is to make
+ // these functions on the :cpp:class:`Config` class. However, it's
+ // often useful to have a config-wide default so here it is. We will
+ // add the colorspace specific luma call if/when another client is
+ // interesting in using it.
+
+ //!cpp:function::
+ void getDefaultLumaCoefs(float * rgb) const;
+ //!cpp:function:: These should be normalized (sum to 1.0 exactly).
+ void setDefaultLumaCoefs(const float * rgb);
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _cflooka_section:
+ //
+ // Look
+ // ^^^^
+ //
+ // Manager per-shot look settings.
+ //
+
+ //!cpp:function::
+ ConstLookRcPtr getLook(const char * name) const;
+
+ //!cpp:function::
+ int getNumLooks() const;
+
+ //!cpp:function::
+ const char * getLookNameByIndex(int index) const;
+
+ //!cpp:function::
+ void addLook(const ConstLookRcPtr & look);
+
+ //!cpp:function::
+ void clearLooks();
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _cfgprocessors_section:
+ //
+ // Processors
+ // ^^^^^^^^^^
+ //
+ // Convert from inputColorSpace to outputColorSpace
+ //
+ // .. note::
+ // This may provide higher fidelity than anticipated due to internal
+ // optimizations. For example, if the inputcolorspace and the
+ // outputColorSpace are members of the same family, no conversion
+ // will be applied, even though strictly speaking quantization
+ // should be added.
+ //
+ // If you wish to test these calls for quantization characteristics,
+ // apply in two steps; the image must contain RGB triples (though
+ // arbitrary numbers of additional channels can be supported (ignored)
+ // using the pixelStrideBytes arg).
+
+ //!cpp:function::
+ ConstProcessorRcPtr getProcessor(const ConstContextRcPtr & context,
+ const ConstColorSpaceRcPtr & srcColorSpace,
+ const ConstColorSpaceRcPtr & dstColorSpace) const;
+ //!cpp:function::
+ ConstProcessorRcPtr getProcessor(const ConstColorSpaceRcPtr & srcColorSpace,
+ const ConstColorSpaceRcPtr & dstColorSpace) const;
+
+ //!cpp:function::
+ // .. note::
+ // Names can be colorspace name, role name, or a combination of both.
+ ConstProcessorRcPtr getProcessor(const char * srcName,
+ const char * dstName) const;
+ //!cpp:function::
+ ConstProcessorRcPtr getProcessor(const ConstContextRcPtr & context,
+ const char * srcName,
+ const char * dstName) const;
+
+ //!rst:: Get the processor for the specified transform.
+ //
+ // Not often needed, but will allow for the re-use of atomic OCIO
+ // functionality (such as to apply an individual LUT file).
+
+ //!cpp:function::
+ ConstProcessorRcPtr getProcessor(const ConstTransformRcPtr& transform) const;
+ //!cpp:function::
+ ConstProcessorRcPtr getProcessor(const ConstTransformRcPtr& transform,
+ TransformDirection direction) const;
+ //!cpp:function::
+ ConstProcessorRcPtr getProcessor(const ConstContextRcPtr & context,
+ const ConstTransformRcPtr& transform,
+ TransformDirection direction) const;
+
+ private:
+ Config();
+ ~Config();
+
+ Config(const Config &);
+ Config& operator= (const Config &);
+
+ static void deleter(Config* c);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const Config&);
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _colorspace_section:
+ //
+ // ColorSpace
+ // **********
+ // The *ColorSpace* is the state of an image with respect to colorimetry
+ // and color encoding. Transforming images between different
+ // *ColorSpaces* is the primary motivation for this library.
+ //
+ // While a complete discussion of colorspaces is beyond the scope of
+ // header documentation, traditional uses would be to have *ColorSpaces*
+ // corresponding to: physical capture devices (known cameras, scanners),
+ // and internal 'convenience' spaces (such as scene linear, logarithmic).
+ //
+ // *ColorSpaces* are specific to a particular image precision (float32,
+ // uint8, etc.), and the set of ColorSpaces that provide equivalent mappings
+ // (at different precisions) are referred to as a 'family'.
+
+ //!cpp:class::
+ class OCIOEXPORT ColorSpace
+ {
+ public:
+ //!cpp:function::
+ static ColorSpaceRcPtr Create();
+
+ //!cpp:function::
+ ColorSpaceRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ const char * getName() const;
+ //!cpp:function::
+ void setName(const char * name);
+
+ //!cpp:function::Get the family, for use in user interfaces (optional)
+ const char * getFamily() const;
+ //!cpp:function::Set the family, for use in user interfaces (optional)
+ void setFamily(const char * family);
+
+ //!cpp:function::Get the ColorSpace group name (used for equality comparisons)
+ // This allows no-op transforms between different colorspaces.
+ // If an equalityGroup is not defined (an empty string), it will be considered
+ // unique (i.e., it will not compare as equal to other ColorSpaces with an
+ // empty equality group). This is often, though not always, set to the
+ // same value as 'family'.
+ const char * getEqualityGroup() const;
+ //!cpp:function::
+ void setEqualityGroup(const char * equalityGroup);
+
+ //!cpp:function::
+ const char * getDescription() const;
+ //!cpp:function::
+ void setDescription(const char * description);
+
+ //!cpp:function::
+ BitDepth getBitDepth() const;
+ //!cpp:function::
+ void setBitDepth(BitDepth bitDepth);
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Data
+ // ^^^^
+ // ColorSpaces that are data are treated a bit special. Basically, any
+ // colorspace transforms you try to apply to them are ignored. (Think
+ // of applying a gamut mapping transform to an ID pass). Also, the
+ // :cpp:class:`DisplayTransform` process obeys special 'data min' and
+ // 'data max' args.
+ //
+ // This is traditionally used for pixel data that represents non-color
+ // pixel data, such as normals, point positions, ID information, etc.
+
+ //!cpp:function::
+ bool isData() const;
+ //!cpp:function::
+ void setIsData(bool isData);
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Allocation
+ // ^^^^^^^^^^
+ // If this colorspace needs to be transferred to a limited dynamic
+ // range coding space (such as during display with a GPU path), use this
+ // allocation to maximize bit efficiency.
+
+ //!cpp:function::
+ Allocation getAllocation() const;
+ //!cpp:function::
+ void setAllocation(Allocation allocation);
+
+ //!rst::
+ // Specify the optional variable values to configure the allocation.
+ // If no variables are specified, the defaults are used.
+ //
+ // ALLOCATION_UNIFORM::
+ //
+ // 2 vars: [min, max]
+ //
+ // ALLOCATION_LG2::
+ //
+ // 2 vars: [lg2min, lg2max]
+ // 3 vars: [lg2min, lg2max, linear_offset]
+
+ //!cpp:function::
+ int getAllocationNumVars() const;
+ //!cpp:function::
+ void getAllocationVars(float * vars) const;
+ //!cpp:function::
+ void setAllocationVars(int numvars, const float * vars);
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Transform
+ // ^^^^^^^^^
+
+ //!cpp:function::
+ // If a transform in the specified direction has been specified,
+ // return it. Otherwise return a null ConstTransformRcPtr
+ ConstTransformRcPtr getTransform(ColorSpaceDirection dir) const;
+ //!cpp:function::
+ // Specify the transform for the appropriate direction.
+ // Setting the transform to null will clear it.
+ void setTransform(const ConstTransformRcPtr & transform,
+ ColorSpaceDirection dir);
+
+ private:
+ ColorSpace();
+ ~ColorSpace();
+
+ ColorSpace(const ColorSpace &);
+ ColorSpace& operator= (const ColorSpace &);
+
+ static void deleter(ColorSpace* c);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const ColorSpace&);
+
+
+
+
+
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst:: .. _look_section:
+ //
+ // Look
+ // ****
+ // The *Look* is an 'artistic' image modification, in a specified image
+ // state.
+ // The processSpace defines the ColorSpace the image is required to be
+ // in, for the math to apply correctly.
+
+ //!cpp:class::
+ class OCIOEXPORT Look
+ {
+ public:
+ //!cpp:function::
+ static LookRcPtr Create();
+
+ //!cpp:function::
+ LookRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ const char * getName() const;
+ //!cpp:function::
+ void setName(const char * name);
+
+ //!cpp:function::
+ const char * getProcessSpace() const;
+ //!cpp:function::
+ void setProcessSpace(const char * processSpace);
+
+ //!cpp:function::
+ ConstTransformRcPtr getTransform() const;
+ //!cpp:function:: Setting a transform to a non-null call makes it allowed.
+ void setTransform(const ConstTransformRcPtr & transform);
+
+ //!cpp:function::
+ ConstTransformRcPtr getInverseTransform() const;
+ //!cpp:function:: Setting a transform to a non-null call makes it allowed.
+ void setInverseTransform(const ConstTransformRcPtr & transform);
+ private:
+ Look();
+ ~Look();
+
+ Look(const Look &);
+ Look& operator= (const Look &);
+
+ static void deleter(Look* c);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const Look&);
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Processor
+ // *********
+
+ //!cpp:class::
+ class OCIOEXPORT Processor
+ {
+ public:
+ //!cpp:function::
+ static ProcessorRcPtr Create();
+
+ //!cpp:function::
+ bool isNoOp() const;
+
+ //!cpp:function:: does the processor represent an image transformation that
+ // introduces crosstalk between the image channels
+ bool hasChannelCrosstalk() const;
+
+ //!cpp:function::
+ ConstProcessorMetadataRcPtr getMetadata() const;
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // CPU Path
+ // ^^^^^^^^
+
+ //!cpp:function:: Apply to an image.
+ void apply(ImageDesc& img) const;
+
+ //!rst::
+ // Apply to a single pixel.
+ //
+ // .. note::
+ // This is not as efficient as applying to an entire image at once.
+ // If you are processing multiple pixels, and have the flexibility,
+ // use the above function instead.
+
+ //!cpp:function::
+ void applyRGB(float * pixel) const;
+ //!cpp:function::
+ void applyRGBA(float * pixel) const;
+
+ //!cpp:function::
+ const char * getCpuCacheID() const;
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // GPU Path
+ // ^^^^^^^^
+ // Get the 3d lut + cg shader for the specified
+ // :cpp:class:`DisplayTransform`.
+ //
+ // cg signature will be::
+ //
+ // shaderFcnName(in half4 inPixel, const uniform sampler3D lut3d)
+ //
+ // lut3d should be size: 3 * edgeLen * edgeLen * edgeLen
+ // return 0 if unknown
+
+ //!cpp:function::
+ const char * getGpuShaderText(const GpuShaderDesc & shaderDesc) const;
+ //!cpp:function::
+ const char * getGpuShaderTextCacheID(const GpuShaderDesc & shaderDesc) const;
+
+ //!cpp:function::
+ void getGpuLut3D(float* lut3d, const GpuShaderDesc & shaderDesc) const;
+ //!cpp:function::
+ const char * getGpuLut3DCacheID(const GpuShaderDesc & shaderDesc) const;
+
+ private:
+ Processor();
+ ~Processor();
+
+ Processor(const Processor &);
+ Processor& operator= (const Processor &);
+
+ static void deleter(Processor* c);
+
+ friend class Config;
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+
+ //!cpp:class::
+ // This class contains meta information about the process that generated
+ // this processor. The results of these functions do not
+ // impact the pixel processing.
+
+ class OCIOEXPORT ProcessorMetadata
+ {
+ public:
+ //!cpp:function::
+ static ProcessorMetadataRcPtr Create();
+
+ //!cpp:function::
+ int getNumFiles() const;
+ //!cpp:function::
+ const char * getFile(int index) const;
+
+ //!cpp:function::
+ int getNumLooks() const;
+ //!cpp:function::
+ const char * getLook(int index) const;
+
+ //!cpp:function::
+ void addFile(const char * fname);
+ //!cpp:function::
+ void addLook(const char * look);
+ private:
+ ProcessorMetadata();
+ ~ProcessorMetadata();
+ ProcessorMetadata(const ProcessorMetadata &);
+ ProcessorMetadata& operator= (const ProcessorMetadata &);
+
+ static void deleter(ProcessorMetadata* c);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Baker
+ // *****
+ //
+ // In certain situations it is nessary to serilize transforms into a variety
+ // of application specific lut formats. The Baker can be used to create lut
+ // formats that ocio supports for writing.
+ //
+ // **Usage Example:** *Bake a houdini sRGB viewer lut*
+ //
+ // .. code-block:: cpp
+ //
+ // OCIO::ConstConfigRcPtr config = OCIO::Config::CreateFromEnv();
+ // OCIO::BakerRcPtr baker = OCIO::Baker::Create();
+ // baker->setConfig(config);
+ // baker->setFormat("houdini"); // set the houdini type
+ // baker->setType("3D"); // we want a 3D lut
+ // baker->setInputSpace("lnf");
+ // baker->setShaperSpace("log");
+ // baker->setTargetSpace("sRGB");
+ // std::ostringstream out;
+ // baker->bake(out); // fresh bread anyone!
+ // std::cout << out.str();
+
+ class OCIOEXPORT Baker
+ {
+ public:
+ //!cpp:function:: create a new Baker
+ static BakerRcPtr Create();
+
+ //!cpp:function:: create a copy of this Baker
+ BakerRcPtr createEditableCopy() const;
+
+ //!cpp:function:: set the config to use
+ void setConfig(const ConstConfigRcPtr & config);
+ //!cpp:function:: get the config to use
+ ConstConfigRcPtr getConfig() const;
+
+ //!cpp:function:: set the lut output format
+ void setFormat(const char * formatName);
+ //!cpp:function:: get the lut output format
+ const char * getFormat() const;
+
+ // TODO: Change this to an enum
+ //!cpp:function:: set the lut output type (1D or 3D)
+ void setType(const char * type);
+ //!cpp:function:: get the lut output type
+ const char * getType() const;
+
+ //!cpp:function:: set *optional* meta data for luts that support it
+ void setMetadata(const char * metadata);
+ //!cpp:function:: get the meta data that has been set
+ const char * getMetadata() const;
+
+ //!cpp:function:: set the input ColorSpace that the lut will be
+ // applied to
+ void setInputSpace(const char * inputSpace);
+ //!cpp:function:: get the input ColorSpace that has been set
+ const char * getInputSpace() const;
+
+ //!cpp:function:: set an *optional* ColorSpace to be used to shape /
+ // transfer the input colorspace. This is mostly used to allocate
+ // an HDR luminance range into an LDR one. If a shaper space
+ // is not explicitly specified, and the file format supports one,
+ // the ColorSpace Allocation will be used
+
+ void setShaperSpace(const char * shaperSpace);
+ //!cpp:function:: get the shaper colorspace that has been set
+ const char * getShaperSpace() const;
+
+ //!cpp:function:: set the looks to be applied during baking
+ // Looks is a potentially comma (or colon) delimited list of lookNames,
+ // Where +/- prefixes are optionally allowed to denote forward/inverse
+ // look specification. (And forward is assumed in the absense of either)
+ void setLooks(const char * looks);
+ //!cpp:function:: get the looks to be applied during baking
+ const char * getLooks() const;
+
+ //!cpp:function:: set the target device colorspace for the lut
+ void setTargetSpace(const char * targetSpace);
+ //!cpp:function:: get the target colorspace that has been set
+ const char * getTargetSpace() const;
+
+ //!cpp:function:: override the default the shaper sample size,
+ // default: <format specific>
+ void setShaperSize(int shapersize);
+ //!cpp:function:: get the shaper sample size
+ int getShaperSize() const;
+
+ //!cpp:function:: override the default cube sample size
+ // default: <format specific>
+ void setCubeSize(int cubesize);
+ //!cpp:function:: get the cube sample size
+ int getCubeSize() const;
+
+ //!cpp:function:: bake the lut into the output stream
+ void bake(std::ostream & os) const;
+
+ //!cpp:function:: get the number of lut writers
+ static int getNumFormats();
+
+ //!cpp:function:: get the lut writer at index, return empty string if
+ // an invalid index is specified
+ static const char * getFormatNameByIndex(int index);
+ static const char * getFormatExtensionByIndex(int index);
+
+ private:
+ Baker();
+ ~Baker();
+
+ Baker(const Baker &);
+ Baker& operator= (const Baker &);
+
+ static void deleter(Baker* o);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // ImageDesc
+ // *********
+
+ //!rst::
+ // .. c:var:: const ptrdiff_t AutoStride
+ //
+ // AutoStride
+ const ptrdiff_t AutoStride = std::numeric_limits<ptrdiff_t>::min();
+
+ //!cpp:class::
+ // This is a light-weight wrapper around an image, that provides a context
+ // for pixel access. This does NOT claim ownership of the pixels or copy
+ // image data
+
+ class OCIOEXPORT ImageDesc
+ {
+ public:
+ //!cpp:function::
+ virtual ~ImageDesc();
+ private:
+ ImageDesc& operator= (const ImageDesc &);
+ };
+
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const ImageDesc&);
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // PackedImageDesc
+ // ^^^^^^^^^^^^^^^
+
+ //!cpp:class::
+ class OCIOEXPORT PackedImageDesc : public ImageDesc
+ {
+ public:
+ //!cpp:function::
+ // Pass the pointer to packed image data: rgbrgbrgb, etc.
+ // The number of channels must be greater than or equal to 3
+ // If a 4th channel is specified, it is assumed to be alpha
+ // information. Channels > 4 will be ignored.
+
+ PackedImageDesc(float * data,
+ long width, long height,
+ long numChannels,
+ ptrdiff_t chanStrideBytes = AutoStride,
+ ptrdiff_t xStrideBytes = AutoStride,
+ ptrdiff_t yStrideBytes = AutoStride);
+ //!cpp:function::
+ virtual ~PackedImageDesc();
+
+ //!cpp:function::
+ float * getData() const;
+
+ //!cpp:function::
+ long getWidth() const;
+ //!cpp:function::
+ long getHeight() const;
+ //!cpp:function::
+ long getNumChannels() const;
+
+ //!cpp:function::
+ ptrdiff_t getChanStrideBytes() const;
+ //!cpp:function::
+ ptrdiff_t getXStrideBytes() const;
+ //!cpp:function::
+ ptrdiff_t getYStrideBytes() const;
+
+ private:
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+
+ PackedImageDesc(const PackedImageDesc &);
+ PackedImageDesc& operator= (const PackedImageDesc &);
+ };
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // PlanarImageDesc
+ // ^^^^^^^^^^^^^^^
+
+ //!cpp:class::
+ class OCIOEXPORT PlanarImageDesc : public ImageDesc
+ {
+ public:
+ //!cpp:function::
+ // Pass the pointer to the specified image planes: rrrr gggg bbbb, etc.
+ // aData is optional, pass NULL if no alpha exists.
+ // {r,g,b} Data must be specified
+
+ PlanarImageDesc(float * rData, float * gData, float * bData, float * aData,
+ long width, long height,
+ ptrdiff_t yStrideBytes = AutoStride);
+ //!cpp:function::
+ virtual ~PlanarImageDesc();
+
+ //!cpp:function::
+ float* getRData() const;
+ //!cpp:function::
+ float* getGData() const;
+ //!cpp:function::
+ float* getBData() const;
+ //!cpp:function::
+ float* getAData() const;
+
+ //!cpp:function::
+ long getWidth() const;
+ //!cpp:function::
+ long getHeight() const;
+
+ //!cpp:function::
+ ptrdiff_t getYStrideBytes() const;
+
+ private:
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+
+ PlanarImageDesc(const PlanarImageDesc &);
+ PlanarImageDesc& operator= (const PlanarImageDesc &);
+ };
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // GpuShaderDesc
+ // *************
+
+ //!cpp:class::
+ class OCIOEXPORT GpuShaderDesc
+ {
+ public:
+ //!cpp:function::
+ GpuShaderDesc();
+ //!cpp:function::
+ ~GpuShaderDesc();
+
+ //!cpp:function::
+ void setLanguage(GpuLanguage lang);
+ //!cpp:function::
+ GpuLanguage getLanguage() const;
+
+ //!cpp:function::
+ void setFunctionName(const char * name);
+ //!cpp:function::
+ const char * getFunctionName() const;
+
+ //!cpp:function::
+ void setLut3DEdgeLen(int len);
+ //!cpp:function::
+ int getLut3DEdgeLen() const;
+
+ //!cpp:function::
+ const char * getCacheID() const;
+
+ private:
+
+ GpuShaderDesc(const GpuShaderDesc &);
+ GpuShaderDesc& operator= (const GpuShaderDesc &);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //!rst::
+ // Context
+ // *******
+
+ //!cpp:class::
+ class OCIOEXPORT Context
+ {
+ public:
+ //!cpp:function::
+ static ContextRcPtr Create();
+
+ //!cpp:function::
+ ContextRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ const char * getCacheID() const;
+
+ //!cpp:function::
+ void setSearchPath(const char * path);
+ //!cpp:function::
+ const char * getSearchPath() const;
+
+ //!cpp:function::
+ void setWorkingDir(const char * dirname);
+ //!cpp:function::
+ const char * getWorkingDir() const;
+
+ //!cpp:function::
+ void setStringVar(const char * name, const char * value);
+ //!cpp:function::
+ const char * getStringVar(const char * name) const;
+
+ int getNumStringVars() const;
+ const char * getStringVarNameByIndex(int index) const;
+
+ //!cpp:function:: Seed all string vars with the current environment.
+ void loadEnvironment();
+
+ //! Do a string lookup.
+ //!cpp:function:: Do a file lookup.
+ //
+ // Evaluate the specified variable (as needed). Will not throw exceptions.
+ const char * resolveStringVar(const char * val) const;
+
+ //! Do a file lookup.
+ //!cpp:function:: Do a file lookup.
+ //
+ // Evaluate all variables (as needed).
+ // Also, walk the full search path until the file is found.
+ // If the filename cannot be found, an exception will be thrown.
+ const char * resolveFileLocation(const char * filename) const;
+
+ private:
+ Context();
+ ~Context();
+
+ Context(const Context &);
+ Context& operator= (const Context &);
+
+ static void deleter(Context* c);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const Context&);
+}
+OCIO_NAMESPACE_EXIT
+
+#endif // INCLUDED_OCIO_OPENCOLORIO_H
diff --git a/export/OpenColorIO/OpenColorTransforms.h b/export/OpenColorIO/OpenColorTransforms.h
new file mode 100644
index 0000000..c987179
--- /dev/null
+++ b/export/OpenColorIO/OpenColorTransforms.h
@@ -0,0 +1,812 @@
+/*
+Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#ifndef INCLUDED_OCIO_OPENCOLORTRANSFORMS_H
+#define INCLUDED_OCIO_OPENCOLORTRANSFORMS_H
+
+#include "OpenColorTypes.h"
+
+#ifndef OCIO_NAMESPACE_ENTER
+#error This header cannot be used directly. Use <OpenColorIO/OpenColorIO.h> instead.
+#endif
+
+/*!rst::
+C++ Transforms
+==============
+
+Typically only needed when creating and/or manipulating configurations
+*/
+
+OCIO_NAMESPACE_ENTER
+{
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class::
+ class OCIOEXPORT Transform
+ {
+ public:
+ virtual ~Transform();
+ virtual TransformRcPtr createEditableCopy() const = 0;
+
+ virtual TransformDirection getDirection() const = 0;
+ virtual void setDirection(TransformDirection dir) = 0;
+
+ private:
+ Transform& operator= (const Transform &);
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const Transform&);
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class:: Forward direction wraps the 'expanded' range into the
+ // specified, often compressed, range.
+ class OCIOEXPORT AllocationTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static AllocationTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ Allocation getAllocation() const;
+ //!cpp:function::
+ void setAllocation(Allocation allocation);
+
+ //!cpp:function::
+ int getNumVars() const;
+ //!cpp:function::
+ void getVars(float * vars) const;
+ //!cpp:function::
+ void setVars(int numvars, const float * vars);
+
+ private:
+ AllocationTransform();
+ AllocationTransform(const AllocationTransform &);
+ virtual ~AllocationTransform();
+
+ AllocationTransform& operator= (const AllocationTransform &);
+
+ static void deleter(AllocationTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const AllocationTransform&);
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class:: An implementation of the ASC CDL Transfer Functions and
+ // Interchange - Syntax (Based on the version 1.2 document)
+ //
+ // .. note::
+ // the clamping portion of the CDL is only applied if a non-identity
+ // power is specified.
+ class OCIOEXPORT CDLTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static CDLTransformRcPtr Create();
+
+ //!cpp:function::
+ // Load the CDL from the src .cc or .ccc file.
+ // If a .ccc is used, the cccid must also be specified
+ // src must be an absolute path reference, no relative directory
+ // or envvar resolution is performed.
+ static CDLTransformRcPtr CreateFromFile(const char * src, const char * cccid);
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ bool equals(const ConstCDLTransformRcPtr & other) const;
+
+ //!cpp:function::
+ const char * getXML() const;
+ //!cpp:function::
+ void setXML(const char * xml);
+
+ //!rst:: **ASC_SOP**
+ //
+ // Slope, offset, power::
+ //
+ // out = clamp( (in * slope) + offset ) ^ power
+
+ //!cpp:function::
+ void setSlope(const float * rgb);
+ //!cpp:function::
+ void getSlope(float * rgb) const;
+
+ //!cpp:function::
+ void setOffset(const float * rgb);
+ //!cpp:function::
+ void getOffset(float * rgb) const;
+
+ //!cpp:function::
+ void setPower(const float * rgb);
+ //!cpp:function::
+ void getPower(float * rgb) const;
+
+ //!cpp:function::
+ void setSOP(const float * vec9);
+ //!cpp:function::
+ void getSOP(float * vec9) const;
+
+ //!rst:: **ASC_SAT**
+
+ //!cpp:function::
+ void setSat(float sat);
+ //!cpp:function::
+ float getSat() const;
+
+ //!cpp:function:: These are hard-coded, by spec, to r709
+ void getSatLumaCoefs(float * rgb) const;
+
+ //!rst:: **Metadata**
+ //
+ // These do not affect the image processing, but
+ // are often useful for pipeline purposes and are
+ // included in the serialization.
+
+ //!cpp:function:: Unique Identifier for this correction
+ void setID(const char * id);
+ //!cpp:function::
+ const char * getID() const;
+
+ //!cpp:function:: Textual description of color correction
+ // (stored on the SOP)
+ void setDescription(const char * desc);
+ //!cpp:function::
+ const char * getDescription() const;
+
+ private:
+ CDLTransform();
+ CDLTransform(const CDLTransform &);
+ virtual ~CDLTransform();
+
+ CDLTransform& operator= (const CDLTransform &);
+
+ static void deleter(CDLTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const CDLTransform&);
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class::
+ class OCIOEXPORT ColorSpaceTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static ColorSpaceTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ const char * getSrc() const;
+ //!cpp:function::
+ void setSrc(const char * src);
+
+ //!cpp:function::
+ const char * getDst() const;
+ //!cpp:function::
+ void setDst(const char * dst);
+
+ private:
+ ColorSpaceTransform();
+ ColorSpaceTransform(const ColorSpaceTransform &);
+ virtual ~ColorSpaceTransform();
+
+ ColorSpaceTransform& operator= (const ColorSpaceTransform &);
+
+ static void deleter(ColorSpaceTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const ColorSpaceTransform&);
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class::
+ class OCIOEXPORT DisplayTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static DisplayTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+
+
+
+ //!cpp:function:: Step 0. Specify the incoming color space
+ void setInputColorSpaceName(const char * name);
+ //!cpp:function::
+ const char * getInputColorSpaceName() const;
+
+ //!cpp:function:: Step 1: Apply a Color Correction, in ROLE_SCENE_LINEAR
+ void setLinearCC(const ConstTransformRcPtr & cc);
+ //!cpp:function::
+ ConstTransformRcPtr getLinearCC() const;
+
+ //!cpp:function:: Step 2: Apply a color correction, in ROLE_COLOR_TIMING
+ void setColorTimingCC(const ConstTransformRcPtr & cc);
+ //!cpp:function::
+ ConstTransformRcPtr getColorTimingCC() const;
+
+ //!cpp:function:: Step 3: Apply the Channel Viewing Swizzle (mtx)
+ void setChannelView(const ConstTransformRcPtr & transform);
+ //!cpp:function::
+ ConstTransformRcPtr getChannelView() const;
+
+ //!cpp:function:: Step 4: Apply the output display transform
+ // This is controlled by the specification of (display, view)
+ void setDisplay(const char * display);
+ //!cpp:function::
+ const char * getDisplay() const;
+
+ //!cpp:function::Specify which view transform to use
+ void setView(const char * view);
+ //!cpp:function::
+ const char * getView() const;
+
+ //!cpp:function:: Step 5: Apply a post display transform color correction
+ void setDisplayCC(const ConstTransformRcPtr & cc);
+ //!cpp:function::
+ ConstTransformRcPtr getDisplayCC() const;
+
+
+
+ //!cpp:function:: A user can optionally override the looks that are,
+ // by default, used with the expected display / view combination.
+ // A common use case for this functionality is in an image viewing
+ // app, where per-shot looks are supported. If for some reason
+ // a per-shot look is not defined for the current Context, the
+ // Config::getProcessor fcn will not succeed by default. Thus,
+ // with this mechanism the viewing app could override to looks = "",
+ // and this will allow image display to continue (though hopefully)
+ // the interface would reflect this fallback option.)
+ //
+ // Looks is a potentially comma (or colon) delimited list of lookNames,
+ // Where +/- prefixes are optionally allowed to denote forward/inverse
+ // look specification. (And forward is assumed in the absense of either)
+
+ void setLooksOverride(const char * looks);
+ //!cpp:function::
+ const char * getLooksOverride() const;
+
+ //!cpp:function:: Specifiy whether the lookOverride should be used,
+ // or not. This is a speparate flag, as it's often useful to override
+ // "looks" to an empty string
+ void setLooksOverrideEnabled(bool enabled);
+ //!cpp:function::
+ bool getLooksOverrideEnabled() const;
+
+ private:
+ DisplayTransform();
+ DisplayTransform(const DisplayTransform &);
+ virtual ~DisplayTransform();
+
+ DisplayTransform& operator= (const DisplayTransform &);
+
+ static void deleter(DisplayTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const DisplayTransform&);
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class:: Represents exponent transform: pow( clamp(color), value)
+ //
+ // If the exponent is 1.0, this will not clamp. Otherwise, the input color
+ // will be clamped between [0.0, inf]
+ class OCIOEXPORT ExponentTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static ExponentTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ void setValue(const float * vec4);
+ //!cpp:function::
+ void getValue(float * vec4) const;
+
+ private:
+ ExponentTransform();
+ ExponentTransform(const ExponentTransform &);
+ virtual ~ExponentTransform();
+
+ ExponentTransform& operator= (const ExponentTransform &);
+
+ static void deleter(ExponentTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const ExponentTransform&);
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class::
+ class OCIOEXPORT FileTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static FileTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ const char * getSrc() const;
+ //!cpp:function::
+ void setSrc(const char * src);
+
+ //!cpp:function::
+ const char * getCCCId() const;
+ //!cpp:function::
+ void setCCCId(const char * id);
+
+ //!cpp:function::
+ Interpolation getInterpolation() const;
+ //!cpp:function::
+ void setInterpolation(Interpolation interp);
+
+ //!cpp:function:: get the number of lut readers
+ static int getNumFormats();
+ //!cpp:function:: get the lut readers at index, return empty string if
+ // an invalid index is specified
+ static const char * getFormatNameByIndex(int index);
+
+ //!cpp:function:: get the lut reader extension at index, return empty string if
+ // an invalid index is specified
+ static const char * getFormatExtensionByIndex(int index);
+
+ private:
+ FileTransform();
+ FileTransform(const FileTransform &);
+ virtual ~FileTransform();
+
+ FileTransform& operator= (const FileTransform &);
+
+ static void deleter(FileTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const FileTransform&);
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class::
+ class OCIOEXPORT GroupTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static GroupTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ ConstTransformRcPtr getTransform(int index) const;
+
+ //!cpp:function::
+ int size() const;
+ //!cpp:function::
+ void push_back(const ConstTransformRcPtr& transform);
+ //!cpp:function::
+ void clear();
+ //!cpp:function::
+ bool empty() const;
+
+ private:
+ GroupTransform();
+ GroupTransform(const GroupTransform &);
+ virtual ~GroupTransform();
+
+ GroupTransform& operator= (const GroupTransform &);
+
+ static void deleter(GroupTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const GroupTransform&);
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class:: Represents log transform: log(color, base)
+ //
+ // * The input will be clamped for negative numbers.
+ // * Default base is 2.0
+ // * Only the rgb channels are affected
+ class OCIOEXPORT LogTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static LogTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ void setBase(float val);
+ //!cpp:function::
+ float getBase() const;
+
+ private:
+ LogTransform();
+ LogTransform(const LogTransform &);
+ virtual ~LogTransform();
+
+ LogTransform& operator= (const LogTransform &);
+
+ static void deleter(LogTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const LogTransform&);
+
+
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class::
+ class OCIOEXPORT LookTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static LookTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ const char * getSrc() const;
+ //!cpp:function::
+ void setSrc(const char * src);
+
+ //!cpp:function::
+ const char * getDst() const;
+ //!cpp:function::
+ void setDst(const char * dst);
+
+ //!cpp:function:: Specify looks to apply.
+ // Looks is a potentially comma (or colon) delimited list of look names,
+ // Where +/- prefixes are optionally allowed to denote forward/inverse
+ // look specification. (And forward is assumed in the absense of either)
+ void setLooks(const char * looks);
+ //!cpp:function::
+ const char * getLooks() const;
+
+ private:
+ LookTransform();
+ LookTransform(const LookTransform &);
+ virtual ~LookTransform();
+
+ LookTransform& operator= (const LookTransform &);
+
+ static void deleter(LookTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const LookTransform&);
+
+
+
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class:: Represents an MX+B Matrix transform
+ class OCIOEXPORT MatrixTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static MatrixTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ bool equals(const MatrixTransform & other) const;
+
+ //!cpp:function::
+ void setValue(const float * m44, const float * offset4);
+ //!cpp:function::
+ void getValue(float * m44, float * offset4) const;
+
+ //!cpp:function::
+ void setMatrix(const float * m44);
+ //!cpp:function::
+ void getMatrix(float * m44) const;
+
+ //!cpp:function::
+ void setOffset(const float * offset4);
+ //!cpp:function::
+ void getOffset(float * offset4) const;
+
+ //!rst:: **Convenience functions**
+ //
+ // to get the mtx and offset corresponding to higher-level concepts
+ //
+ // .. note::
+ // These can throw an exception if for any component
+ // ``oldmin == oldmax. (divide by 0)``
+
+ //!cpp:function::
+ static void Fit(float * m44, float * offset4,
+ const float * oldmin4, const float * oldmax4,
+ const float * newmin4, const float * newmax4);
+
+ //!cpp:function::
+ static void Identity(float * m44, float * offset4);
+
+ //!cpp:function::
+ static void Sat(float * m44, float * offset4,
+ float sat, const float * lumaCoef3);
+
+ //!cpp:function::
+ static void Scale(float * m44, float * offset4,
+ const float * scale4);
+
+ //!cpp:function::
+ static void View(float * m44, float * offset4,
+ int * channelHot4,
+ const float * lumaCoef3);
+
+ private:
+ MatrixTransform();
+ MatrixTransform(const MatrixTransform &);
+ virtual ~MatrixTransform();
+
+ MatrixTransform& operator= (const MatrixTransform &);
+
+ static void deleter(MatrixTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const MatrixTransform&);
+
+ //!rst:: //////////////////////////////////////////////////////////////////
+
+ //!cpp:class:: Truelight transform using its API
+ class OCIOEXPORT TruelightTransform : public Transform
+ {
+ public:
+ //!cpp:function::
+ static TruelightTransformRcPtr Create();
+
+ //!cpp:function::
+ virtual TransformRcPtr createEditableCopy() const;
+
+ //!cpp:function::
+ virtual TransformDirection getDirection() const;
+ //!cpp:function::
+ virtual void setDirection(TransformDirection dir);
+
+ //!cpp:function::
+ void setConfigRoot(const char * configroot);
+ //!cpp:function::
+ const char * getConfigRoot() const;
+
+ //!cpp:function::
+ void setProfile(const char * profile);
+ //!cpp:function::
+ const char * getProfile() const;
+
+ //!cpp:function::
+ void setCamera(const char * camera);
+ //!cpp:function::
+ const char * getCamera() const;
+
+ //!cpp:function::
+ void setInputDisplay(const char * display);
+ //!cpp:function::
+ const char * getInputDisplay() const;
+
+ //!cpp:function::
+ void setRecorder(const char * recorder);
+ //!cpp:function::
+ const char * getRecorder() const;
+
+ //!cpp:function::
+ void setPrint(const char * print);
+ //!cpp:function::
+ const char * getPrint() const;
+
+ //!cpp:function::
+ void setLamp(const char * lamp);
+ //!cpp:function::
+ const char * getLamp() const;
+
+ //!cpp:function::
+ void setOutputCamera(const char * camera);
+ //!cpp:function::
+ const char * getOutputCamera() const;
+
+ //!cpp:function::
+ void setDisplay(const char * display);
+ //!cpp:function::
+ const char * getDisplay() const;
+
+ //!cpp:function::
+ void setCubeInput(const char * type);
+ //!cpp:function::
+ const char * getCubeInput() const;
+
+ private:
+ TruelightTransform();
+ TruelightTransform(const TruelightTransform &);
+ virtual ~TruelightTransform();
+
+ TruelightTransform& operator= (const TruelightTransform &);
+
+ static void deleter(TruelightTransform* t);
+
+ class Impl;
+ friend class Impl;
+ Impl * m_impl;
+ Impl * getImpl() { return m_impl; }
+ const Impl * getImpl() const { return m_impl; }
+ };
+
+ //!cpp:function::
+ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const TruelightTransform &);
+
+}
+OCIO_NAMESPACE_EXIT
+
+#endif
diff --git a/export/OpenColorIO/OpenColorTypes.h b/export/OpenColorIO/OpenColorTypes.h
new file mode 100644
index 0000000..1d2bddb
--- /dev/null
+++ b/export/OpenColorIO/OpenColorTypes.h
@@ -0,0 +1,397 @@
+/*
+Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#ifndef INCLUDED_OCIO_OPENCOLORTYPES_H
+#define INCLUDED_OCIO_OPENCOLORTYPES_H
+
+#include "OpenColorABI.h"
+
+#ifndef OCIO_NAMESPACE_ENTER
+#error This header cannot be used directly. Use <OpenColorIO/OpenColorIO.h> instead.
+#endif
+
+#include <limits>
+#include <string>
+
+/*!rst::
+C++ Types
+=========
+*/
+
+OCIO_NAMESPACE_ENTER
+{
+ // Predeclare all class ptr definitions
+
+ //!rst::
+ // Core
+ // ****
+
+ class OCIOEXPORT Config;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const Config> ConstConfigRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<Config> ConfigRcPtr;
+
+ class OCIOEXPORT ColorSpace;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const ColorSpace> ConstColorSpaceRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<ColorSpace> ColorSpaceRcPtr;
+
+ class OCIOEXPORT Look;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const Look> ConstLookRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<Look> LookRcPtr;
+
+ class OCIOEXPORT Context;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const Context> ConstContextRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<Context> ContextRcPtr;
+
+ class OCIOEXPORT Processor;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const Processor> ConstProcessorRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<Processor> ProcessorRcPtr;
+
+ class OCIOEXPORT ProcessorMetadata;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const ProcessorMetadata> ConstProcessorMetadataRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<ProcessorMetadata> ProcessorMetadataRcPtr;
+
+ class OCIOEXPORT Baker;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const Baker> ConstBakerRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<Baker> BakerRcPtr;
+
+ class OCIOEXPORT ImageDesc;
+ class OCIOEXPORT GpuShaderDesc;
+ class OCIOEXPORT Exception;
+
+
+ //!rst::
+ // Transforms
+ // **********
+
+ class OCIOEXPORT Transform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const Transform> ConstTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<Transform> TransformRcPtr;
+
+ class OCIOEXPORT AllocationTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const AllocationTransform> ConstAllocationTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<AllocationTransform> AllocationTransformRcPtr;
+
+ class OCIOEXPORT CDLTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const CDLTransform> ConstCDLTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<CDLTransform> CDLTransformRcPtr;
+
+ class OCIOEXPORT ColorSpaceTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const ColorSpaceTransform> ConstColorSpaceTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<ColorSpaceTransform> ColorSpaceTransformRcPtr;
+
+ class OCIOEXPORT DisplayTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const DisplayTransform> ConstDisplayTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<DisplayTransform> DisplayTransformRcPtr;
+
+ class OCIOEXPORT ExponentTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const ExponentTransform> ConstExponentTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<ExponentTransform> ExponentTransformRcPtr;
+
+ class OCIOEXPORT FileTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const FileTransform> ConstFileTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<FileTransform> FileTransformRcPtr;
+
+ class OCIOEXPORT GroupTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const GroupTransform> ConstGroupTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<GroupTransform> GroupTransformRcPtr;
+
+ class OCIOEXPORT LogTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const LogTransform> ConstLogTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<LogTransform> LogTransformRcPtr;
+
+ class OCIOEXPORT LookTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const LookTransform> ConstLookTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<LookTransform> LookTransformRcPtr;
+
+ class OCIOEXPORT MatrixTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const MatrixTransform> ConstMatrixTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<MatrixTransform> MatrixTransformRcPtr;
+
+ class OCIOEXPORT TruelightTransform;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<const TruelightTransform> ConstTruelightTransformRcPtr;
+ //!cpp:type::
+ typedef OCIO_SHARED_PTR<TruelightTransform> TruelightTransformRcPtr;
+
+ template <class T, class U>
+ inline OCIO_SHARED_PTR<T> DynamicPtrCast(OCIO_SHARED_PTR<U> const & ptr)
+ {
+ return OCIO_DYNAMIC_POINTER_CAST<T,U>(ptr);
+ }
+
+
+ //!rst::
+ // Enums
+ // *****
+
+ enum LoggingLevel
+ {
+ LOGGING_LEVEL_NONE = 0,
+ LOGGING_LEVEL_WARNING = 1,
+ LOGGING_LEVEL_INFO = 2,
+ LOGGING_LEVEL_DEBUG = 3,
+ LOGGING_LEVEL_UNKNOWN = 255
+ };
+
+ //!cpp:type::
+ enum ColorSpaceDirection
+ {
+ COLORSPACE_DIR_UNKNOWN = 0,
+ COLORSPACE_DIR_TO_REFERENCE,
+ COLORSPACE_DIR_FROM_REFERENCE
+ };
+
+ //!cpp:type::
+ enum TransformDirection
+ {
+ TRANSFORM_DIR_UNKNOWN = 0,
+ TRANSFORM_DIR_FORWARD,
+ TRANSFORM_DIR_INVERSE
+ };
+
+ //!cpp:type::
+ //
+ // Specify the interpolation type to use
+ // If the specified interpolation type is not supported in the requested
+ // context (for example, using tetrahedral interpolationon 1D luts)
+ // an exception will be throw.
+ //
+ // INTERP_BEST will choose the best interpolation type for the requested
+ // context:
+ //
+ // Lut1D INTERP_BEST: LINEAR
+ // Lut3D INTERP_BEST: LINEAR
+ //
+ // Note: INTERP_BEST is subject to change in minor releases, so if you
+ // care about locking off on a specific interpolation type, we'd recommend
+ // directly specifying it.
+
+ enum Interpolation
+ {
+ INTERP_UNKNOWN = 0,
+ INTERP_NEAREST = 1, //! nearest neighbor in all dimensions
+ INTERP_LINEAR = 2, //! linear interpolation in all dimensions
+ INTERP_TETRAHEDRAL = 3, //! tetrahedral interpolation in all directions
+ INTERP_BEST = 255 //! the 'best' suitable interpolation type
+ };
+
+ //!cpp:type::
+ enum BitDepth {
+ BIT_DEPTH_UNKNOWN = 0,
+ BIT_DEPTH_UINT8,
+ BIT_DEPTH_UINT10,
+ BIT_DEPTH_UINT12,
+ BIT_DEPTH_UINT14,
+ BIT_DEPTH_UINT16,
+ BIT_DEPTH_UINT32,
+ BIT_DEPTH_F16,
+ BIT_DEPTH_F32
+ };
+
+ //!cpp:type::
+ enum Allocation {
+ ALLOCATION_UNKNOWN = 0,
+ ALLOCATION_UNIFORM,
+ ALLOCATION_LG2
+ };
+
+ //!cpp:type:: Used when there is a choice of hardware shader language.
+ enum GpuLanguage
+ {
+ GPU_LANGUAGE_UNKNOWN = 0,
+ GPU_LANGUAGE_CG, ///< Nvidia Cg shader
+ GPU_LANGUAGE_GLSL_1_0, ///< OpenGL Shading Language
+ GPU_LANGUAGE_GLSL_1_3 ///< OpenGL Shading Language
+ };
+
+
+ //!rst::
+ // Conversion
+ // **********
+
+ //!cpp:function::
+ extern OCIOEXPORT const char * BoolToString(bool val);
+ //!cpp:function::
+ extern OCIOEXPORT bool BoolFromString(const char * s);
+
+ //!cpp:function::
+ extern OCIOEXPORT const char * LoggingLevelToString(LoggingLevel level);
+ //!cpp:function::
+ extern OCIOEXPORT LoggingLevel LoggingLevelFromString(const char * s);
+
+ //!cpp:function::
+ extern OCIOEXPORT const char * TransformDirectionToString(TransformDirection dir);
+ //!cpp:function::
+ extern OCIOEXPORT TransformDirection TransformDirectionFromString(const char * s);
+
+ //!cpp:function::
+ extern OCIOEXPORT TransformDirection GetInverseTransformDirection(TransformDirection dir);
+ //!cpp:function::
+ extern OCIOEXPORT TransformDirection CombineTransformDirections(TransformDirection d1,
+ TransformDirection d2);
+
+ //!cpp:function::
+ extern OCIOEXPORT const char * ColorSpaceDirectionToString(ColorSpaceDirection dir);
+ //!cpp:function::
+ extern OCIOEXPORT ColorSpaceDirection ColorSpaceDirectionFromString(const char * s);
+
+ //!cpp:function::
+ extern OCIOEXPORT const char * BitDepthToString(BitDepth bitDepth);
+ //!cpp:function::
+ extern OCIOEXPORT BitDepth BitDepthFromString(const char * s);
+ //!cpp:function::
+ extern OCIOEXPORT bool BitDepthIsFloat(BitDepth bitDepth);
+ //!cpp:function::
+ extern OCIOEXPORT int BitDepthToInt(BitDepth bitDepth);
+
+ //!cpp:function::
+ extern OCIOEXPORT const char * AllocationToString(Allocation allocation);
+ //!cpp:function::
+ extern OCIOEXPORT Allocation AllocationFromString(const char * s);
+
+ //!cpp:function::
+ extern OCIOEXPORT const char * InterpolationToString(Interpolation interp);
+ //!cpp:function::
+ extern OCIOEXPORT Interpolation InterpolationFromString(const char * s);
+
+ //!cpp:function::
+ extern OCIOEXPORT const char * GpuLanguageToString(GpuLanguage language);
+ //!cpp:function::
+ extern OCIOEXPORT GpuLanguage GpuLanguageFromString(const char * s);
+
+
+ /*!rst::
+ Roles
+ *****
+
+ ColorSpace Roles are used so that plugins, in addition to this API can have
+ abstract ways of asking for common colorspaces, without referring to them
+ by hardcoded names.
+
+ Internal::
+
+ GetGPUDisplayTransform - (ROLE_SCENE_LINEAR (fstop exposure))
+ (ROLE_COLOR_TIMING (ASCColorCorrection))
+
+ External Plugins (currently known)::
+
+ Colorpicker UIs - (ROLE_COLOR_PICKING)
+ Compositor LogConvert - (ROLE_SCENE_LINEAR, ROLE_COMPOSITING_LOG)
+
+ */
+
+ //!rst::
+ // .. c:var:: const char* ROLE_DEFAULT
+ //
+ // "default"
+ extern OCIOEXPORT const char * ROLE_DEFAULT;
+ //!rst::
+ // .. c:var:: const char* ROLE_REFERENCE
+ //
+ // "reference"
+ extern OCIOEXPORT const char * ROLE_REFERENCE;
+ //!rst::
+ // .. c:var:: const char* ROLE_DATA
+ //
+ // "data"
+ extern OCIOEXPORT const char * ROLE_DATA;
+ //!rst::
+ // .. c:var:: const char* ROLE_COLOR_PICKING
+ //
+ // "color_picking"
+ extern OCIOEXPORT const char * ROLE_COLOR_PICKING;
+ //!rst::
+ // .. c:var:: const char* ROLE_SCENE_LINEAR
+ //
+ // "scene_linear"
+ extern OCIOEXPORT const char * ROLE_SCENE_LINEAR;
+ //!rst::
+ // .. c:var:: const char* ROLE_COMPOSITING_LOG
+ //
+ // "compositing_log"
+ extern OCIOEXPORT const char * ROLE_COMPOSITING_LOG;
+ //!rst::
+ // .. c:var:: const char* ROLE_COLOR_TIMING
+ //
+ // "color_timing"
+ extern OCIOEXPORT const char * ROLE_COLOR_TIMING;
+ //!rst::
+ // .. c:var:: const char* ROLE_TEXTURE_PAINT
+ //
+ // This role defines the transform for painting textures. In some
+ // workflows this is just a inverse display gamma with some limits
+ extern OCIOEXPORT const char * ROLE_TEXTURE_PAINT;
+ //!rst::
+ // .. c:var:: const char* ROLE_MATTE_PAINT
+ //
+ // This role defines the transform for matte painting. In some workflows
+ // this is a 1D HDR to LDR allocation. It is normally combined with
+ // another display transform in the host app for preview.
+ extern OCIOEXPORT const char * ROLE_MATTE_PAINT;
+
+}
+OCIO_NAMESPACE_EXIT
+
+#endif
diff --git a/export/PyOpenColorIO/PyOpenColorIO.h b/export/PyOpenColorIO/PyOpenColorIO.h
new file mode 100644
index 0000000..2cb50cc
--- /dev/null
+++ b/export/PyOpenColorIO/PyOpenColorIO.h
@@ -0,0 +1,98 @@
+/*
+Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#ifndef INCLUDED_PYOCIO_PYOCIO_H
+#define INCLUDED_PYOCIO_PYOCIO_H
+
+#include <Python.h>
+
+#include <OpenColorIO/OpenColorIO.h>
+
+OCIO_NAMESPACE_ENTER
+{
+ // ColorSpace
+ PyObject * BuildConstPyColorSpace(ConstColorSpaceRcPtr colorSpace);
+ PyObject * BuildEditablePyColorSpace(ColorSpaceRcPtr colorSpace);
+ bool IsPyColorSpace(PyObject * pyobject);
+ bool IsPyColorSpaceEditable(PyObject * pyobject);
+ ConstColorSpaceRcPtr GetConstColorSpace(PyObject * pyobject, bool allowCast);
+ ColorSpaceRcPtr GetEditableColorSpace(PyObject * pyobject);
+
+ // Config
+ PyObject * BuildConstPyConfig(ConstConfigRcPtr config);
+ PyObject * BuildEditablePyConfig(ConfigRcPtr config);
+ bool IsPyConfig(PyObject * config);
+ bool IsPyConfigEditable(PyObject * config);
+ ConstConfigRcPtr GetConstConfig(PyObject * config, bool allowCast);
+ ConfigRcPtr GetEditableConfig(PyObject * config);
+
+ // Context
+ PyObject * BuildConstPyContext(ConstContextRcPtr context);
+ PyObject * BuildEditablePyContext(ContextRcPtr context);
+ bool IsPyContext(PyObject * config);
+ bool IsPyContextEditable(PyObject * config);
+ ConstContextRcPtr GetConstContext(PyObject * context, bool allowCast);
+ ContextRcPtr GetEditableContext(PyObject * context);
+
+ // Exception
+ // Warning: these cannot return valid PyObject pointers before
+ // the python module has been initialized. Beware of calling these
+ // at static construction time.
+ PyObject * GetExceptionPyType();
+ PyObject * GetExceptionMissingFilePyType();
+
+ // Processor
+ PyObject * BuildConstPyProcessor(ConstProcessorRcPtr processor);
+ bool IsPyProcessor(PyObject * pyobject);
+ ConstProcessorRcPtr GetConstProcessor(PyObject * pyobject);
+
+ // ProcessorMetadata
+ PyObject * BuildConstPyProcessorMetadata(ConstProcessorMetadataRcPtr metadata);
+ bool IsPyProcessorMetadata(PyObject * pyobject);
+ ConstProcessorMetadataRcPtr GetConstProcessorMetadata(PyObject * pyobject);
+
+ // Transform
+ PyObject * BuildConstPyTransform(ConstTransformRcPtr transform);
+ PyObject * BuildEditablePyTransform(TransformRcPtr transform);
+ bool IsPyTransform(PyObject * pyobject);
+ bool IsPyTransformEditable(PyObject * pyobject);
+ ConstTransformRcPtr GetConstTransform(PyObject * pyobject, bool allowCast);
+ TransformRcPtr GetEditableTransform(PyObject * pyobject);
+
+ // Look
+ PyObject * BuildConstPyLook(ConstLookRcPtr look);
+ PyObject * BuildEditablePyLook(LookRcPtr look);
+ bool IsPyLook(PyObject * pyobject);
+ bool IsPyLookEditable(PyObject * pyobject);
+ ConstLookRcPtr GetConstLook(PyObject * pyobject, bool allowCast);
+ LookRcPtr GetEditableLook(PyObject * pyobject);
+}
+OCIO_NAMESPACE_EXIT
+
+#endif
diff --git a/export/pkgconfig/OpenColorIO.pc.in b/export/pkgconfig/OpenColorIO.pc.in
new file mode 100644
index 0000000..81ab4ce
--- /dev/null
+++ b/export/pkgconfig/OpenColorIO.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_EXEC_PREFIX@
+includedir=${prefix}/include
+libdir=${exec_prefix}/lib@LIB_SUFFIX@
+
+Name: OpenColorIO
+Description: A color management framework for visual effects and animation
+Version: @OCIO_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lOpenColorIO
diff --git a/share/cmake/FindNuke.cmake b/share/cmake/FindNuke.cmake
new file mode 100644
index 0000000..79320b1
--- /dev/null
+++ b/share/cmake/FindNuke.cmake
@@ -0,0 +1,96 @@
+#==========
+#
+# Copyright (c) 2010, Dan Bethell.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the name of Dan Bethell nor the names of any
+# other contributors to this software may be used to endorse or
+# promote products derived from this software without specific prior
+# written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#==========
+#
+# Variables defined by this module:
+# Nuke_FOUND
+# Nuke_INCLUDE_DIR
+# Nuke_COMPILE_FLAGS
+# Nuke_LINK_FLAGS
+# Nuke_LIBRARIES
+# Nuke_LIBRARY_DIR
+#
+# Usage:
+# FIND_PACKAGE( Nuke )
+# FIND_PACKAGE( Nuke REQUIRED )
+#
+# Note:
+# You can tell the module where Nuke is installed by setting
+# the NUKE_INSTALL_PATH (or setting the NDK_PATH environment
+# variable before calling FIND_PACKAGE.
+#
+# E.g.
+# SET( NUKE_INSTALL_PATH "/usr/local/Nuke5.2v3" )
+# FIND_PACKAGE( Nuke REQUIRED )
+#
+#==========
+
+# our includes
+FIND_PATH( Nuke_INCLUDE_DIR DDImage/Op.h
+ $ENV{NDK_PATH}/include
+ ${NUKE_INSTALL_PATH}/include
+ )
+
+# our library
+FIND_LIBRARY( Nuke_LIBRARIES DDImage
+ $ENV{NDK_PATH}
+ ${NUKE_INSTALL_PATH}
+ )
+
+SET( Nuke_COMPILE_FLAGS "" )
+SET( Nuke_LINK_FLAGS "" )
+IF( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
+ SET( Nuke_COMPILE_FLAGS "-arch i386" )
+ SET( Nuke_LINK_FLAGS "-arch i386" )
+ENDIF( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
+
+# our library path
+GET_FILENAME_COMPONENT( Nuke_LIBRARY_DIR ${Nuke_LIBRARIES} PATH )
+
+# did we find everything?
+INCLUDE( FindPackageHandleStandardArgs )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS( "Nuke" DEFAULT_MSG
+ Nuke_INCLUDE_DIR
+ Nuke_LIBRARIES
+ Nuke_LIBRARY_DIR
+ )
+
+SET( Nuke_API_VERSION "" )
+IF( NUKE_FOUND )
+ TRY_RUN(NUKE_VERSION_EXITCODE NUKE_VERSION_COMPILED
+ ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH}/TestForDDImageVersion.cxx
+ COMPILE_DEFINITIONS "-I${Nuke_INCLUDE_DIR}"
+ RUN_OUTPUT_VARIABLE Nuke_API_VERSION)
+ message(STATUS "Nuke_API_VERSION: --${Nuke_API_VERSION}--")
+ENDIF()
diff --git a/share/cmake/FindTinyXML.cmake b/share/cmake/FindTinyXML.cmake
new file mode 100644
index 0000000..7e54cc0
--- /dev/null
+++ b/share/cmake/FindTinyXML.cmake
@@ -0,0 +1,59 @@
+# Find the tinyxml XML parsing library.
+#
+# Sets the usual variables expected for find_package scripts:
+#
+# TINYXML_INCLUDE_DIRS - header location
+# TINYXML_LIBRARIES - library to link against
+# TINYXML_FOUND - true if tinyxml was found.
+# TINYXML_MAJOR_VERSION
+# TINYXML_MINOR_VERSION
+# TINYXML_PATCH_VERSION
+# TINYXML_VERSION
+
+find_path(TINYXML_INCLUDE_DIR tinyxml.h)
+find_library(TINYXML_LIBRARY NAMES tinyxml)
+
+# Try to get the tinyxml version from the header file.
+if(TINYXML_INCLUDE_DIR)
+ set(_tixml_header ${TINYXML_INCLUDE_DIR}/tinyxml.h)
+ file(READ ${_tixml_header} _contents)
+ if(_contents)
+ string(REGEX MATCH "const int TIXML_MAJOR_VERSION = ([0-9]+);" _TMP_major "${_contents}")
+ string(REGEX REPLACE ".*([0-9]+).*" "\\1" _OUT_major "${_TMP_major}")
+ string(REGEX MATCH "const int TIXML_MINOR_VERSION = ([0-9]+);" _TMP_minor "${_contents}")
+ string(REGEX REPLACE ".*([0-9]+).*" "\\1" _OUT_minor "${_TMP_minor}")
+ string(REGEX MATCH "const int TIXML_PATCH_VERSION = ([0-9]+);" _TMP_patch "${_contents}")
+ string(REGEX REPLACE ".*([0-9]+).*" "\\1" _OUT_patch "${_TMP_patch}")
+
+ if(NOT ${_OUT_major} MATCHES "[0-9]+")
+ message(FATAL_ERROR "Version parsing failed for TIXML_MAJOR_VERSION!")
+ endif()
+ if(NOT ${_OUT_minor} MATCHES "[0-9]+")
+ message(FATAL_ERROR "Version parsing failed for TIXML_MINOR_VERSION!")
+ endif()
+ if(NOT ${_OUT_patch} MATCHES "[0-9]+")
+ message(FATAL_ERROR "Version parsing failed for TIXML_MICRO_VERSION!")
+ endif()
+
+ set(TINYXML_MAJOR_VERSION ${_OUT_major})
+ set(TINYXML_MINOR_VERSION ${_OUT_minor})
+ set(TINYXML_PATCH_VERSION ${_OUT_patch})
+ set(TINYXML_VERSION ${TINYXML_MAJOR_VERSION}.${TINYXML_MINOR_VERSION}.${TINYXML_PATCH_VERSION})
+ else()
+ message(FATAL_ERROR "Include file ${_tixml_header} does not exist")
+ endif()
+endif()
+
+# Support the REQUIRED and QUIET arguments, and set TINYXML_FOUND if found.
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (TinyXML DEFAULT_MSG TINYXML_LIBRARY
+ TINYXML_INCLUDE_DIR)
+
+message(STATUS "TinyXML version: ${TINYXML_VERSION}")
+
+if(TINYXML_FOUND)
+ set(TINYXML_LIBRARIES ${TINYXML_LIBRARY})
+ set(TINYXML_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(TINYXML_LIBRARY TINYXML_INCLUDE_DIR)
diff --git a/share/cmake/FindTruelight.cmake b/share/cmake/FindTruelight.cmake
new file mode 100644
index 0000000..5d437b2
--- /dev/null
+++ b/share/cmake/FindTruelight.cmake
@@ -0,0 +1,87 @@
+#==========
+#
+# Copyright (c) 2011, Malcolm Humphreys.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the name of Dan Bethell nor the names of any
+# other contributors to this software may be used to endorse or
+# promote products derived from this software without specific prior
+# written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#==========
+#
+# Variables defined by this module:
+# Truelight_FOUND
+# Truelight_INCLUDE_DIR
+# Truelight_COMPILE_FLAGS
+# Truelight_LINK_FLAGS
+# Truelight_LIBRARIES
+# Truelight_LIBRARY_DIR
+#
+# Usage:
+# FIND_PACKAGE( Truelight )
+# FIND_PACKAGE( Truelight REQUIRED )
+#
+# Note:
+# You can tell the module where Truelight is installed by setting
+# the TRUELIGHT_INSTALL_PATH (or setting the TRUELIGHT_ROOT environment
+# variable before calling FIND_PACKAGE.
+#
+# E.g.
+# SET( TRUELIGHT_INSTALL_PATH "/usr/fl/truelight" )
+# FIND_PACKAGE( Truelight REQUIRED )
+#
+#==========
+
+# our includes
+FIND_PATH( Truelight_INCLUDE_DIR truelight.h
+ $ENV{TRUELIGHT_ROOT}/include
+ ${TRUELIGHT_INSTALL_PATH}/include
+ )
+
+# our library
+FIND_LIBRARY( Truelight_LIBRARIES libtruelight.a
+ $ENV{TRUELIGHT_ROOT}/lib
+ ${TRUELIGHT_INSTALL_PATH}/lib
+ )
+
+SET( Truelight_COMPILE_FLAGS "" )
+SET( Truelight_LINK_FLAGS "" )
+IF( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
+ SET( Truelight_COMPILE_FLAGS "" )
+ SET( Truelight_LINK_FLAGS "-framework CoreServices -framework IOKit" )
+ENDIF( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
+
+# our library path
+GET_FILENAME_COMPONENT( Truelight_LIBRARY_DIR ${Truelight_LIBRARIES} PATH )
+
+# did we find everything?
+INCLUDE( FindPackageHandleStandardArgs )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS( "Truelight" DEFAULT_MSG
+ Truelight_INCLUDE_DIR
+ Truelight_LIBRARIES
+ Truelight_LIBRARY_DIR
+ )
diff --git a/share/cmake/OCIOMacros.cmake b/share/cmake/OCIOMacros.cmake
new file mode 100644
index 0000000..daf2c67
--- /dev/null
+++ b/share/cmake/OCIOMacros.cmake
@@ -0,0 +1,339 @@
+MACRO(messageonce MSG)
+ if(CMAKE_FIRST_RUN)
+ message(STATUS ${MSG})
+ endif()
+ENDMACRO()
+
+MACRO(OCIOFindOpenGL)
+ if(APPLE)
+ INCLUDE_DIRECTORIES(/System/Library/Frameworks)
+ endif()
+
+ # Find OpenGL
+ find_package(OpenGL)
+ if(OPENGL_FOUND)
+ message(STATUS "Found OpenGL library ${OPENGL_LIBRARY}")
+ message(STATUS "Found OpenGL includes ${OPENGL_INCLUDE_DIR}")
+ else()
+ message(STATUS "OpenGL not found")
+ endif()
+
+ # Find GLUT
+ find_package(GLUT)
+ if(GLUT_FOUND)
+ message(STATUS "Found GLUT library ${GLUT_LIBRARY}")
+ else()
+ message(STATUS "GLUT not found")
+ endif()
+
+ # Find GLEW
+ set(GLEW_VERSION 1.5.1)
+ FIND_PATH(GLEW_INCLUDES GL/glew.h
+ /usr/include
+ /usr/local/include
+ /sw/include
+ /opt/local/include
+ DOC "The directory where GL/glew.h resides")
+ FIND_LIBRARY(GLEW_LIBRARIES
+ NAMES GLEW glew
+ /usr/lib64
+ /usr/lib
+ /usr/local/lib64
+ /usr/local/lib
+ /sw/lib
+ /opt/local/lib
+ PATHS
+ DOC "The GLEW library")
+ if(GLEW_INCLUDES AND GLEW_LIBRARIES)
+ set(GLEW_FOUND TRUE)
+ message(STATUS "Found GLEW library ${GLEW_LIBRARIES}")
+ message(STATUS "Found GLEW includes ${GLEW_INCLUDES}")
+ else()
+ message(STATUS "GLEW not found")
+ set(GLEW_FOUND FALSE)
+ endif()
+ENDMACRO()
+
+MACRO(OCIOFindOpenImageIO)
+ if(OIIO_PATH)
+ message(STATUS "OIIO path explicitly specified: ${OIIO_PATH}")
+ endif()
+ if(OIIO_INCLUDE_PATH)
+ message(STATUS "OIIO INCLUDE_PATH explicitly specified: ${OIIO_INCLUDE_PATH}")
+ endif()
+ if(OIIO_LIBRARY_PATH)
+ message(STATUS "OIIO LIBRARY_PATH explicitly specified: ${OIIO_LIBRARY_PATH}")
+ endif()
+ FIND_PATH( OIIO_INCLUDES OpenImageIO/version.h
+ ${OIIO_INCLUDE_PATH}
+ ${OIIO_PATH}/include/
+ /usr/include
+ /usr/local/include
+ /sw/include
+ /opt/local/include
+ DOC "The directory where OpenImageIO/version.h resides")
+ FIND_LIBRARY(OIIO_LIBRARIES
+ NAMES OIIO OpenImageIO
+ PATHS
+ ${OIIO_LIBRARY_PATH}
+ ${OIIO_PATH}/lib/
+ /usr/lib64
+ /usr/lib
+ /usr/local/lib64
+ /usr/local/lib
+ /sw/lib
+ /opt/local/lib
+ DOC "The OIIO library")
+
+ if(OIIO_INCLUDES AND OIIO_LIBRARIES)
+ set(OIIO_FOUND TRUE)
+ message(STATUS "Found OIIO library ${OIIO_LIBRARIES}")
+ message(STATUS "Found OIIO includes ${OIIO_INCLUDES}")
+ else()
+ set(OIIO_FOUND FALSE)
+ message(STATUS "OIIO not found. Specify OIIO_PATH to locate it")
+ endif()
+ENDMACRO()
+
+MACRO(OCIOFindPython)
+ # Set the default python runtime
+ if(NOT PYTHON)
+ set(PYHELP "path to Python executable (also used to find headers against which to compile Python bindings)")
+ set(PYTHON_HEADER Python.h)
+ set(PYTHON python CACHE FILEPATH ${PYHELP} FORCE)
+ endif(NOT PYTHON)
+
+ if(CMAKE_FIRST_RUN)
+ message(STATUS "Setting python bin to: ${PYTHON}")
+ endif()
+
+ set(PYTHON_OK YES) # OK until something goes wrong
+
+ # Get Python version
+ execute_process(COMMAND ${PYTHON} -c "from distutils import sysconfig; print sysconfig.get_python_version()"
+ OUTPUT_VARIABLE PYTHON_VERSION
+ RESULT_VARIABLE PYTHON_RETURNVALUE
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ if(${PYTHON_RETURNVALUE} EQUAL 0)
+ # Everything is fine
+ else()
+ # TODO: These error strings clobber previous values
+ set(PYTHON_ERR "${PYTHON} returned ${PYTHON_RETURNVALUE} trying to determine version number.")
+ set(PYTHON_OK NO)
+ endif()
+
+
+ # Determine Python UCS version
+ execute_process(COMMAND ${PYTHON} -c "import sys; print sys.maxunicode > 65536 and 'ucs4' or 'ucs2'"
+ OUTPUT_VARIABLE PYTHON_UCS
+ RESULT_VARIABLE PYTHON_RETURNVALUE
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ if(${PYTHON_RETURNVALUE} EQUAL 0)
+ # Hurray
+ else()
+ set(PYTHON_OK NO)
+ set(PYTHON_ERR "${PYTHON} returned ${PYTHON_RETURNVALUE} trying to determine UCS version.")
+ endif()
+
+
+ # Locate headers
+ execute_process(COMMAND ${PYTHON} -c "from distutils import sysconfig; print ':'.join(set(sysconfig.get_config_var('INCLDIRSTOMAKE').split()))"
+ OUTPUT_VARIABLE PYTHON_INCLUDE_RAW
+ RESULT_VARIABLE PYTHON_RETURNVALUE
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ # Handle errors, and process include path
+ if(${PYTHON_RETURNVALUE} EQUAL 0)
+ file(TO_CMAKE_PATH "${PYTHON_INCLUDE_RAW}" PYTHON_INCLUDE)
+ else()
+ set(PYTHON_ERR "${PYTHON} returned ${PYTHON_RETURNVALUE} trying to determine header location.")
+ set(PYTHON_OK NO)
+ endif()
+
+
+ # Locate Python library
+ execute_process(COMMAND ${PYTHON} -c "from distutils import sysconfig; print ':'.join(set(sysconfig.get_config_var('LIBPL').split()))"
+ OUTPUT_VARIABLE PYTHON_LIBRARY_DIRS_RAW
+ RESULT_VARIABLE PYTHON_RETURNVALUE
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ # Handle errors, and process include path
+ if(${PYTHON_RETURNVALUE} EQUAL 0)
+ file(TO_CMAKE_PATH "${PYTHON_LIBRARY_DIRS_RAW}" PYTHON_LIBRARY_DIRS)
+
+ FIND_LIBRARY(PYTHON_LIBRARY
+ NAMES "python${PYTHON_VERSION}"
+ PATHS ${PYTHON_LIBRARY_DIRS}
+ NO_DEFAULT_PATH # Don't be "helpful" and randomly grab library from /usr/lib etc
+ )
+ message("Python library: ${PYTHON_LIBRARY}")
+ else()
+ set(PYTHON_ERR "${PYTHON} returned ${PYTHON_RETURNVALUE} trying to determine library path.")
+ set(PYTHON_OK NO)
+ endif()
+
+ # Construct variant path - a path that sufficiently identifies the
+ # ABI-compatbility of the built library. See Github issue #236
+ if(OCIO_PYGLUE_RESPECT_ABI)
+ # Respect Python major/minor version, and UCS version (unicode
+ # content system). E.g install into "lib/python2.6/ucs4/site-packages"
+ set(PYTHON_VARIANT_PATH "lib${LIB_SUFFIX}/python${PYTHON_VERSION}/${PYTHON_UCS}/site-packages")
+ else()
+ # Ignore UCS value and install into lib/python2.6/site-packages dir
+ set(PYTHON_VARIANT_PATH "lib${LIB_SUFFIX}/python${PYTHON_VERSION}/site-packages")
+ endif()
+
+ENDMACRO()
+
+MACRO(OCIOFindJava)
+ if(APPLE)
+
+ SET(_JAVA_HINTS $ENV{JAVA_HOME}/bin)
+ SET(_JAVA_PATHS /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands)
+
+ FIND_PROGRAM(Java_JAVA_EXECUTABLE
+ NAMES java
+ HINTS ${_JAVA_HINTS}
+ PATHS ${_JAVA_PATHS}
+ )
+
+ IF(Java_JAVA_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${Java_JAVA_EXECUTABLE} -version
+ RESULT_VARIABLE res
+ OUTPUT_VARIABLE var
+ ERROR_VARIABLE var # sun-java output to stderr
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE)
+ IF( res )
+ IF(${Java_FIND_REQUIRED})
+ MESSAGE( FATAL_ERROR "Error executing java -version" )
+ ELSE()
+ MESSAGE( STATUS "Warning, could not run java --version")
+ ENDIF()
+ ELSE()
+ # extract major/minor version and patch level from "java -version" output
+ # Tested on linux using
+ # 1. Sun / Sun OEM
+ # 2. OpenJDK 1.6
+ # 3. GCJ 1.5
+ # 4. Kaffe 1.4.2
+ IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+[oem-]*\".*")
+ # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
+ STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+)[oem-]*\".*"
+ "\\1" Java_VERSION_STRING "${var}" )
+ ELSEIF(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
+ # Kaffe style
+ STRING( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
+ "\\1" Java_VERSION_STRING "${var}" )
+ ELSE()
+ IF(NOT Java_FIND_QUIETLY)
+ message(WARNING "regex not supported: ${var}. Please report")
+ ENDIF(NOT Java_FIND_QUIETLY)
+ ENDIF()
+ STRING( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
+ STRING( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
+ STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
+ # warning tweak version can be empty:
+ STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+\\_?\\.?([0-9]*)$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
+ if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
+ set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
+ else( )
+ set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK})
+ endif( )
+ ENDIF()
+ ENDIF(Java_JAVA_EXECUTABLE)
+
+ FIND_PROGRAM(Java_JAR_EXECUTABLE
+ NAMES jar
+ HINTS ${_JAVA_HINTS}
+ PATHS ${_JAVA_PATHS}
+ )
+
+ FIND_PROGRAM(Java_JAVAC_EXECUTABLE
+ NAMES javac
+ HINTS ${_JAVA_HINTS}
+ PATHS ${_JAVA_PATHS}
+ )
+
+ FIND_PROGRAM(Java_JAVAH_EXECUTABLE
+ NAMES javah
+ HINTS ${_JAVA_HINTS}
+ PATHS ${_JAVA_PATHS}
+ )
+
+ FIND_PROGRAM(Java_JAVADOC_EXECUTABLE
+ NAMES javadoc
+ HINTS ${_JAVA_HINTS}
+ PATHS ${_JAVA_PATHS}
+ )
+
+ # Check for everything
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Java
+ REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
+ Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE Java_VERSION)
+ set(Java_FOUND TRUE)
+
+ find_package(JNI)
+
+ else()
+
+ find_package(Java)
+ find_package(JNI)
+
+ endif()
+
+ENDMACRO()
+
+MACRO(ExtractRstCPP INFILE OUTFILE)
+ add_custom_command(
+ OUTPUT ${OUTFILE}
+ COMMAND ${CMAKE_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceCPP.py ${INFILE} ${OUTFILE}
+ DEPENDS ${INFILE}
+ COMMENT "Extracting reStructuredText from ${INFILE} (using old process)"
+ )
+ENDMACRO()
+
+MACRO(ExtractRstSimple INFILE OUTFILE)
+ add_custom_command(
+ OUTPUT ${OUTFILE}
+ COMMAND ${CMAKE_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceSimple.py ${INFILE} ${OUTFILE}
+ DEPENDS ${INFILE}
+ COMMENT "Extracting reStructuredText from ${INFILE}"
+ )
+ENDMACRO()
+
+
+MACRO(CopyFiles TARGET)
+ # parse the macro arguments
+ PARSE_ARGUMENTS(COPYFILES
+ "OUTDIR;"
+ "NOTUSED" ${ARGN})
+
+ # get the list of sources from the args
+ set(FILES ${COPYFILES_DEFAULT_ARGS})
+
+ # find the shader compiler
+ if(NOT COPYFILES_OUTDIR)
+ set(COPYFILES_OUTDIR ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
+
+ set(${TARGET}_OUTPUT)
+ foreach(FILE ${FILES})
+ get_filename_component(_FILE_NAME ${FILE} NAME)
+ set(OUTFILENAME "${COPYFILES_OUTDIR}/${_FILE_NAME}")
+ list(APPEND ${TARGET}_OUTPUT ${OUTFILENAME})
+ add_custom_command(
+ OUTPUT ${OUTFILENAME}
+ COMMAND ${CMAKE_COMMAND} -E copy ${FILE} ${OUTFILENAME}
+ DEPENDS ${FILE}
+ COMMENT "Copying file ${FILE}\n to ${OUTFILENAME}"
+ )
+ endforeach()
+ENDMACRO()
diff --git a/share/cmake/ParseArguments.cmake b/share/cmake/ParseArguments.cmake
new file mode 100644
index 0000000..3e9c947
--- /dev/null
+++ b/share/cmake/ParseArguments.cmake
@@ -0,0 +1,57 @@
+#-------------------------------------------------------------------------------
+# The PARSE_ARGUMENTS macro will take the arguments of another macro and define
+# several variables. The first argument to PARSE_ARGUMENTS is a prefix to put
+# on all variables it creates. The second argument is a list of names, and the
+# third argument is a list of options. Both of these lists should be quoted.
+# The rest of the PARSE_ARGUMENTS args are arguments from another macro to be
+# parsed.
+#
+# PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)
+#
+# For each item in options, PARSE_ARGUMENTS will create a variable with that
+# name, prefixed with prefix_. So, for example, if prefix is MY_MACRO and
+# options is OPTION1;OPTION2, then PARSE_ARGUMENTS will create the variables
+# MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These variables will be set to true if
+# the option exists in the command line or false otherwise.
+#
+# For each item in arg_names, PARSE_ARGUMENTS will create a variable with that
+# name, prefixed with prefix_. Each variable will be filled with the arguments
+# that occur after the given arg_name is encountered up to the next arg_name or
+# the end of the arguments. All options are removed from these lists.
+# PARSE_ARGUMENTS also creates a prefix_DEFAULT_ARGS variable containing the
+# list of all arguments up to the first arg_name encountered.
+#
+# Downloaded from: http://www.itk.org/Wiki/CMakeMacroParseArguments
+#
+
+cmake_minimum_required(VERSION 2.4.7)
+
+MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
+ SET(DEFAULT_ARGS)
+ FOREACH(arg_name ${arg_names})
+ SET(${prefix}_${arg_name})
+ ENDFOREACH(arg_name)
+ FOREACH(option ${option_names})
+ SET(${prefix}_${option} FALSE)
+ ENDFOREACH(option)
+ SET(current_arg_name DEFAULT_ARGS)
+ SET(current_arg_list)
+ FOREACH(arg ${ARGN})
+ SET(larg_names ${arg_names})
+ LIST(FIND larg_names "${arg}" is_arg_name)
+ IF (is_arg_name GREATER -1)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ SET(current_arg_name ${arg})
+ SET(current_arg_list)
+ ELSE (is_arg_name GREATER -1)
+ SET(loption_names ${option_names})
+ LIST(FIND loption_names "${arg}" is_option)
+ IF (is_option GREATER -1)
+ SET(${prefix}_${arg} TRUE)
+ ELSE (is_option GREATER -1)
+ SET(current_arg_list ${current_arg_list} ${arg})
+ ENDIF (is_option GREATER -1)
+ ENDIF (is_arg_name GREATER -1)
+ ENDFOREACH(arg)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ENDMACRO(PARSE_ARGUMENTS)
diff --git a/share/cmake/TestForDDImageVersion.cxx b/share/cmake/TestForDDImageVersion.cxx
new file mode 100644
index 0000000..a94e2e0
--- /dev/null
+++ b/share/cmake/TestForDDImageVersion.cxx
@@ -0,0 +1,14 @@
+#include <iostream>
+#include "DDImage/ddImageVersionNumbers.h"
+int main(int, char*[])
+{
+ // Print a Nuke API identifier number, used to make the
+ // lib/nuke${API_NUMBER} directory
+
+ // Nuke aims to maintain API compatibilty between "v" releases, so
+ // compiling for 6.1v1 will work with 6.1v2 etc (but not
+ // 6.2v1). Only exception has been 5.1v5 and 5.1v6 (because it was
+ // supposed to be 5.2v1)
+ std::cout << kDDImageVersionMajorNum << "." << kDDImageVersionMinorNum;
+ return 0;
+}
diff --git a/share/cmake/andriod-toolchain.cmake b/share/cmake/andriod-toolchain.cmake
new file mode 100644
index 0000000..5ee3060
--- /dev/null
+++ b/share/cmake/andriod-toolchain.cmake
@@ -0,0 +1,61 @@
+
+set(NDK /Applications/android-ndk-r5b)
+set(NDK_LEVEL 9)
+set(NDK_ARCH arm)
+set(NDK_CPU_ABI armeabi-v7a) # armeabi, armeabi-v7a, x86
+
+set(NDK_SYSROOT ${NDK}/platforms/android-${NDK_LEVEL}/arch-${NDK_ARCH})
+set(NDK_TOOLCHAIN_PREFIX arm-linux-androideabi)
+set(NDK_TOOLCHAIN_NAME ${NDK_TOOLCHAIN_PREFIX}-4.4.3)
+set(NDK_TOOLCHAIN_SYSTEM darwin-x86)
+set(NDK_TOOLCHAIN ${NDK}/toolchains/${NDK_TOOLCHAIN_NAME}/prebuilt/${NDK_TOOLCHAIN_SYSTEM})
+
+set(CMAKE_FIND_ROOT_PATH "${NDK_TOOLCHAIN}" "${NDK_SYSROOT}" "${NDK}")
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+set(CMAKE_SYSTEM_NAME GNU)
+set(CMAKE_SYSTEM_VERSION 1)
+set(CMAKE_SYSTEM_PROCESSOR armv7-a)
+set(CMAKE_OSX_ARCHITECTURES armv7-a)
+
+set(CMAKE_C_COMPILER ${NDK_TOOLCHAIN_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${NDK_TOOLCHAIN_PREFIX}-g++)
+
+include_directories("${NDK}/sources/cxx-stl/gnu-libstdc++/libs/${NDK_CPU_ABI}/include")
+include_directories("${NDK}/sources/cxx-stl/gnu-libstdc++/include")
+include_directories("${NDK_SYSROOT}/usr/include")
+
+# TODO: work out if we need any of these compile flags
+# -DNDEBUG -MMD -MP -MF -fpic -ffunction-sections -funwind-tables
+# -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__
+# -D__ARM_ARCH_5TE__ -mtune=xscale -msoft-float -mthumb
+# -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wno-psabi
+# -Wa,--noexecstack -Os -O2 -g
+
+set(NDK_COMPILE_FLAGS "-DANDROID -march=${CMAKE_SYSTEM_PROCESSOR} -mfloat-abi=softfp")
+
+# TODO: work out if we need any of these link flags
+# -Wl,--gc-sections -Wl,-z,nocopyreloc -Wl,--no-undefined -Wl,-z,noexecstack
+# -Wl,-rpath-link=${NDK_PLATFORM_ROOT}/usr/lib")
+
+set(NDK_LINK_FLAGS "-Wl,--fix-cortex-a8 --sysroot=${NDK_SYSROOT} -L${NDK_SYSROOT}/usr/lib -lsupc++ -lstdc++ -lm -lc -ldl")
+
+add_definitions(${NDK_COMPILE_FLAGS})
+set(CMAKE_C_LINK_FLAGS ${NDK_LINK_FLAGS})
+set(CMAKE_CXX_LINK_FLAGS ${NDK_LINK_FLAGS})
+
+set(CMAKE_CROSSCOMPILING TRUE)
+set(ANDROID TRUE)
+
+set(OCIO_BUILD_SHARED TRUE)
+set(OCIO_BUILD_STATIC FALSE)
+set(OCIO_BUILD_UNITTESTS FALSE)
+set(OCIO_BUILD_TRUELIGHT FALSE)
+set(OCIO_BUILD_TESTBED FALSE)
+set(OCIO_BUILD_APPS FALSE)
+set(OCIO_BUILD_NUKE FALSE)
+set(OCIO_BUILD_PYGLUE FALSE)
+set(OCIO_BUILD_JNIGLUE TRUE)
+set(OCIO_BUILD_SSE FALSE)
diff --git a/share/cmake/iPhone-armv6-toolchain.cmake b/share/cmake/iPhone-armv6-toolchain.cmake
new file mode 100644
index 0000000..27803e5
--- /dev/null
+++ b/share/cmake/iPhone-armv6-toolchain.cmake
@@ -0,0 +1,42 @@
+
+set(IPHONE_SDK "4.3")
+set(IPHONE_ROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
+set(IPHONE_SDK_ROOT "${IPHONE_ROOT}/SDKs/iPhoneOS${IPHONE_SDK}.sdk")
+
+set(CMAKE_FIND_ROOT_PATH "${IPHONE_SDK_ROOT}" "${IPHONE_ROOT}")
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+set(CMAKE_SYSTEM_NAME "GNU")
+set(CMAKE_SYSTEM_PROCESSOR armv6)
+set(CMAKE_OSX_ARCHITECTURES armv6)
+
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+
+set(CMAKE_C_COMPILER gcc-4.2)
+set(CMAKE_CXX_COMPILER g++-4.2)
+
+add_definitions("-D__IPHONE__")
+add_definitions("-arch armv6 -pipe -no-cpp-precomp --sysroot=${IPHONE_SDK_ROOT} -miphoneos-version-min=${IPHONE_SDK}")
+set(CMAKE_C_LINK_FLAGS "-arch armv6 --isysroot=${IPHONE_SDK_ROOT} -miphoneos-version-min=${IPHONE_SDK} -L${IPHONE_SDK_ROOT}/usr/lib -L${IPHONE_SDK_ROOT}/usr/lib/system")
+set(CMAKE_CXX_LINK_FLAGS ${CMAKE_C_LINK_FLAGS})
+
+include_directories("${IPHONE_SDK_ROOT}/usr/include")
+include_directories("${IPHONE_SDK_ROOT}/usr/include/c++/4.2.1")
+include_directories("${IPHONE_SDK_ROOT}/usr/include/c++/4.2.1/armv6-apple-darwin10")
+
+link_directories("${IPHONE_SDK_ROOT}/usr/lib")
+link_directories("${IPHONE_SDK_ROOT}/usr/lib/system")
+
+set(CMAKE_CROSSCOMPILING TRUE)
+set(IPHONE TRUE)
+
+set(OCIO_BUILD_SHARED FALSE)
+set(OCIO_BUILD_STATIC TRUE)
+set(OCIO_BUILD_TRUELIGHT FALSE)
+set(OCIO_BUILD_TESTBED FALSE)
+set(OCIO_BUILD_APPS FALSE)
+set(OCIO_BUILD_NUKE FALSE)
+set(OCIO_BUILD_PYGLUE FALSE)
+set(OCIO_BUILD_SSE FALSE)
diff --git a/share/cmake/iPhone-toolchain.cmake b/share/cmake/iPhone-toolchain.cmake
new file mode 100644
index 0000000..70dd933
--- /dev/null
+++ b/share/cmake/iPhone-toolchain.cmake
@@ -0,0 +1,42 @@
+
+set(IPHONE_SDK "4.3")
+set(IPHONE_ROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
+set(IPHONE_SDK_ROOT "${IPHONE_ROOT}/SDKs/iPhoneOS${IPHONE_SDK}.sdk")
+
+set(CMAKE_FIND_ROOT_PATH "${IPHONE_SDK_ROOT}" "${IPHONE_ROOT}")
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+set(CMAKE_SYSTEM_NAME "GNU")
+set(CMAKE_SYSTEM_PROCESSOR armv7)
+set(CMAKE_OSX_ARCHITECTURES armv7)
+
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+
+set(CMAKE_C_COMPILER gcc-4.2)
+set(CMAKE_CXX_COMPILER g++-4.2)
+
+add_definitions("-D__IPHONE__")
+add_definitions("-arch armv7 -pipe -no-cpp-precomp --sysroot=${IPHONE_SDK_ROOT} -miphoneos-version-min=${IPHONE_SDK}")
+set(CMAKE_C_LINK_FLAGS "-arch armv7 --isysroot=${IPHONE_SDK_ROOT} -miphoneos-version-min=${IPHONE_SDK} -L${IPHONE_SDK_ROOT}/usr/lib -L${IPHONE_SDK_ROOT}/usr/lib/system")
+set(CMAKE_CXX_LINK_FLAGS ${CMAKE_C_LINK_FLAGS})
+
+include_directories("${IPHONE_SDK_ROOT}/usr/include")
+include_directories("${IPHONE_SDK_ROOT}/usr/include/c++/4.2.1")
+include_directories("${IPHONE_SDK_ROOT}/usr/include/c++/4.2.1/armv7-apple-darwin10")
+
+link_directories("${IPHONE_SDK_ROOT}/usr/lib")
+link_directories("${IPHONE_SDK_ROOT}/usr/lib/system")
+
+set(CMAKE_CROSSCOMPILING TRUE)
+set(IPHONE TRUE)
+
+set(OCIO_BUILD_SHARED FALSE)
+set(OCIO_BUILD_STATIC TRUE)
+set(OCIO_BUILD_TRUELIGHT FALSE)
+set(OCIO_BUILD_APPS FALSE)
+set(OCIO_BUILD_NUKE FALSE)
+set(OCIO_BUILD_PYGLUE FALSE)
+set(OCIO_BUILD_JNIGLUE FALSE)
+set(OCIO_BUILD_SSE FALSE)
diff --git a/share/cmake/iPhoneSimulator-toolchain.cmake b/share/cmake/iPhoneSimulator-toolchain.cmake
new file mode 100644
index 0000000..07210b9
--- /dev/null
+++ b/share/cmake/iPhoneSimulator-toolchain.cmake
@@ -0,0 +1,43 @@
+
+set(IPHONE_SDK "4.3")
+set(IPHONE_ROOT "/Developer/Platforms/iPhoneSimulator.platform/Developer")
+set(IPHONE_SDK_ROOT "${IPHONE_ROOT}/SDKs/iPhoneSimulator${IPHONE_SDK}.sdk")
+
+set(CMAKE_FIND_ROOT_PATH "${IPHONE_SDK_ROOT}" "${IPHONE_ROOT}")
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+set(CMAKE_SYSTEM_NAME Generic)
+set(CMAKE_SYSTEM_VERSION 1)
+set(CMAKE_OSX_ARCHITECTURES i686)
+set(CMAKE_OSX_SYSROOT "${IPHONE_SDK_ROOT}")
+
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+
+set(CMAKE_C_COMPILER gcc-4.2)
+set(CMAKE_CXX_COMPILER g++-4.2)
+
+add_definitions("-D__IPHONE__")
+add_definitions("-arch i686 -pipe -no-cpp-precomp --sysroot=${IPHONE_SDK_ROOT} -miphoneos-version-min=${IPHONE_SDK}")
+set(CMAKE_C_LINK_FLAGS "-arch i686 --isysroot=${IPHONE_SDK_ROOT} -miphoneos-version-min=${IPHONE_SDK} -L${IPHONE_SDK_ROOT}/usr/lib -L${IPHONE_SDK_ROOT}/usr/lib/system")
+set(CMAKE_CXX_LINK_FLAGS ${CMAKE_C_LINK_FLAGS})
+
+include_directories("${IPHONE_SDK_ROOT}/usr/include")
+include_directories("${IPHONE_SDK_ROOT}/usr/include/c++/4.2.1")
+include_directories("${IPHONE_SDK_ROOT}/usr/include/c++/4.2.1/i686-apple-darwin10")
+
+link_directories("${IPHONE_SDK_ROOT}/usr/lib")
+link_directories("${IPHONE_SDK_ROOT}/usr/lib/system")
+
+set(IPHONE_BUILD TRUE)
+set(CMAKE_CROSSCOMPILING TRUE)
+
+set(OCIO_BUILD_SHARED FALSE)
+set(OCIO_BUILD_STATIC TRUE)
+set(OCIO_BUILD_TRUELIGHT FALSE)
+set(OCIO_BUILD_APPS FALSE)
+set(OCIO_BUILD_NUKE FALSE)
+set(OCIO_BUILD_PYGLUE FALSE)
+set(OCIO_BUILD_JNIGLUE FALSE)
+set(OCIO_BUILD_SSE FALSE)
diff --git a/share/nuke/examples/colorlookup_to_spi1d.py b/share/nuke/examples/colorlookup_to_spi1d.py
new file mode 100644
index 0000000..44fc8d6
--- /dev/null
+++ b/share/nuke/examples/colorlookup_to_spi1d.py
@@ -0,0 +1,24 @@
+
+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()
+
+
+knob = nuke.selectedNode()['lut']
+
+SIZE = 2**10
+
+data = []
+for i in xrange(SIZE):
+ x = i/(SIZE-1.0)
+ data.append(knob.getValueAt(x))
+
+WriteSPI1D('/tmp/colorlookup.spi1d', 0.0, 1.0, data)
diff --git a/share/nuke/examples/ocio_to_colorlookup_all.py b/share/nuke/examples/ocio_to_colorlookup_all.py
new file mode 100644
index 0000000..84f23aa
--- /dev/null
+++ b/share/nuke/examples/ocio_to_colorlookup_all.py
@@ -0,0 +1,36 @@
+#import SpImport
+#OCIO = SpImport.SpComp2("PyOpenColorIO", 2)
+
+c = OCIO.GetCurrentConfig()
+
+cs_to_lin = c.getProcessor(OCIO.Constants.ROLE_COMPOSITING_LOG, OCIO.Constants.ROLE_SCENE_LINEAR)
+
+node = nuke.createNode("ColorLookup")
+node.setName("sm2_slg_to_ln")
+knob = node['lut']
+knob.removeKeyAt(0.0)
+knob.removeKeyAt(1.0)
+
+node2 = nuke.createNode("ColorLookup")
+node2.setName("sm2_ln_to_slg")
+knob2 = node2['lut']
+knob2.removeKeyAt(0.0)
+knob2.removeKeyAt(1.0)
+
+
+def Fit(value, fromMin, fromMax, toMin, toMax):
+ if fromMin == fromMax:
+ raise ValueError("fromMin == fromMax")
+ return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin
+
+SIZE = 2**10
+for i in xrange(SIZE):
+ x = i/(SIZE-1.0)
+
+ x = Fit(x, 0.0, 1.0, -0.125, 1.5)
+
+ y = cs_to_lin.applyRGB((x,x,x))[1]
+
+ knob.setValueAt(y,x)
+ knob2.setValueAt(x,y)
+
diff --git a/share/nuke/examples/ocio_to_colorlookup_rgb.py b/share/nuke/examples/ocio_to_colorlookup_rgb.py
new file mode 100644
index 0000000..efedbd7
--- /dev/null
+++ b/share/nuke/examples/ocio_to_colorlookup_rgb.py
@@ -0,0 +1,29 @@
+import SpImport
+OCIO = SpImport.SpComp2("PyOpenColorIO",2)
+#import PyOpenColorIO as OCIO
+
+c = OCIO.GetCurrentConfig()
+
+processor = c.getProcessor(OCIO.FileTransform('woz_qt_to_mxfva.spi1d', interpolation=OCIO.Constants.INTERP_LINEAR))
+
+node = nuke.createNode("ColorLookup")
+node.setName("woz_post_film")
+knob = node['lut']
+knob.removeKeyAt(0.0, 1)
+knob.removeKeyAt(1.0, 1)
+knob.removeKeyAt(0.0, 2)
+knob.removeKeyAt(1.0, 2)
+knob.removeKeyAt(0.0, 3)
+knob.removeKeyAt(1.0, 3)
+
+
+SIZE = 11
+for i in xrange(SIZE):
+ x = i/(SIZE-1.0)
+
+ y = processor.applyRGB((x,x,x))
+
+ knob.setValueAt(y[0],x, 1)
+ knob.setValueAt(y[1],x, 2)
+ knob.setValueAt(y[2],x, 3)
+
diff --git a/share/nuke/init.py b/share/nuke/init.py
new file mode 100644
index 0000000..6d3832c
--- /dev/null
+++ b/share/nuke/init.py
@@ -0,0 +1,26 @@
+import nuke
+
+EBANNER = "OCIO Error: "
+OCIO = None
+
+def load_ocio_plugins():
+ """Loads the PyOpenColorIO module and the OCIO-prefixed nodes
+ """
+
+ global OCIO
+ try:
+ import PyOpenColorIO as OCIO
+ except Exception, e:
+ print '%s%s\n%s' % (EBANNER, 'Loading OCIO python module', e)
+
+ allplugs = nuke.plugins(nuke.ALL | nuke.NODIR, "OCIO*.so", "OCIO*.dylib", "OCIO*.dll")
+
+ for p in allplugs:
+ try:
+ nuke.load(p)
+ except Exception, e:
+ print '%sLoading OCIO node %s\n%s' % (EBANNER, p, e)
+
+
+if __name__ == "__main__":
+ load_ocio_plugins()
diff --git a/share/nuke/menu.py b/share/nuke/menu.py
new file mode 100644
index 0000000..250a10c
--- /dev/null
+++ b/share/nuke/menu.py
@@ -0,0 +1,26 @@
+import os
+import nuke
+import ocionuke.cdl
+
+
+def ocio_populate_menu():
+ """Adds OCIO nodes to a menu in Color
+ """
+
+ m_nodes = nuke.toolbar('Nodes')
+ m_color = m_nodes.findItem("Color")
+ m_ocio = m_color.addMenu("OCIO", icon = "ocio_icon.png")
+
+ allplugs = nuke.plugins(nuke.ALL | nuke.NODIR, "OCIO*.so", "OCIO*.dylib", "OCIO*.dll")
+
+ for fname in allplugs:
+ p = os.path.splitext(fname)[0] # strip .so extension
+ m_ocio.addCommand(p, lambda p=p: nuke.createNode(p))
+
+ m_utils = m_ocio.addMenu("Utils")
+ m_utils.addCommand("Import .ccc to CDL nodes", ocionuke.cdl.import_multiple_from_ccc)
+ m_utils.addCommand("Export selected CDL's to .ccc", ocionuke.cdl.export_multiple_to_ccc)
+
+
+if __name__ == "__main__":
+ ocio_populate_menu()
diff --git a/share/nuke/ocio_icon.png b/share/nuke/ocio_icon.png
new file mode 100644
index 0000000..3972d66
--- /dev/null
+++ b/share/nuke/ocio_icon.png
Binary files differ
diff --git a/share/nuke/ocionuke/__init__.py b/share/nuke/ocionuke/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/share/nuke/ocionuke/__init__.py
diff --git a/share/nuke/ocionuke/cdl.py b/share/nuke/ocionuke/cdl.py
new file mode 100644
index 0000000..9ed76ae
--- /dev/null
+++ b/share/nuke/ocionuke/cdl.py
@@ -0,0 +1,269 @@
+"""Various utilities relating to the OCIOCDLTransform node
+"""
+
+import nuke
+import nukescripts
+import PyOpenColorIO as OCIO
+import xml.etree.ElementTree as ET
+
+
+def _node_to_cdltransform(node):
+ """From an OCIOCDLTransform node, returns a PyOpenColorIO
+ CDLTransform object, which could be used to write XML
+ """
+
+ # Color_Knob.value returns single float if control is not
+ # expanded, so use value(index=...) to always get three values
+ slope = [node['slope'].value(x) for x in range(3)]
+ offset = [node['offset'].value(x) for x in range(3)]
+ power = [node['power'].value(x) for x in range(3)]
+ sat = node['saturation'].value()
+ cccid = node['cccid'].value()
+
+ cdl = OCIO.CDLTransform()
+ cdl.setSlope(slope)
+ cdl.setOffset(offset)
+ cdl.setPower(power)
+ cdl.setSat(sat)
+ cdl.setID(cccid)
+
+ return cdl
+
+
+def _cdltransform_to_node(cdl, node):
+ """From an XML string, populates the parameters on an
+ OCIOCDLTransform node
+ """
+
+ # Treat "node" as a dictionary of knobs, as the "node" argument could be
+ # a the return value of PythonPanel.knob(), as in SelectCCCIDPanel
+
+ node['slope'].setValue(cdl.getSlope())
+ node['offset'].setValue(cdl.getOffset())
+ node['power'].setValue(cdl.getPower())
+ node['saturation'].setValue(cdl.getSat())
+ node['cccid'].setValue(cdl.getID())
+
+
+def _xml_to_cdltransforms(xml):
+ """Given some XML as a string, returns a list of CDLTransform
+ objects for each ColorCorrection (returns a one-item list for a
+ .cc file)
+ """
+
+ tree = ET.fromstring(xml)
+
+ # Strip away xmlns
+ for elem in tree.getiterator():
+ if elem.tag.startswith("{"):
+ elem.tag = elem.tag.partition("}")[2]
+
+ filetype = tree.tag
+
+ if filetype == "ColorCorrection":
+ ccxml = ET.tostring(tree)
+ cdl = OCIO.CDLTransform()
+ cdl.setXML(ccxml)
+ return [cdl]
+
+ elif filetype == "ColorCorrectionCollection":
+ allcdl = []
+ for cc in tree.getchildren():
+ if cc.tag != "ColorCorrection": continue
+ ccxml = ET.tostring(cc)
+ cdl = OCIO.CDLTransform()
+ cdl.setXML(ccxml)
+ allcdl.append(cdl)
+ return allcdl
+
+ else:
+ raise RuntimeError(
+ "The supplied file did not have the correct root element, expected"
+ " 'ColorCorrection' or 'ColorCorrectionCollection', got %r" % (filetype))
+
+
+def _cdltransforms_to_xml(allcc):
+ """Given a list of CDLTransform objects, returns an XML string
+ """
+
+ root = ET.Element("ColorCorrectionCollection")
+ root.attrib['xmlns'] = 'urn:ASC:CDL:v1.2'
+
+ for cc in allcc:
+ cur = ET.fromstring(cc.getXML())
+
+ # Strip away xmlns
+ for elem in cur.getiterator():
+ if elem.tag.startswith("{"):
+ elem.tag = elem.tag.partition("}")[2]
+ root.append(cur)
+
+ return ET.tostring(root)
+
+
+class SelectCCCIDPanel(nukescripts.PythonPanel):
+ """Allows the user to select from a list of CDLTransform
+ objects
+ """
+
+ def __init__(self, allcdl):
+ super(SelectCCCIDPanel, self).__init__()
+ self.available = {}
+ for cur in allcdl:
+ self.available[cur.getID()] = cur
+
+ self.addKnob(nuke.Enumeration_Knob("cccid", "cccid", self.available.keys()))
+ self.addKnob(nuke.Text_Knob("divider"))
+ self.addKnob(nuke.Color_Knob("slope"))
+ self.addKnob(nuke.Color_Knob("offset"))
+ self.addKnob(nuke.Color_Knob("power"))
+ self.addKnob(nuke.Double_Knob("saturation"))
+
+ def selected(self):
+ return self.available[self.knobs()['cccid'].value()]
+
+ def knobChanged(self, knob):
+ """When the user selects a cccid, a grade-preview knobs are set.
+
+ This method is triggered when any knob is changed, which has the
+ useful side-effect of preventing changing the preview values, while
+ keeping them selectable for copy-and-paste.
+ """
+ _cdltransform_to_node(self.selected(), self.knobs())
+
+
+def export_as_cc(node = None, filename = None):
+ """Export a OCIOCDLTransform node as a ColorCorrection XML file
+ (.cc)
+
+ If node is None, "nuke.thisNode()" will be used. If filename is
+ not specified, the user will be prompted.
+ """
+
+ if node is None:
+ node = nuke.thisNode()
+
+ cdl = _node_to_cdltransform(node)
+
+ if filename is None:
+ ccfilename = nuke.getFilename("Color Correction filename", pattern = "*.cc")
+ if ccfilename is None:
+ # User clicked cancel
+ return
+
+ xml = cdl.getXML()
+ print "Writing to %s - contents:\n%s" % (ccfilename, xml)
+ open(ccfilename, "w").write(xml)
+
+
+def import_cc_from_xml(node = None, filename = None):
+ """Import a ColorCorrection XML (.cc) into a OCIOCDLTransform node.
+
+ If node is None, "nuke.thisNode()" will be used. If filename is
+ not specified, the user will be prompted.
+ """
+
+ if node is None:
+ node = nuke.thisNode()
+
+ if filename is None:
+ ccfilename = nuke.getFilename("Color Correction filename", pattern = "*.cc *.ccc")
+ if ccfilename is None:
+ # User clicked cancel
+ return
+
+ xml = open(ccfilename).read()
+
+ allcc = _xml_to_cdltransforms(xml)
+
+ if len(allcc) == 1:
+ _cdltransform_to_node(allcc[0], node)
+ elif len(allcc) > 1:
+ do_selectcccid = nuke.ask(
+ "Selected a ColorCorrectionCollection, do you wish to select a ColorCorrection from this file?")
+ if do_selectcccid:
+ sel = SelectCCCIDPanel(allcc)
+ okayed = sel.showModalDialog()
+ if okayed:
+ cc = sel.selected()
+ _cdltransform_to_node(cc, node)
+ else:
+ return
+ else:
+ nuke.message("The supplied file (%r) contained no ColorCorrection's" % ccfilename)
+ return
+
+
+def export_multiple_to_ccc(filename = None):
+ """Exported all selected OCIOCDLTransform nodes to a
+ ColorCorrectionCollection XML file (.ccc)
+ """
+
+ if filename is None:
+ filename = nuke.getFilename("Color Correction XML file", pattern = "*.cc *.ccc")
+ if filename is None:
+ # User clicked cancel
+ return
+
+ allcc = []
+ for node in nuke.selectedNodes("OCIOCDLTransform"):
+ allcc.append(_node_to_cdltransform(node))
+
+ xml = _cdltransforms_to_xml(allcc)
+ print "Writing %r, contents:\n%s" % (filename, xml)
+ open(filename, "w").write(xml)
+
+
+def import_multiple_from_ccc(filename = None):
+ """Import a ColorCorrectionCollection file (.ccc) into multiple
+ OCIOCDLTransform nodes. Also creates a single node for a .cc file
+ """
+
+ if filename is None:
+ filename = nuke.getFilename("Color Correction XML file", pattern = "*.cc *.ccc")
+ if filename is None:
+ # User clicked cancel
+ return
+
+ xml = open(filename).read()
+ allcc = _xml_to_cdltransforms(xml)
+
+ def _make_node(cdl):
+ newnode = nuke.nodes.OCIOCDLTransform(inputs = nuke.selectedNodes()[:1])
+ _cdltransform_to_node(cdl, newnode)
+ newnode['label'].setValue("id: [value cccid]")
+
+ if len(allcc) > 0:
+ for cc in allcc:
+ _make_node(cc)
+ else:
+ nuke.message("The supplied file (%r) contained no ColorCorrection's" % filename)
+
+
+def select_cccid_for_filetransform(node = None, fileknob = 'file', cccidknob = 'cccid'):
+ """Select cccid button for the OCIOFileTransform node, also used
+ in OCIOCDLTransform. Presents user with list of cccid's within the
+ specified .ccc file, and sets the cccid knob to the selected ID.
+ """
+
+ if node is None:
+ node = nuke.thisNode()
+
+ filename = node[fileknob].value()
+
+ try:
+ xml = open(filename).read()
+ except IOError, e:
+ nuke.message("Error opening src file: %s" % e)
+ raise
+
+ allcc = _xml_to_cdltransforms(xml)
+
+ if len(allcc) == 0:
+ nuke.message("The file (%r) contains no ColorCorrection's")
+ return
+
+ sel = SelectCCCIDPanel(allcc)
+ okayed = sel.showModalDialog()
+ if okayed:
+ node[cccidknob].setValue(sel.selected().getID())
diff --git a/share/nuke/ocionuke/viewer.py b/share/nuke/ocionuke/viewer.py
new file mode 100644
index 0000000..883525a
--- /dev/null
+++ b/share/nuke/ocionuke/viewer.py
@@ -0,0 +1,50 @@
+import nuke
+
+
+def register_viewers(also_remove = "default"):
+ """Registers the a viewer process for each display device/view, and
+ sets the default viewer process.
+
+ ``also_remove`` can be set to either:
+
+ - "default" to remove the default sRGB/rec709 viewer processes
+ - "all" to remove all processes
+ - "none" to leave existing viewer processes untouched
+ """
+
+ if also_remove not in ("default", "none", "all"):
+ raise ValueError("also_remove should be set to 'default', 'none' or 'all'")
+
+ if also_remove == "default":
+ nuke.ViewerProcess.unregister('rec709')
+ nuke.ViewerProcess.unregister('sRGB')
+ nuke.ViewerProcess.unregister('None')
+ elif also_remove == "all":
+ # Unregister all processes, including None, which should be defined in config.ocio
+ for curname in nuke.ViewerProcess.registeredNames():
+ nuke.ViewerProcess.unregister(curname)
+
+ # Formats the display and transform, e.g "Film1D (sRGB)"
+ DISPLAY_UI_FORMAT = "%(view)s (%(display)s)"
+
+ import PyOpenColorIO as OCIO
+ config = OCIO.GetCurrentConfig()
+
+ # For every display, loop over every view
+ for display in config.getDisplays():
+ for view in config.getViews(display):
+ # Register the node
+ nuke.ViewerProcess.register(
+ name = DISPLAY_UI_FORMAT % {'view': view, "display": display},
+ call = nuke.nodes.OCIODisplay,
+ args = (),
+ kwargs = {"display": display, "view": view, "layer": "all"})
+
+
+ # Get the default display and view, set it as the default used on Nuke startup
+ defaultDisplay = config.getDefaultDisplay()
+ defaultView = config.getDefaultView(defaultDisplay)
+
+ nuke.knobDefault(
+ "Viewer.viewerProcess",
+ DISPLAY_UI_FORMAT % {'view': defaultView, "display": defaultDisplay})
diff --git a/share/ocio/setup_ocio.sh.in b/share/ocio/setup_ocio.sh.in
new file mode 100644
index 0000000..81a109c
--- /dev/null
+++ b/share/ocio/setup_ocio.sh.in
@@ -0,0 +1,14 @@
+#!/bin/sh
+OCIO_ROOT="@CMAKE_INSTALL_PREFIX@"
+OCIO_EXECROOT="@CMAKE_INSTALL_EXEC_PREFIX@"
+
+# For OS X
+export DYLD_LIBRARY_PATH="${OCIO_EXECROOT}/lib:${DYLD_LIBRARY_PATH}"
+
+# For Linux
+export LD_LIBRARY_PATH="${OCIO_EXECROOT}/lib:${LD_LIBRARY_PATH}"
+
+export PATH="${OCIO_EXECROOT}/bin:${PATH}"
+export PYTHONPATH="${OCIO_EXECROOT}/@PYTHON_VARIANT_PATH@:${PYTHONPATH}"
+export NUKE_PATH="${OCIO_EXECROOT}/lib/nuke@Nuke_API_VERSION@:${NUKE_PATH}"
+export NUKE_PATH="${OCIO_ROOT}/share/nuke:${NUKE_PATH}";
diff --git a/share/sphinx/ExtractRstFromSourceCPP.py b/share/sphinx/ExtractRstFromSourceCPP.py
new file mode 100755
index 0000000..54cc3d7
--- /dev/null
+++ b/share/sphinx/ExtractRstFromSourceCPP.py
@@ -0,0 +1,324 @@
+#!/usr/bin/python
+
+"""
+Small Script to extract reStructuredText from OCIO headers
+ - http://sphinx.pocoo.org/rest.html
+ - http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html
+"""
+
+# TODO: extract void foo() { blah = 0 }; signatures correctly
+# TODO: handle typedef and enums better
+# TODO: handle OCIOEXPORT macro better
+# TODO: handle thow() funcs better
+
+RUNTEST = False
+
+import re, sys
+
+single_rst_comment = r"//(?P<single_comment>(!cpp:|!rst::).*\n)"
+block_rst_comment = r"/\*(?P<block_comment>(!cpp:|!rst::)([^*]*\*+)+?/)"
+rst_comment_regex = re.compile(r"(%s)|(%s)" % (single_rst_comment, block_rst_comment), re.MULTILINE)
+func_signature_regex = re.compile(r"(?P<sig_name>[^ ]*\(.*\))")
+
+rst_types = ["!rst::", "!cpp:class::", "!cpp:function::", "!cpp:member::",
+ "!cpp:type::"]
+
+def getRstType(string):
+ for rtype in rst_types:
+ if string[0 : len(rtype)] == rtype:
+ return rtype[1:]
+ return None
+
+def getNextCodeLine(string, rst_type, from_pos):
+
+ end = from_pos
+ signature = ""
+
+ if rst_type == "rst::":
+ return signature, end
+
+ if rst_type == "cpp:class::":
+
+ class_open = False
+
+ # first non-blank line that starts with 'class'
+ found_signature = False
+
+ # loop till the end of the class '};'
+ ## skip other open/close '{' '}'
+ skip_close = False
+ x = end
+ while x < len(string):
+ if string[x] != '\n' and not found_signature:
+ signature += string[x]
+ if string[x] == '\n' and not found_signature:
+ signature = signature.strip()
+ if signature != '':
+ found_signature = True
+ signature = signature.replace("class", "")
+ # TODO: this seem a bit dirty
+ signature = signature.replace("OCIOEXPORT ", "")
+ signature = signature.strip()
+ signature = signature.split(' ', 1)[0]
+ if string[x] == '{' and not class_open:
+ class_open = True
+ elif string[x] == '{' and class_open:
+ skip_close = True
+ elif string[x] == '}' and skip_close:
+ skip_close = False
+ elif string[x] == '}':
+ end = x
+ break
+ x += 1
+ return signature, end
+
+ # else
+ skip = False
+ while string[end] != ";":
+ if string[end] != ' ' and skip:
+ skip = False
+ signature += ' '
+ if string[end] == '\n':
+ skip = True
+ if not skip:
+ signature += string[end]
+ end += 1
+ signature += string[end]
+ # TODO: this seem a bit dirty
+ signature = signature.replace("OCIOEXPORT ", "")
+ signature = signature.replace(" throw()", "")
+ signature = signature.strip()
+ if signature[len(signature)-1] == ';':
+ signature = signature[:len(signature)-1]
+
+ # hack hack hack
+ if rst_type == "cpp:type::":
+ if signature[:7] == "typedef":
+ bits = signature.split()
+ signature = bits[len(bits)-1]
+ if signature[:4] == "enum":
+ bits = signature.split()
+ signature = bits[1]
+
+ return signature, end
+
+def getNextCommentLine(string, from_pos, buffer = ""):
+ end = from_pos
+ tmp = ""
+ while string[end] != "\n":
+ tmp += string[end]
+ end += 1
+ tmp += string[end]
+ if tmp.lstrip()[:2] == "//":
+ if tmp.lstrip()[2:][0] == " ":
+ buffer += tmp.lstrip()[3:]
+ else:
+ buffer += tmp.lstrip()[2:]
+ buffer, end = getNextCommentLine(string, end+1, buffer)
+ else:
+ end = from_pos
+ return buffer, end
+
+class Comment:
+
+ def __init__(self, comment, start, end):
+ self.comment = comment
+ self.start = start
+ self.end = end
+
+ def getRstType(self):
+ return getRstType(self.comment)
+
+ def __str__(self):
+
+ buffer = self.comment
+ for rtype in rst_types:
+ if buffer[0 : len(rtype)] == rtype:
+ buffer = buffer[len(rtype):]
+
+ buffer_lines = buffer.splitlines()
+ buffer_lines[0] = buffer_lines[0].strip()
+
+ if self.getRstType() == "rst::":
+ buffer_lines.append('')
+ buffer = '\n'.join(buffer_lines)
+ return buffer
+
+ if buffer_lines[0] != '':
+ buffer_lines.insert(0, '')
+ for x in xrange(0, len(buffer_lines)):
+ buffer_lines[x] = " %s" % buffer_lines[x]
+ buffer_lines.append('')
+ buffer = '\n'.join(buffer_lines)
+
+ return buffer
+
+def ExtractRst(string, fileh):
+
+ items = []
+
+ for item in rst_comment_regex.finditer(string):
+ start, end = item.span()
+ itemdict = item.groupdict()
+ if itemdict["single_comment"] != None:
+ ##
+ buf = itemdict["single_comment"]
+ comment, end = getNextCommentLine(string, end)
+ buf += comment
+ ##
+ items.append(Comment(buf, start, end))
+
+ elif itemdict["block_comment"] != None:
+ ##
+ itemdict["block_comment"] = \
+ itemdict["block_comment"][:len(itemdict["block_comment"])-2]
+ buf_lines = itemdict["block_comment"].splitlines()
+ indent = 0
+ if len(buf_lines) > 1:
+ for char in buf_lines[1]:
+ if char != ' ':
+ break
+ indent += 1
+ # remove indent
+ bufa = [buf_lines[0]]
+ for x in xrange(1, len(buf_lines)):
+ bufa.append(buf_lines[x][indent:])
+ buf = '\n'.join(bufa) + '\n'
+ ##
+ items.append(Comment(buf, start, end))
+
+ ##
+ fileh.write('\n')
+ namespaces = []
+ for thing in items:
+ rst_type = thing.getRstType()
+
+ # .. cpp:function:: SomeClass::func2(const char * filename, std::istream& foo)
+ # this is some of the documentation
+ # for this function
+
+ signature, end = getNextCodeLine(string, rst_type, thing.end)
+
+ # if we are a class work out the begining and end so we can
+ # give function signatures the correct namespace
+ if rst_type == "cpp:class::":
+ tmp = { 'name': signature, 'start': thing.end, 'end': end }
+ namespaces.append(tmp)
+ fileh.write(".. %s %s\n" % (rst_type, signature) )
+ elif rst_type != "rst::":
+ for namespace in namespaces:
+ if end > namespace['start'] and end < namespace['end']:
+ func = func_signature_regex.search(signature)
+ funcpart = str(func.groupdict()["sig_name"])
+ signature = signature.replace(funcpart, "%s::%s" % (namespace['name'], funcpart))
+ break
+ fileh.write(".. %s %s\n" % (rst_type, signature) )
+
+ fileh.write(str(thing))
+
+ fileh.write('\n')
+
+ fileh.flush()
+
+if __name__ == "__main__":
+
+ if not RUNTEST:
+
+ if len(sys.argv) <= 2:
+ sys.stderr.write("\nYou need to specify an input and output file\n\n")
+ sys.exit(1)
+
+ src = open(sys.argv[1]).read()
+ output = file(sys.argv[2], 'w')
+ ExtractRst(src, output)
+ output.close()
+
+ elif RUNTEST:
+ testdata = """
+
+//!rst:: -------------
+
+// this comment should be ignored
+
+//!rst:: foobar
+// this is apart of the same
+// comment
+
+// this is also ignored
+
+/* this is
+a block comment which is
+ignored */
+
+//!cpp:class::
+// this is a comment about the class
+class FooBar : public std::exception
+{
+ ...
+};
+
+/*!cpp:class::
+this is also a comment about this class
+*/
+
+
+class FooBar2 : public std::exception
+{
+ ...
+};
+
+/*!cpp:class::
+this is also a comment about this class with no new line */
+class FooBar3 : public std::exception
+{
+ ...
+};
+
+//!cpp:class::
+class SomeClass
+{
+public:
+
+ //!cpp:function::
+ // this is some cool function for
+ // some purpose
+ // this line is indented
+ static fooPtr func1();
+
+ /*!cpp:function::
+ this is a much better func for some other
+ purpose
+ this is also indented */
+ static barPtr func2();
+
+ /*!cpp:function:: this func wraps over two
+ lines which needs
+ to be caught
+ */
+ static weePtr func2(const char * filename,
+ std::istream& foo);
+};
+
+//!cpp:function:: the class namespace should still get set correctly
+void foobar1();
+
+//!cpp:class:: this is some super informative
+// docs
+class SomeClass
+{
+public:
+ //!cpp:function:: the class namespace should still get set correctly
+ void foobar2();
+};
+
+//!cpp:function:: the class namespace should still get set correctly
+void foobar3();
+
+/*!rst:: this is a rst block
+**comment which needs**
+to be supported
+*/
+
+"""
+ ExtractRst(testdata)
+
diff --git a/share/sphinx/ExtractRstFromSourceSimple.py b/share/sphinx/ExtractRstFromSourceSimple.py
new file mode 100755
index 0000000..20d1bed
--- /dev/null
+++ b/share/sphinx/ExtractRstFromSourceSimple.py
@@ -0,0 +1,110 @@
+#!/usr/bin/python
+
+"""
+Small Script to extract reStructuredText from OCIO headers
+ - http://sphinx.pocoo.org/rest.html
+ - http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html
+
+This looks for the tokens:
+
+/*+doc
+and puts everything
+inside of them
+*/
+//+doc in the RST file.
+
+"""
+
+RUNTEST = False
+import sys, os, string
+
+
+# Remove the specified number of whitespace from the start of the string
+# If non-whitespace text is encountered in the 'indent' area, it is preserved
+def _RemoveIndent(s, indent):
+ firstcharindex = s.find(s.strip())
+ startindex = min(firstcharindex, indent)
+ return s[startindex:]
+
+def ExtractRst(inputstr, ofile):
+ inMultiline = False
+ onelineDocTag = '//+doc'
+ multilineDocTag = '/*+doc'
+ multilineEndTag = '*/'
+ multilineStartIndent = 0
+ newOutputFile = False
+
+ for line in inputstr.splitlines():
+ if inMultiline:
+ if multilineEndTag in line:
+ data = line[:line.index(multilineEndTag)]
+ ofile.write(_RemoveIndent(data, multilineStartIndent) + '\n\n')
+ inMultiline = False
+ multilineStartIndent = 0
+ else:
+ ofile.write(_RemoveIndent(line, multilineStartIndent) + '\n')
+ elif onelineDocTag in line:
+ docstring = line.split('//+doc', 1)[1]
+ # TODO: Add this part to the CPP extracting script
+ if "*New File*" in docstring:
+ filename = line.split('*New File*', 1)[1].strip()
+ # Make sure that the file name is valid here
+ if newOutputFile:
+ ofile.close()
+ ofile = file(filename, 'w')
+ newOutputFile = True
+ ofile.write(docstring.strip() + '\n')
+ else:
+ if multilineDocTag in line:
+ multilineStartIndent = line.index(multilineDocTag)
+ inMultiline = True
+ # TODO: Handle code after the multiline start tag?
+
+if __name__ == "__main__":
+
+ if not RUNTEST:
+
+ if len(sys.argv) <= 2:
+ sys.stderr.write("\nYou need to specify an input and output file\n\n")
+ sys.exit(1)
+
+ src = open(sys.argv[1]).read()
+ output = file(sys.argv[2], 'w')
+ ExtractRst(src, output)
+ output.close()
+
+ elif RUNTEST:
+ #print _RemoveIndent('',4)
+ #print _RemoveIndent('sfdfsd',4)
+ #print _RemoveIndent(' sfdfsd',4)
+ #print _RemoveIndent(' sfdfsd',4)
+
+ testdata = """
+
+#include <...>
+
+void Random C++ Code
+
+//+doc Some one-line doc. Everything on the line after the onelineDocTag gets added.
+
+/*+doc What should this do?
+!rst::This is a multi-line rst text
+
+there is a blank line above this
+ this is before the final endtag */
+
+class TestClass
+ /*+doc What should this do?
+ !rst::additional rst indented code
+ more indented code
+This is left indented
+ This is original indent
+ This is indented 4 spaces
+ */
+
+
+
+
+"""
+ ExtractRst(testdata, sys.stdout)
+
diff --git a/src/aftereffects/DrawbotBot.cpp b/src/aftereffects/DrawbotBot.cpp
new file mode 100644
index 0000000..3d6cee6
--- /dev/null
+++ b/src/aftereffects/DrawbotBot.cpp
@@ -0,0 +1,239 @@
+/*
+Copyright (c) 2003-2012 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#include "DrawbotBot.h"
+
+
+DrawbotBot::DrawbotBot(struct SPBasicSuite *pica_basicP, PF_ContextH contextH, A_long appl_id) :
+ suites(pica_basicP),
+ _appl_id(appl_id),
+ _suiteP(NULL),
+ _drawbot_ref(NULL),
+ _supplier_ref(NULL),
+ _surface_ref(NULL)
+{
+ suites.EffectCustomUISuite1()->PF_GetDrawingReference(contextH, &_drawbot_ref);
+
+ _suiteP = suites.SupplierSuiteCurrent();
+
+ suites.DrawbotSuiteCurrent()->GetSupplier(_drawbot_ref, &_supplier_ref);
+ suites.DrawbotSuiteCurrent()->GetSurface(_drawbot_ref, &_surface_ref);
+
+ _brush_pos.x = 0.f;
+ _brush_pos.y = 0.f;
+
+ SetColor(PF_App_Color_TEXT);
+
+ _suiteP->GetDefaultFontSize(_supplier_ref, &_font_size);
+}
+
+
+DrawbotBot::~DrawbotBot()
+{
+
+}
+
+
+void DrawbotBot::SetColor(PF_App_ColorType color, float a)
+{
+ if(_appl_id == 'FXTC')
+ {
+ PF_App_Color app_color;
+
+ suites.AppSuite4()->PF_AppGetColor(color, &app_color);
+
+ _brush_color.red = (float)app_color.red / (float)PF_MAX_CHAN16;
+ _brush_color.green = (float)app_color.green / (float)PF_MAX_CHAN16;
+ _brush_color.blue = (float)app_color.blue / (float)PF_MAX_CHAN16;
+ }
+ else
+ {
+ // Premiere isn't doing this properly, so I'll have to.
+ // Only supporting the colors I'm actually using at the moment.
+ switch(color)
+ {
+ case PF_App_Color_BLACK:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 0.f;
+ break;
+
+ case PF_App_Color_WHITE:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 1.f;
+ break;
+
+ case PF_App_Color_RED:
+ _brush_color.red = 1.f;
+ _brush_color.green = _brush_color.blue = 0.f;
+ break;
+
+ case PF_App_Color_TEXT_DISABLED:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 0.6f;
+ break;
+
+ case PF_App_Color_SHADOW:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 0.3f;
+ break;
+
+ case PF_App_Color_HILITE:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 0.8f;
+ break;
+
+ case PF_App_Color_LIGHT_TINGE:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 0.7f;
+ break;
+
+ case PF_App_Color_BUTTON_FILL:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 0.5f;
+ break;
+
+ case PF_App_Color_BUTTON_PRESSED_FILL:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 0.3f;
+ break;
+
+ case PF_App_Color_PANEL_BACKGROUND:
+ {
+ PF_App_Color app_color;
+ suites.AppSuite4()->PF_AppGetBgColor(&app_color);
+
+ _brush_color.red = (float)app_color.red / (float)65535;
+ _brush_color.green = (float)app_color.green / (float)65535;
+ _brush_color.blue = (float)app_color.blue / (float)65535;
+ }
+ break;
+
+ default:
+ _brush_color.red = _brush_color.green = _brush_color.blue = 0.9f;
+ break;
+ }
+ }
+
+ _brush_color.alpha = a;
+}
+
+
+void DrawbotBot::DrawLineTo(float x, float y, float brush_size)
+{
+ DRAWBOT_PathP pathP(_suiteP, _supplier_ref);
+ DRAWBOT_PenP penP(_suiteP, _supplier_ref, &_brush_color, brush_size);
+
+ suites.PathSuiteCurrent()->MoveTo(pathP.Get(), _brush_pos.x, _brush_pos.y);
+
+ suites.PathSuiteCurrent()->LineTo(pathP.Get(), x, y);
+
+ suites.SurfaceSuiteCurrent()->StrokePath(_surface_ref, penP.Get(), pathP.Get());
+
+ MoveTo(x, y);
+}
+
+
+void DrawbotBot::DrawRect(float w, float h, float brush_size) const
+{
+ DRAWBOT_PathP pathP(_suiteP, _supplier_ref);
+ DRAWBOT_PenP penP(_suiteP, _supplier_ref, &_brush_color, brush_size);
+
+ DRAWBOT_RectF32 rect;
+
+ rect.left = _brush_pos.x - 0.5f;
+ rect.top = _brush_pos.y - 0.5f;
+ rect.width = w;
+ rect.height = h;
+
+ suites.PathSuiteCurrent()->AddRect(pathP.Get(), &rect);
+
+ suites.SurfaceSuiteCurrent()->StrokePath(_surface_ref, penP.Get(), pathP.Get());
+}
+
+void DrawbotBot::PaintRect(float w, float h) const
+{
+ DRAWBOT_RectF32 rect;
+
+ rect.left = _brush_pos.x;
+ rect.top = _brush_pos.y;
+ rect.width = w;
+ rect.height = h;
+
+ suites.SurfaceSuiteCurrent()->PaintRect(_surface_ref, &_brush_color, &rect);
+}
+
+
+void DrawbotBot::PaintTriangle(float w, float h) const
+{
+ DRAWBOT_PathP pathP(_suiteP, _supplier_ref);
+ DRAWBOT_BrushP brushP(_suiteP, _supplier_ref, &_brush_color);
+
+ suites.PathSuiteCurrent()->MoveTo(pathP.Get(), _brush_pos.x, _brush_pos.y);
+
+ suites.PathSuiteCurrent()->LineTo(pathP.Get(), _brush_pos.x + w, _brush_pos.y);
+
+ suites.PathSuiteCurrent()->LineTo(pathP.Get(), _brush_pos.x + (w / 2.f),
+ _brush_pos.y + h);
+
+ suites.PathSuiteCurrent()->Close(pathP.Get());
+
+ suites.SurfaceSuiteCurrent()->FillPath(_surface_ref, brushP.Get(), pathP.Get(),
+ kDRAWBOT_FillType_Default);
+}
+
+
+void DrawbotBot::DrawString(
+ const DRAWBOT_UTF16Char *str,
+ DRAWBOT_TextAlignment align,
+ DRAWBOT_TextTruncation truncate,
+ float truncation_width) const
+{
+ DRAWBOT_BrushP brushP(_suiteP, _supplier_ref, &_brush_color);
+ DRAWBOT_FontP fontP(_suiteP, _supplier_ref, _font_size);
+
+ suites.SurfaceSuiteCurrent()->DrawString(_surface_ref, brushP.Get(), fontP.Get(), str,
+ &_brush_pos, align, truncate, truncation_width);
+}
+
+
+void DrawbotBot::DrawString(
+ const char *str,
+ DRAWBOT_TextAlignment align,
+ DRAWBOT_TextTruncation truncate,
+ float truncation_width) const
+{
+ DRAWBOT_UTF16Char u_str[256] = {'\0'};
+
+ DRAWBOT_UTF16Char *u = u_str;
+ const char *c = str;
+
+ if(*c != '\0')
+ {
+ do{
+ *u++ = *c++;
+
+ }while(*c != '\0');
+
+ *u = '\0';
+ }
+
+ DrawString(u_str, align, truncate, truncation_width);
+} \ No newline at end of file
diff --git a/src/aftereffects/DrawbotBot.h b/src/aftereffects/DrawbotBot.h
new file mode 100644
index 0000000..bd55ace
--- /dev/null
+++ b/src/aftereffects/DrawbotBot.h
@@ -0,0 +1,89 @@
+/*
+Copyright (c) 2003-2012 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#ifndef _DRAWBOTBOT_H_
+#define _DRAWBOTBOT_H_
+
+#include "AEGP_SuiteHandler.h"
+
+
+class DrawbotBot
+{
+ public:
+
+ DrawbotBot(struct SPBasicSuite *pica_basicP, PF_ContextH contextH, A_long appl_id);
+ ~DrawbotBot();
+
+ void MoveTo(DRAWBOT_PointF32 pos) { _brush_pos = pos; }
+ void MoveTo(float x, float y) { _brush_pos.x = x; _brush_pos.y = y; }
+ void Move(float x = 0, float y = 0) { _brush_pos.x += x; _brush_pos.y += y; }
+
+ void SetColor(PF_App_ColorType color, float a = 1.f);
+ void SetColor(DRAWBOT_ColorRGBA color) { _brush_color = color; }
+ void SetColor(float r, float g, float b, float a = 1.f)
+ { _brush_color.red = r; _brush_color.green = g;
+ _brush_color.blue = b; _brush_color.alpha = a; }
+
+ DRAWBOT_PointF32 Pos() const { return _brush_pos; }
+ float FontSize() const { return _font_size; }
+
+ void DrawLineTo(float x, float y, float brush_size = 0.5f);
+
+ void DrawRect(float w, float h, float brush_size = 0.5f) const;
+ void PaintRect(float w, float h) const;
+
+ void PaintTriangle(float w, float h) const;
+
+ void DrawString(const DRAWBOT_UTF16Char *str,
+ DRAWBOT_TextAlignment align = kDRAWBOT_TextAlignment_Default,
+ DRAWBOT_TextTruncation truncate = kDRAWBOT_TextTruncation_None,
+ float truncation_width = 0.f) const;
+ void DrawString(const char *str,
+ DRAWBOT_TextAlignment align = kDRAWBOT_TextAlignment_Default,
+ DRAWBOT_TextTruncation truncate = kDRAWBOT_TextTruncation_None,
+ float truncation_width = 0.f) const;
+
+
+ private:
+ AEGP_SuiteHandler suites;
+ A_long _appl_id;
+
+ DRAWBOT_SupplierSuiteCurrent *_suiteP;
+
+ DRAWBOT_DrawRef _drawbot_ref;
+ DRAWBOT_SupplierRef _supplier_ref;
+ DRAWBOT_SurfaceRef _surface_ref;
+
+ DRAWBOT_PointF32 _brush_pos;
+ DRAWBOT_ColorRGBA _brush_color;
+ float _font_size;
+};
+
+
+#endif // _DRAWBOTBOT_H_ \ No newline at end of file
diff --git a/src/aftereffects/OpenColorIO_AE.cpp b/src/aftereffects/OpenColorIO_AE.cpp
new file mode 100755
index 0000000..cd89091
--- /dev/null
+++ b/src/aftereffects/OpenColorIO_AE.cpp
@@ -0,0 +1,1133 @@
+/*
+Copyright (c) 2003-2012 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#include "OpenColorIO_AE.h"
+
+#include "OpenColorIO_AE_Context.h"
+#include "OpenColorIO_AE_Dialogs.h"
+
+#include "AEGP_SuiteHandler.h"
+
+// this lives in OpenColorIO_AE_UI.cpp
+std::string GetProjectDir(PF_InData *in_data);
+
+
+static PF_Err About(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output )
+{
+ PF_SPRINTF( out_data->return_msg,
+ "OpenColorIO\r\r"
+ "opencolorio.org\r"
+ "version %s",
+ OCIO::GetVersion() );
+
+ return PF_Err_NONE;
+}
+
+
+static PF_Err GlobalSetup(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output )
+{
+ out_data->my_version = PF_VERSION( MAJOR_VERSION,
+ MINOR_VERSION,
+ BUG_VERSION,
+ STAGE_VERSION,
+ BUILD_VERSION);
+
+ out_data->out_flags = PF_OutFlag_DEEP_COLOR_AWARE |
+ PF_OutFlag_PIX_INDEPENDENT |
+ PF_OutFlag_CUSTOM_UI |
+ PF_OutFlag_USE_OUTPUT_EXTENT |
+ PF_OutFlag_I_HAVE_EXTERNAL_DEPENDENCIES;
+
+ out_data->out_flags2 = PF_OutFlag2_PARAM_GROUP_START_COLLAPSED_FLAG |
+ PF_OutFlag2_SUPPORTS_SMART_RENDER |
+ PF_OutFlag2_FLOAT_COLOR_AWARE |
+ PF_OutFlag2_PPRO_DO_NOT_CLONE_SEQUENCE_DATA_FOR_RENDER;
+
+
+ GlobalSetup_GL();
+
+
+ if(in_data->appl_id == 'PrMr')
+ {
+ PF_PixelFormatSuite1 *pfS = NULL;
+
+ in_data->pica_basicP->AcquireSuite(kPFPixelFormatSuite,
+ kPFPixelFormatSuiteVersion1,
+ (const void **)&pfS);
+
+ if(pfS)
+ {
+ pfS->ClearSupportedPixelFormats(in_data->effect_ref);
+
+ pfS->AddSupportedPixelFormat(in_data->effect_ref,
+ PrPixelFormat_BGRA_4444_32f_Linear);
+
+ in_data->pica_basicP->ReleaseSuite(kPFPixelFormatSuite,
+ kPFPixelFormatSuiteVersion1);
+ }
+ }
+
+ return PF_Err_NONE;
+}
+
+
+static PF_Err GlobalSetdown(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output )
+{
+ GlobalSetdown_GL();
+
+ return PF_Err_NONE;
+}
+
+
+static PF_Err ParamsSetup(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output)
+{
+ PF_Err err = PF_Err_NONE;
+ PF_ParamDef def;
+
+
+ // readout
+ AEFX_CLR_STRUCT(def);
+ // we can time_vary once we're willing to print and scan ArbData text
+ def.flags = PF_ParamFlag_CANNOT_TIME_VARY;
+
+ ArbNewDefault(in_data, out_data, NULL, &def.u.arb_d.dephault);
+
+ PF_ADD_ARBITRARY("OCIO",
+ UI_CONTROL_WIDTH,
+ UI_CONTROL_HEIGHT,
+ PF_PUI_CONTROL,
+ def.u.arb_d.dephault,
+ OCIO_DATA,
+ NULL);
+
+
+ AEFX_CLR_STRUCT(def);
+ PF_ADD_CHECKBOX("",
+ "Use GPU",
+ FALSE,
+ 0,
+ OCIO_GPU_ID);
+
+
+ out_data->num_params = OCIO_NUM_PARAMS;
+
+ // register custom UI
+ if (!err)
+ {
+ PF_CustomUIInfo ci;
+
+ AEFX_CLR_STRUCT(ci);
+
+ ci.events = PF_CustomEFlag_EFFECT;
+
+ ci.comp_ui_width = ci.comp_ui_height = 0;
+ ci.comp_ui_alignment = PF_UIAlignment_NONE;
+
+ ci.layer_ui_width = 0;
+ ci.layer_ui_height = 0;
+ ci.layer_ui_alignment = PF_UIAlignment_NONE;
+
+ ci.preview_ui_width = 0;
+ ci.preview_ui_height = 0;
+ ci.layer_ui_alignment = PF_UIAlignment_NONE;
+
+ err = (*(in_data->inter.register_ui))(in_data->effect_ref, &ci);
+ }
+
+
+ return err;
+}
+
+static PF_Err SequenceSetup(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output )
+{
+ PF_Err err = PF_Err_NONE;
+
+ SequenceData *seq_data = NULL;
+
+ // set up sequence data
+ if( (in_data->sequence_data == NULL) )
+ {
+ out_data->sequence_data = PF_NEW_HANDLE( sizeof(SequenceData) );
+
+ seq_data = (SequenceData *)PF_LOCK_HANDLE(out_data->sequence_data);
+
+ seq_data->path[0] = '\0';
+ seq_data->relative_path[0] = '\0';
+ }
+ else // reset pre-existing sequence data
+ {
+ if( PF_GET_HANDLE_SIZE(in_data->sequence_data) != sizeof(SequenceData) )
+ {
+ PF_RESIZE_HANDLE(sizeof(SequenceData), &in_data->sequence_data);
+ }
+
+ seq_data = (SequenceData *)PF_LOCK_HANDLE(in_data->sequence_data);
+ }
+
+
+ seq_data->status = STATUS_UNKNOWN;
+ seq_data->gpu_err = GPU_ERR_NONE;
+ seq_data->prem_status = PREMIERE_UNKNOWN;
+ seq_data->context = NULL;
+
+
+ PF_UNLOCK_HANDLE(in_data->sequence_data);
+
+ return err;
+}
+
+
+static PF_Err SequenceSetdown(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output )
+{
+ PF_Err err = PF_Err_NONE;
+
+ if(in_data->sequence_data)
+ {
+ SequenceData *seq_data = (SequenceData *)PF_LOCK_HANDLE(out_data->sequence_data);
+
+ if(seq_data->context)
+ {
+ delete seq_data->context;
+
+ seq_data->status = STATUS_UNKNOWN;
+ seq_data->gpu_err = GPU_ERR_NONE;
+ seq_data->prem_status = PREMIERE_UNKNOWN;
+ seq_data->context = NULL;
+ }
+
+ PF_DISPOSE_HANDLE(in_data->sequence_data);
+ }
+
+ return err;
+}
+
+
+static PF_Err SequenceFlatten(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output )
+{
+ PF_Err err = PF_Err_NONE;
+
+ if(in_data->sequence_data)
+ {
+ SequenceData *seq_data = (SequenceData *)PF_LOCK_HANDLE(in_data->sequence_data);
+
+ if(seq_data->context)
+ {
+ delete seq_data->context;
+
+ seq_data->status = STATUS_UNKNOWN;
+ seq_data->gpu_err = GPU_ERR_NONE;
+ seq_data->prem_status = PREMIERE_UNKNOWN;
+ seq_data->context = NULL;
+ }
+
+ PF_UNLOCK_HANDLE(in_data->sequence_data);
+ }
+
+ return err;
+}
+
+
+
+static PF_Boolean IsEmptyRect(const PF_LRect *r){
+ return (r->left >= r->right) || (r->top >= r->bottom);
+}
+
+#ifndef mmin
+ #define mmin(a,b) ((a) < (b) ? (a) : (b))
+ #define mmax(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+
+static void UnionLRect(const PF_LRect *src, PF_LRect *dst)
+{
+ if (IsEmptyRect(dst)) {
+ *dst = *src;
+ } else if (!IsEmptyRect(src)) {
+ dst->left = mmin(dst->left, src->left);
+ dst->top = mmin(dst->top, src->top);
+ dst->right = mmax(dst->right, src->right);
+ dst->bottom = mmax(dst->bottom, src->bottom);
+ }
+}
+
+
+static PF_Err PreRender(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_PreRenderExtra *extra)
+{
+ PF_Err err = PF_Err_NONE;
+ PF_RenderRequest req = extra->input->output_request;
+ PF_CheckoutResult in_result;
+
+ req.preserve_rgb_of_zero_alpha = TRUE;
+
+ ERR(extra->cb->checkout_layer( in_data->effect_ref,
+ OCIO_INPUT,
+ OCIO_INPUT,
+ &req,
+ in_data->current_time,
+ in_data->time_step,
+ in_data->time_scale,
+ &in_result));
+
+
+ UnionLRect(&in_result.result_rect, &extra->output->result_rect);
+ UnionLRect(&in_result.max_result_rect, &extra->output->max_result_rect);
+
+ return err;
+}
+
+#pragma mark-
+
+
+template <typename InFormat, typename OutFormat>
+static inline OutFormat Convert(InFormat in);
+
+template <>
+static inline float Convert<A_u_char, float>(A_u_char in)
+{
+ return (float)in / (float)PF_MAX_CHAN8;
+}
+
+template <>
+static inline float Convert<A_u_short, float>(A_u_short in)
+{
+ return (float)in / (float)PF_MAX_CHAN16;
+}
+
+template <>
+static inline float Convert<float, float>(float in)
+{
+ return in;
+}
+
+static inline float Clamp(float in)
+{
+ return (in > 1.f ? 1.f : in < 0.f ? 0.f : in);
+}
+
+template <>
+static inline A_u_char Convert<float, A_u_char>(float in)
+{
+ return ( Clamp(in) * (float)PF_MAX_CHAN8 ) + 0.5f;
+}
+
+template <>
+static inline A_u_short Convert<float, A_u_short>(float in)
+{
+ return ( Clamp(in) * (float)PF_MAX_CHAN16 ) + 0.5f;
+}
+
+
+
+typedef struct {
+ PF_InData *in_data;
+ void *in_buffer;
+ A_long in_rowbytes;
+ void *out_buffer;
+ A_long out_rowbytes;
+ int width;
+} IterateData;
+
+template <typename InFormat, typename OutFormat>
+static PF_Err CopyWorld_Iterate(
+ void *refconPV,
+ A_long thread_indexL,
+ A_long i,
+ A_long iterationsL)
+{
+ PF_Err err = PF_Err_NONE;
+
+ IterateData *i_data = (IterateData *)refconPV;
+ PF_InData *in_data = i_data->in_data;
+
+ InFormat *in_pix = (InFormat *)((char *)i_data->in_buffer + (i * i_data->in_rowbytes));
+ OutFormat *out_pix = (OutFormat *)((char *)i_data->out_buffer + (i * i_data->out_rowbytes));
+
+#ifdef NDEBUG
+ if(thread_indexL == 0)
+ err = PF_ABORT(in_data);
+#endif
+
+ for(int x=0; x < i_data->width; x++)
+ {
+ *out_pix++ = Convert<InFormat, OutFormat>( *in_pix++ );
+ }
+
+ return err;
+}
+
+
+typedef struct {
+ PF_InData *in_data;
+ void *in_buffer;
+ A_long in_rowbytes;
+ int width;
+} SwapData;
+
+static PF_Err Swap_Iterate(
+ void *refconPV,
+ A_long thread_indexL,
+ A_long i,
+ A_long iterationsL)
+{
+ PF_Err err = PF_Err_NONE;
+
+ SwapData *i_data = (SwapData *)refconPV;
+ PF_InData *in_data = i_data->in_data;
+
+ PF_PixelFloat *pix = (PF_PixelFloat *)((char *)i_data->in_buffer + (i * i_data->in_rowbytes));
+
+#ifdef NDEBUG
+ if(thread_indexL == 0)
+ err = PF_ABORT(in_data);
+#endif
+
+ for(int x=0; x < i_data->width; x++)
+ {
+ float temp;
+
+ // BGRA -> ARGB
+ temp = pix->alpha; // BGRA temp B
+ pix->alpha = pix->blue; // AGRA temp B
+ pix->blue = temp; // AGRB temp B
+ temp = pix->red; // AGRB temp G
+ pix->red = pix->green; // ARRB temp G
+ pix->green = temp; // ARGB temp G
+
+ pix++;
+ }
+
+ return err;
+}
+
+
+typedef struct {
+ PF_InData *in_data;
+ void *buffer;
+ A_long rowbytes;
+ int width;
+ OpenColorIO_AE_Context *context;
+} ProcessData;
+
+static PF_Err Process_Iterate(
+ void *refconPV,
+ A_long thread_indexL,
+ A_long i,
+ A_long iterationsL)
+{
+ PF_Err err = PF_Err_NONE;
+
+ ProcessData *i_data = (ProcessData *)refconPV;
+ PF_InData *in_data = i_data->in_data;
+
+ PF_PixelFloat *pix = (PF_PixelFloat *)((char *)i_data->buffer + (i * i_data->rowbytes));
+
+#ifdef NDEBUG
+ if(thread_indexL == 0)
+ err = PF_ABORT(in_data);
+#endif
+
+ try
+ {
+ float *rOut = &pix->red;
+
+ OCIO::PackedImageDesc img(rOut, i_data->width, 1, 4);
+
+ i_data->context->processor()->apply(img);
+ }
+ catch(...)
+ {
+ err = PF_Err_INTERNAL_STRUCT_DAMAGED;
+ }
+
+
+ return err;
+}
+
+
+// two functions below to get Premiere to run my functions multi-threaded
+// because they couldn't bother to give me PF_Iterate8Suite1->iterate_generic
+
+typedef PF_Err (*GenericIterator)(void *refconPV,
+ A_long thread_indexL,
+ A_long i,
+ A_long iterationsL);
+
+typedef struct {
+ PF_InData *in_data;
+ GenericIterator fn_func;
+ void *refconPV;
+ A_long height;
+} FakeData;
+
+static PF_Err MyFakeIterator(
+ void *refcon,
+ A_long x,
+ A_long y,
+ PF_Pixel *in,
+ PF_Pixel *out)
+{
+ PF_Err err = PF_Err_NONE;
+
+ FakeData *i_data = (FakeData *)refcon;
+ PF_InData *in_data = i_data->in_data;
+
+ err = i_data->fn_func(i_data->refconPV, 1, y, i_data->height);
+
+ return err;
+}
+
+typedef PF_Err (*GenericIterateFunc)(
+ A_long iterationsL,
+ void *refconPV,
+ GenericIterator fn_func);
+
+static PF_Err MyGenericIterateFunc(
+ A_long iterationsL,
+ void *refconPV,
+ GenericIterator fn_func)
+{
+ PF_Err err = PF_Err_NONE;
+
+ PF_InData **in_dataH = (PF_InData **)refconPV; // always put PF_InData first
+ PF_InData *in_data = *in_dataH;
+
+ PF_Iterate8Suite1 *i8sP = NULL;
+ in_data->pica_basicP->AcquireSuite(kPFIterate8Suite, kPFIterate8SuiteVersion1, (const void **)&i8sP);
+
+ if(i8sP && i8sP->iterate)
+ {
+ PF_EffectWorld fake_world;
+ PF_NEW_WORLD(1, iterationsL, PF_NewWorldFlag_NONE, &fake_world);
+
+
+ FakeData i_data = { in_data, fn_func, refconPV, iterationsL };
+
+ err = i8sP->iterate(in_data, 0, iterationsL, &fake_world, NULL,
+ (void *)&i_data, MyFakeIterator, &fake_world);
+
+
+ PF_DISPOSE_WORLD(&fake_world);
+
+ in_data->pica_basicP->ReleaseSuite(kPFIterate8Suite, kPFIterate8SuiteVersion1);
+ }
+ else
+ {
+ for(int i=0; i < iterationsL && !err; i++)
+ {
+ err = fn_func(refconPV, 0, i, iterationsL);
+ }
+ }
+
+ return err;
+}
+
+
+static PF_Err DoRender(
+ PF_InData *in_data,
+ PF_EffectWorld *input,
+ PF_ParamDef *OCIO_data,
+ PF_ParamDef *OCIO_gpu,
+ PF_OutData *out_data,
+ PF_EffectWorld *output)
+{
+ PF_Err err = PF_Err_NONE;
+
+ AEGP_SuiteHandler suites(in_data->pica_basicP);
+
+ PF_PixelFormatSuite1 *pfS = NULL;
+ PF_WorldSuite2 *wsP = NULL;
+
+ err = in_data->pica_basicP->AcquireSuite(kPFPixelFormatSuite, kPFPixelFormatSuiteVersion1, (const void **)&pfS);
+ err = in_data->pica_basicP->AcquireSuite(kPFWorldSuite, kPFWorldSuiteVersion2, (const void **)&wsP);
+
+ if(!err)
+ {
+ ArbitraryData *arb_data = (ArbitraryData *)PF_LOCK_HANDLE(OCIO_data->u.arb_d.value);
+ SequenceData *seq_data = (SequenceData *)PF_LOCK_HANDLE(in_data->sequence_data);
+
+ try
+ {
+ seq_data->status = STATUS_OK;
+
+ std::string dir = GetProjectDir(in_data);
+
+ // must always verify that our context lines up with the parameters
+ // things like undo can change them without notice
+ if(seq_data->context != NULL)
+ {
+ bool verified = seq_data->context->Verify(arb_data, dir);
+
+ if(!verified)
+ {
+ delete seq_data->context;
+
+ seq_data->status = STATUS_UNKNOWN;
+ seq_data->context = NULL;
+ }
+ }
+
+
+ if(arb_data->action == OCIO_ACTION_NONE)
+ {
+ seq_data->status = STATUS_NO_FILE;
+ }
+ else if(seq_data->context == NULL)
+ {
+ seq_data->source = arb_data->source;
+
+ if(arb_data->source == OCIO_SOURCE_ENVIRONMENT)
+ {
+ char *file = std::getenv("OCIO");
+
+ if(file == NULL)
+ seq_data->status = STATUS_FILE_MISSING;
+ }
+ else if(arb_data->source == OCIO_SOURCE_STANDARD)
+ {
+ std::string path = GetStdConfigPath(arb_data->path);
+
+ if( path.empty() )
+ {
+ seq_data->status = STATUS_FILE_MISSING;
+ }
+ else
+ {
+ strncpy(seq_data->path, arb_data->path, ARB_PATH_LEN);
+ strncpy(seq_data->relative_path, arb_data->relative_path, ARB_PATH_LEN);
+ }
+ }
+ else if(arb_data->source == OCIO_SOURCE_CUSTOM)
+ {
+ Path absolute_path(arb_data->path, dir);
+ Path relative_path(arb_data->relative_path, dir);
+ Path seq_absolute_path(seq_data->path, dir);
+ Path seq_relative_path(seq_data->relative_path, dir);
+
+ if( absolute_path.exists() )
+ {
+ seq_data->status = STATUS_USING_ABSOLUTE;
+
+ strncpy(seq_data->path, absolute_path.full_path().c_str(), ARB_PATH_LEN);
+ strncpy(seq_data->relative_path, absolute_path.relative_path(false).c_str(), ARB_PATH_LEN);
+ }
+ else if( relative_path.exists() )
+ {
+ seq_data->status = STATUS_USING_RELATIVE;
+
+ strncpy(seq_data->path, relative_path.full_path().c_str(), ARB_PATH_LEN);
+ strncpy(seq_data->relative_path, relative_path.relative_path(false).c_str(), ARB_PATH_LEN);
+ }
+ else if( seq_absolute_path.exists() )
+ {
+ // In some cases, we may have a good path in sequence options but not in
+ // the arbitrary parameter. An alert will not be provided because it is the
+ // sequence options that get checked. Therefore, we have to use the sequence
+ // options as a last resort. We copy the path back to arb data, but the change
+ // should not stick.
+ seq_data->status = STATUS_USING_ABSOLUTE;
+
+ strncpy(arb_data->path, seq_absolute_path.full_path().c_str(), ARB_PATH_LEN);
+ strncpy(arb_data->relative_path, seq_absolute_path.relative_path(false).c_str(), ARB_PATH_LEN);
+ }
+ else if( seq_relative_path.exists() )
+ {
+ seq_data->status = STATUS_USING_RELATIVE;
+
+ strncpy(arb_data->path, seq_relative_path.full_path().c_str(), ARB_PATH_LEN);
+ strncpy(arb_data->relative_path, seq_relative_path.relative_path(false).c_str(), ARB_PATH_LEN);
+ }
+ else
+ seq_data->status = STATUS_FILE_MISSING;
+ }
+
+
+ if(seq_data->status != STATUS_FILE_MISSING)
+ {
+ seq_data->context = new OpenColorIO_AE_Context(arb_data, dir);
+ }
+ }
+ }
+ catch(...)
+ {
+ seq_data->status = STATUS_OCIO_ERROR;
+ }
+
+
+ if(seq_data->status == STATUS_FILE_MISSING || seq_data->status == STATUS_OCIO_ERROR)
+ {
+ err = PF_Err_INTERNAL_STRUCT_DAMAGED;
+ }
+
+
+ if(!err)
+ {
+ if(seq_data->context == NULL || seq_data->context->processor()->isNoOp())
+ {
+ err = PF_COPY(input, output, NULL, NULL);
+ }
+ else
+ {
+ GenericIterateFunc iterate_generic = suites.Iterate8Suite1()->iterate_generic;
+
+ if(iterate_generic == NULL)
+ iterate_generic = MyGenericIterateFunc; // thanks a lot, Premiere
+
+ // OpenColorIO only does float worlds
+ // might have to create one
+ PF_EffectWorld *float_world = NULL;
+
+ PF_EffectWorld temp_world_data;
+ PF_EffectWorld *temp_world = NULL;
+ PF_Handle temp_worldH = NULL;
+
+
+ PF_PixelFormat format;
+ wsP->PF_GetPixelFormat(output, &format);
+
+ if(in_data->appl_id == 'PrMr' && pfS)
+ {
+ // the regular world suite function will give a bogus value for Premiere
+ pfS->GetPixelFormat(output, (PrPixelFormat *)&format);
+
+ seq_data->prem_status = (format == PrPixelFormat_BGRA_4444_32f_Linear ?
+ PREMIERE_LINEAR : PREMIERE_NON_LINEAR);
+ }
+
+
+ A_Boolean use_gpu = OCIO_gpu->u.bd.value;
+ seq_data->gpu_err = GPU_ERR_NONE;
+ A_long non_padded_rowbytes = sizeof(PF_PixelFloat) * output->width;
+
+
+ if(format == PF_PixelFormat_ARGB128 &&
+ (!use_gpu || output->rowbytes == non_padded_rowbytes)) // GPU doesn't do padding
+ {
+ err = PF_COPY(input, output, NULL, NULL);
+
+ float_world = output;
+ }
+ else
+ {
+ temp_worldH = PF_NEW_HANDLE(non_padded_rowbytes * (output->height + 1)); // little extra because we go over by a channel
+
+ if(temp_worldH)
+ {
+ temp_world_data.data = (PF_PixelPtr)PF_LOCK_HANDLE(temp_worldH);
+
+ temp_world_data.width = output->width;
+ temp_world_data.height = output->height;
+ temp_world_data.rowbytes = non_padded_rowbytes;
+
+ float_world = temp_world = &temp_world_data;
+
+ // convert to new temp float world
+ IterateData i_data = { in_data, input->data, input->rowbytes,
+ float_world->data, float_world->rowbytes,
+ float_world->width * 4 };
+
+ if(format == PF_PixelFormat_ARGB32 || format == PrPixelFormat_BGRA_4444_8u)
+ {
+ err = iterate_generic(float_world->height, &i_data,
+ CopyWorld_Iterate<A_u_char, float>);
+ }
+ else if(format == PF_PixelFormat_ARGB64)
+ {
+ err = iterate_generic(float_world->height, &i_data,
+ CopyWorld_Iterate<A_u_short, float>);
+ }
+ else if(format == PF_PixelFormat_ARGB128 ||
+ format == PrPixelFormat_BGRA_4444_32f ||
+ format == PrPixelFormat_BGRA_4444_32f_Linear)
+ {
+ err = iterate_generic(float_world->height, &i_data,
+ CopyWorld_Iterate<float, float>);
+ }
+
+ // switch BGRA to ARGB for premiere
+ if(!err &&
+ (format == PrPixelFormat_BGRA_4444_8u ||
+ format == PrPixelFormat_BGRA_4444_32f_Linear ||
+ format == PrPixelFormat_BGRA_4444_32f))
+ {
+ SwapData s_data = { in_data, float_world->data,
+ float_world->rowbytes, float_world->width };
+
+ err = iterate_generic(float_world->height, &s_data,
+ Swap_Iterate);
+ }
+ }
+ else
+ err = PF_Err_OUT_OF_MEMORY;
+ }
+
+
+ if(!err)
+ {
+ bool gpu_rendered = false;
+
+ // OpenColorIO processing
+ if(use_gpu)
+ {
+ if( HaveOpenGL() )
+ {
+ gpu_rendered = seq_data->context->ProcessWorldGL(float_world);
+
+ if(!gpu_rendered)
+ seq_data->gpu_err = GPU_ERR_RENDER_ERR;
+ }
+ else
+ seq_data->gpu_err = GPU_ERR_INSUFFICIENT;
+ }
+
+ if(!gpu_rendered)
+ {
+ ProcessData p_data = { in_data,
+ float_world->data,
+ float_world->rowbytes,
+ float_world->width,
+ seq_data->context };
+
+ err = iterate_generic(float_world->height, &p_data, Process_Iterate);
+ }
+ }
+
+
+ // copy back to non-float world and dispose
+ if(temp_world)
+ {
+ if(!err &&
+ (format == PrPixelFormat_BGRA_4444_8u ||
+ format == PrPixelFormat_BGRA_4444_32f_Linear ||
+ format == PrPixelFormat_BGRA_4444_32f))
+ {
+ SwapData s_data = { in_data, float_world->data,
+ float_world->rowbytes, float_world->width };
+
+ err = iterate_generic(float_world->height, &s_data, Swap_Iterate);
+ }
+
+ if(!err)
+ {
+ IterateData i_data = { in_data, float_world->data,
+ float_world->rowbytes, output->data,
+ output->rowbytes, output->width * 4 };
+
+ if(format == PF_PixelFormat_ARGB32 || format == PrPixelFormat_BGRA_4444_8u)
+ {
+ err = iterate_generic(output->height, &i_data,
+ CopyWorld_Iterate<float, A_u_char>);
+ }
+ else if(format == PF_PixelFormat_ARGB64)
+ {
+ err = iterate_generic(output->height, &i_data,
+ CopyWorld_Iterate<float, A_u_short>);
+ }
+ else if(format == PF_PixelFormat_ARGB128 ||
+ format == PrPixelFormat_BGRA_4444_32f ||
+ format == PrPixelFormat_BGRA_4444_32f_Linear)
+ {
+ err = iterate_generic(output->height, &i_data,
+ CopyWorld_Iterate<float, float>);
+ }
+
+ }
+
+ PF_DISPOSE_HANDLE(temp_worldH);
+ }
+
+
+ PF_UNLOCK_HANDLE(OCIO_data->u.arb_d.value);
+ PF_UNLOCK_HANDLE(in_data->sequence_data);
+
+
+ if(seq_data->gpu_err == GPU_ERR_INSUFFICIENT)
+ {
+ suites.AdvAppSuite2()->PF_AppendInfoText("OpenColorIO: GPU Insufficient");
+ }
+ else if(seq_data->gpu_err == GPU_ERR_RENDER_ERR)
+ {
+ suites.AdvAppSuite2()->PF_AppendInfoText("OpenColorIO: GPU Render Error");
+ }
+ }
+ }
+ }
+
+ if(pfS)
+ in_data->pica_basicP->ReleaseSuite(kPFPixelFormatSuite, kPFPixelFormatSuiteVersion1);
+
+ if(wsP)
+ in_data->pica_basicP->ReleaseSuite(kPFWorldSuite, kPFWorldSuiteVersion2);
+
+
+
+ return err;
+}
+
+
+static PF_Err SmartRender(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_SmartRenderExtra *extra)
+
+{
+ PF_Err err = PF_Err_NONE,
+ err2 = PF_Err_NONE;
+
+ PF_EffectWorld *input, *output;
+
+ PF_ParamDef OCIO_data, OCIO_gpu;
+
+ // zero-out parameters
+ AEFX_CLR_STRUCT(OCIO_data);
+ AEFX_CLR_STRUCT(OCIO_gpu);
+
+
+ // checkout input & output buffers.
+ ERR( extra->cb->checkout_layer_pixels( in_data->effect_ref, OCIO_INPUT, &input) );
+ ERR( extra->cb->checkout_output( in_data->effect_ref, &output) );
+
+
+ // bail before param checkout
+ if(err)
+ return err;
+
+#define PF_CHECKOUT_PARAM_NOW( PARAM, DEST ) \
+ PF_CHECKOUT_PARAM( in_data, (PARAM), in_data->current_time,\
+ in_data->time_step, in_data->time_scale, DEST )
+
+ // checkout the required params
+ ERR( PF_CHECKOUT_PARAM_NOW( OCIO_DATA, &OCIO_data ) );
+ ERR( PF_CHECKOUT_PARAM_NOW( OCIO_GPU, &OCIO_gpu ) );
+
+ ERR(DoRender( in_data,
+ input,
+ &OCIO_data,
+ &OCIO_gpu,
+ out_data,
+ output));
+
+ // Always check in, no matter what the error condition!
+ ERR2( PF_CHECKIN_PARAM(in_data, &OCIO_data ) );
+ ERR2( PF_CHECKIN_PARAM(in_data, &OCIO_gpu ) );
+
+
+ return err;
+
+}
+
+
+static PF_Err Render(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output )
+{
+ return DoRender(in_data,
+ &params[OCIO_INPUT]->u.ld,
+ params[OCIO_DATA],
+ params[OCIO_GPU],
+ out_data,
+ output);
+}
+
+
+static PF_Err GetExternalDependencies(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ExtDependenciesExtra *extra)
+
+{
+ PF_Err err = PF_Err_NONE;
+
+ SequenceData *seq_data = (SequenceData *)PF_LOCK_HANDLE(in_data->sequence_data);
+
+ if(seq_data == NULL)
+ return PF_Err_BAD_CALLBACK_PARAM;
+
+
+ std::string dependency;
+
+ if(seq_data->source == OCIO_SOURCE_ENVIRONMENT)
+ {
+ if(extra->check_type == PF_DepCheckType_ALL_DEPENDENCIES)
+ {
+ dependency = "$OCIO environment variable";
+ }
+ else if(extra->check_type == PF_DepCheckType_MISSING_DEPENDENCIES)
+ {
+ char *file = std::getenv("OCIO");
+
+ if(!file)
+ dependency = "$OCIO environment variable";
+ }
+ }
+ else if(seq_data->source == OCIO_SOURCE_STANDARD)
+ {
+ if(extra->check_type == PF_DepCheckType_ALL_DEPENDENCIES)
+ {
+ dependency = "OCIO configuration " + std::string(seq_data->path);
+ }
+ else if(extra->check_type == PF_DepCheckType_MISSING_DEPENDENCIES)
+ {
+ std::string path = GetStdConfigPath(seq_data->path);
+
+ if( path.empty() )
+ dependency = "OCIO configuration " + std::string(seq_data->path);
+ }
+ }
+ else if(seq_data->source == OCIO_SOURCE_CUSTOM && seq_data->path[0] != '\0')
+ {
+ std::string dir = GetProjectDir(in_data);
+
+ Path absolute_path(seq_data->path, "");
+ Path relative_path(seq_data->relative_path, dir);
+
+ if(extra->check_type == PF_DepCheckType_ALL_DEPENDENCIES)
+ {
+ if( !absolute_path.exists() && relative_path.exists() )
+ {
+ dependency = relative_path.full_path();
+ }
+ else
+ dependency = absolute_path.full_path();
+ }
+ else if(extra->check_type == PF_DepCheckType_MISSING_DEPENDENCIES &&
+ !absolute_path.exists() && !relative_path.exists() )
+ {
+ dependency = absolute_path.full_path();
+ }
+ }
+
+
+ if( !dependency.empty() )
+ {
+ extra->dependencies_strH = PF_NEW_HANDLE(sizeof(char) * (dependency.size() + 1));
+
+ char *p = (char *)PF_LOCK_HANDLE(extra->dependencies_strH);
+
+ strcpy(p, dependency.c_str());
+ }
+
+
+ PF_UNLOCK_HANDLE(in_data->sequence_data);
+
+ return err;
+}
+
+
+DllExport PF_Err PluginMain(
+ PF_Cmd cmd,
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output,
+ void *extra)
+{
+ PF_Err err = PF_Err_NONE;
+
+ try {
+ switch(cmd) {
+ case PF_Cmd_ABOUT:
+ err = About(in_data,out_data,params,output);
+ break;
+ case PF_Cmd_GLOBAL_SETUP:
+ err = GlobalSetup(in_data,out_data,params,output);
+ break;
+ case PF_Cmd_GLOBAL_SETDOWN:
+ err = GlobalSetdown(in_data,out_data,params,output);
+ break;
+ case PF_Cmd_PARAMS_SETUP:
+ err = ParamsSetup(in_data,out_data,params,output);
+ break;
+ case PF_Cmd_SEQUENCE_SETUP:
+ case PF_Cmd_SEQUENCE_RESETUP:
+ err = SequenceSetup(in_data, out_data, params, output);
+ break;
+ case PF_Cmd_SEQUENCE_FLATTEN:
+ err = SequenceFlatten(in_data, out_data, params, output);
+ break;
+ case PF_Cmd_SEQUENCE_SETDOWN:
+ err = SequenceSetdown(in_data, out_data, params, output);
+ break;
+ case PF_Cmd_SMART_PRE_RENDER:
+ err = PreRender(in_data, out_data, (PF_PreRenderExtra*)extra);
+ break;
+ case PF_Cmd_SMART_RENDER:
+ err = SmartRender(in_data, out_data, (PF_SmartRenderExtra*)extra);
+ break;
+ case PF_Cmd_RENDER:
+ err = Render(in_data, out_data, params, output);
+ break;
+ case PF_Cmd_EVENT:
+ err = HandleEvent(in_data, out_data, params, output, (PF_EventExtra *)extra);
+ break;
+ case PF_Cmd_ARBITRARY_CALLBACK:
+ err = HandleArbitrary(in_data, out_data, params, output, (PF_ArbParamsExtra *)extra);
+ break;
+ case PF_Cmd_GET_EXTERNAL_DEPENDENCIES:
+ err = GetExternalDependencies(in_data, out_data, (PF_ExtDependenciesExtra *)extra);
+ break;
+ }
+ }
+ catch(PF_Err &thrown_err) { err = thrown_err; }
+ catch(...) { err = PF_Err_INTERNAL_STRUCT_DAMAGED; }
+
+ return err;
+}
diff --git a/src/aftereffects/OpenColorIO_AE.h b/src/aftereffects/OpenColorIO_AE.h
new file mode 100755
index 0000000..98eb314
--- /dev/null
+++ b/src/aftereffects/OpenColorIO_AE.h
@@ -0,0 +1,227 @@
+/*
+Copyright (c) 2003-2012 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#pragma once
+
+#ifndef _OPENCOLORIO_AE_H_
+#define _OPENCOLORIO_AE_H_
+
+
+//#define PF_DEEP_COLOR_AWARE 1 // do we really still need this?
+
+#include "AEConfig.h"
+#include "entry.h"
+#include "SPTypes.h"
+#include "PrSDKAESupport.h"
+#include "AE_Macros.h"
+#include "Param_Utils.h"
+#include "AE_Effect.h"
+#include "AE_EffectUI.h"
+#include "AE_EffectCB.h"
+
+
+#ifdef MSWindows
+ #include <Windows.h>
+#else
+ #ifndef __MACH__
+ #include "string.h"
+ #endif
+#endif
+
+
+// Versioning information
+#define MAJOR_VERSION 1
+#define MINOR_VERSION 0
+#define BUG_VERSION 0
+#define STAGE_VERSION PF_Stage_RELEASE
+#define BUILD_VERSION 0
+
+// Paramater constants
+enum {
+ OCIO_INPUT = 0,
+ OCIO_DATA,
+ OCIO_GPU,
+
+ OCIO_NUM_PARAMS
+};
+
+enum {
+ OCIO_DATA_ID = 1,
+ OCIO_GPU_ID
+};
+
+
+// Our Arbitrary Data struct
+
+#define CURRENT_ARB_VERSION 1
+#define ARB_PATH_LEN 255
+#define ARB_SPACE_LEN 63
+
+enum {
+ OCIO_ACTION_NONE = 0,
+ OCIO_ACTION_LUT,
+ OCIO_ACTION_CONVERT,
+ OCIO_ACTION_DISPLAY
+};
+typedef A_u_char OCIO_Action;
+
+enum {
+ OCIO_STORAGE_NONE = 0,
+ OCIO_STORAGE_ZIP_FILE
+};
+typedef A_u_char OCIO_Storage;
+
+enum {
+ OCIO_SOURCE_NONE = 0,
+ OCIO_SOURCE_ENVIRONMENT,
+ OCIO_SOURCE_STANDARD,
+ OCIO_SOURCE_CUSTOM
+};
+typedef A_u_char OCIO_Source;
+
+enum {
+ OCIO_INTERP_UNKNOWN = 0,
+ OCIO_INTERP_NEAREST = 1,
+ OCIO_INTERP_LINEAR = 2,
+ OCIO_INTERP_TETRAHEDRAL = 3,
+ OCIO_INTERP_BEST = 255
+};
+typedef A_u_char OCIO_Interp;
+
+typedef struct {
+ A_u_char version; // version of this data structure
+ OCIO_Action action;
+ A_Boolean invert; // only used for LUTs
+ OCIO_Storage storage; // storage not used...yet
+ A_u_long storage_size;
+ OCIO_Source source;
+ OCIO_Interp interpolation;
+ A_u_char reserved[54]; // 64 pre-path bytes
+ char path[ARB_PATH_LEN+1];
+ char relative_path[ARB_PATH_LEN+1];
+ char input[ARB_SPACE_LEN+1];
+ char output[ARB_SPACE_LEN+1];
+ char transform[ARB_SPACE_LEN+1];
+ char device[ARB_SPACE_LEN+1];
+ char look[ARB_SPACE_LEN+1]; // not used currently
+ A_u_char storage_buf[1];
+} ArbitraryData;
+
+
+#ifdef __cplusplus
+
+class OpenColorIO_AE_Context;
+
+enum {
+ STATUS_UNKNOWN = 0,
+ STATUS_OK,
+ STATUS_NO_FILE,
+ STATUS_USING_ABSOLUTE,
+ STATUS_USING_RELATIVE,
+ STATUS_FILE_MISSING,
+ STATUS_OCIO_ERROR
+};
+typedef A_u_char FileStatus;
+
+enum {
+ GPU_ERR_NONE = 0,
+ GPU_ERR_INSUFFICIENT,
+ GPU_ERR_RENDER_ERR
+};
+typedef A_u_char GPUErr;
+
+enum {
+ PREMIERE_UNKNOWN = 0,
+ PREMIERE_LINEAR,
+ PREMIERE_NON_LINEAR
+};
+typedef A_u_char PremiereStatus;
+
+typedef struct {
+ FileStatus status;
+ GPUErr gpu_err;
+ PremiereStatus prem_status;
+ OCIO_Source source;
+ OpenColorIO_AE_Context *context;
+ char path[ARB_PATH_LEN+1];
+ char relative_path[ARB_PATH_LEN+1];
+} SequenceData;
+
+#endif
+
+
+
+#define UI_CONTROL_HEIGHT 200
+#define UI_CONTROL_WIDTH 500
+
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+// Prototypes
+
+DllExport PF_Err PluginMain(
+ PF_Cmd cmd,
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output,
+ void *extra) ;
+
+
+PF_Err HandleEvent(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output,
+ PF_EventExtra *extra );
+
+
+PF_Err ArbNewDefault( // needed by ParamSetup()
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ void *refconPV,
+ PF_ArbitraryH *arbPH);
+
+PF_Err HandleArbitrary(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output,
+ PF_ArbParamsExtra *extra);
+
+
+#ifdef __cplusplus
+ }
+#endif
+
+
+
+#endif // _OPENCOLORIO_AE_H_ \ No newline at end of file
diff --git a/src/aftereffects/OpenColorIO_AE_ArbData.cpp b/src/aftereffects/OpenColorIO_AE_ArbData.cpp
new file mode 100644
index 0000000..0e55541
--- /dev/null
+++ b/src/aftereffects/OpenColorIO_AE_ArbData.cpp
@@ -0,0 +1,408 @@
+/*
+Copyright (c) 2003-2012 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#include "OpenColorIO_AE.h"
+
+#include "OpenColorIO_AE_Context.h"
+
+#include <assert.h>
+
+
+PF_Err ArbNewDefault(PF_InData *in_data, PF_OutData *out_data,
+ void *refconPV,
+ PF_ArbitraryH *arbPH)
+{
+ PF_Err err = PF_Err_NONE;
+
+ if(arbPH)
+ {
+ *arbPH = PF_NEW_HANDLE( sizeof(ArbitraryData) );
+
+ if(*arbPH)
+ {
+ ArbitraryData *arb_data = (ArbitraryData *)PF_LOCK_HANDLE(*arbPH);
+
+ // set up defaults
+ arb_data->version = CURRENT_ARB_VERSION;
+
+ arb_data->action = OCIO_ACTION_NONE;
+ arb_data->invert = FALSE;
+
+ arb_data->storage = OCIO_STORAGE_NONE;
+ arb_data->storage_size = 0;
+ arb_data->source = OCIO_SOURCE_NONE;
+ arb_data->interpolation = OCIO_INTERP_LINEAR;
+
+ arb_data->path[0] = '\0';
+ arb_data->relative_path[0] = '\0';
+
+ arb_data->input[0] = '\0';
+ arb_data->output[0] = '\0';
+ arb_data->transform[0] = '\0';
+ arb_data->device[0] = '\0';
+ arb_data->look[0] = '\0';
+
+
+ // set default with environment variable if it's set
+ char *file = std::getenv("OCIO");
+
+ if(file)
+ {
+ try
+ {
+ OpenColorIO_AE_Context context(file, OCIO_SOURCE_ENVIRONMENT);
+
+ strncpy(arb_data->path, file, ARB_PATH_LEN);
+
+ arb_data->action = context.getAction();
+ arb_data->source = OCIO_SOURCE_ENVIRONMENT;
+
+ if(arb_data->action != OCIO_ACTION_LUT)
+ {
+ strncpy(arb_data->input, context.getInput().c_str(), ARB_SPACE_LEN);
+ strncpy(arb_data->output, context.getOutput().c_str(), ARB_SPACE_LEN);
+ strncpy(arb_data->transform, context.getTransform().c_str(), ARB_SPACE_LEN);
+ strncpy(arb_data->device, context.getDevice().c_str(), ARB_SPACE_LEN);
+ }
+ }
+ catch(...) {}
+ }
+
+
+ PF_UNLOCK_HANDLE(*arbPH);
+ }
+ }
+
+ return err;
+}
+
+
+static PF_Err ArbDispose(PF_InData *in_data, PF_OutData *out_data,
+ void *refconPV,
+ PF_ArbitraryH arbH)
+{
+ if(arbH)
+ PF_DISPOSE_HANDLE(arbH);
+
+ return PF_Err_NONE;
+}
+
+
+static void CopyArbData(ArbitraryData *out_arb_data, ArbitraryData *in_arb_data)
+{
+ // copy contents
+ out_arb_data->version = in_arb_data->version;
+
+ out_arb_data->action = in_arb_data->action;
+
+ out_arb_data->invert = in_arb_data->invert;
+
+ out_arb_data->storage = in_arb_data->storage;
+ out_arb_data->storage_size = in_arb_data->storage_size;
+
+ out_arb_data->source = in_arb_data->source;
+
+ out_arb_data->interpolation = in_arb_data->interpolation;
+
+ strcpy(out_arb_data->path, in_arb_data->path);
+ strcpy(out_arb_data->relative_path, in_arb_data->relative_path);
+
+ strcpy(out_arb_data->input, in_arb_data->input);
+ strcpy(out_arb_data->output, in_arb_data->output);
+ strcpy(out_arb_data->transform, in_arb_data->transform);
+ strcpy(out_arb_data->device, in_arb_data->device);
+ strcpy(out_arb_data->look, in_arb_data->look);
+}
+
+
+static PF_Err ArbCopy(PF_InData *in_data, PF_OutData *out_data,
+ void *refconPV,
+ PF_ArbitraryH src_arbH,
+ PF_ArbitraryH *dst_arbPH)
+{
+ PF_Err err = PF_Err_NONE;
+
+ if(src_arbH && dst_arbPH)
+ {
+ // allocate using the creation function
+ err = ArbNewDefault(in_data, out_data, refconPV, dst_arbPH);
+
+ if(!err)
+ {
+ ArbitraryData *in_arb_data = (ArbitraryData *)PF_LOCK_HANDLE(src_arbH),
+ *out_arb_data = (ArbitraryData *)PF_LOCK_HANDLE(*dst_arbPH);
+
+ CopyArbData(out_arb_data, in_arb_data);
+
+ PF_UNLOCK_HANDLE(src_arbH);
+ PF_UNLOCK_HANDLE(*dst_arbPH);
+ }
+ }
+
+ return err;
+}
+
+
+static PF_Err ArbFlatSize(PF_InData *in_data, PF_OutData *out_data,
+ void *refconPV,
+ PF_ArbitraryH arbH,
+ A_u_long *flat_data_sizePLu)
+{
+ // flat is the same size as inflated
+ if(arbH)
+ *flat_data_sizePLu = PF_GET_HANDLE_SIZE(arbH);
+
+ return PF_Err_NONE;
+}
+
+
+static void SwapArbData(ArbitraryData *arb_data)
+{
+
+}
+
+
+static PF_Err ArbFlatten(PF_InData *in_data, PF_OutData *out_data,
+ void *refconPV,
+ PF_ArbitraryH arbH,
+ A_u_long buf_sizeLu,
+ void *flat_dataPV)
+{
+ PF_Err err = PF_Err_NONE;
+
+ if(arbH && flat_dataPV)
+ {
+ // they provide the buffer, we just move data
+ ArbitraryData *in_arb_data = (ArbitraryData *)PF_LOCK_HANDLE(arbH),
+ *out_arb_data = (ArbitraryData *)flat_dataPV;
+
+ assert(buf_sizeLu >= PF_GET_HANDLE_SIZE(arbH));
+
+ CopyArbData(out_arb_data, in_arb_data);
+
+ #ifdef AE_BIG_ENDIAN
+ // not that we're doing a PPC version of this...
+ SwapArbData(out_arb_data);
+ #endif
+
+ PF_UNLOCK_HANDLE(arbH);
+ }
+
+ return err;
+}
+
+
+static PF_Err ArbUnFlatten(PF_InData *in_data, PF_OutData *out_data,
+ void *refconPV,
+ A_u_long buf_sizeLu,
+ const void *flat_dataPV,
+ PF_ArbitraryH *arbPH)
+{
+ PF_Err err = PF_Err_NONE;
+
+ if(arbPH && flat_dataPV)
+ {
+ // they provide a flat buffer, we have to make the handle
+ err = ArbNewDefault(in_data, out_data, refconPV, arbPH);
+
+ if(!err && *arbPH)
+ {
+ ArbitraryData *in_arb_data = (ArbitraryData *)flat_dataPV,
+ *out_arb_data = (ArbitraryData *)PF_LOCK_HANDLE(*arbPH);
+
+ assert(buf_sizeLu <= PF_GET_HANDLE_SIZE(*arbPH));
+
+ CopyArbData(out_arb_data, in_arb_data);
+
+ #ifdef AE_BIG_ENDIAN
+ SwapArbData(out_arb_data);
+ #endif
+
+ PF_UNLOCK_HANDLE(*arbPH);
+ }
+ }
+
+ return err;
+}
+
+static PF_Err ArbInterpolate(PF_InData *in_data, PF_OutData *out_data,
+ void *refconPV,
+ PF_ArbitraryH left_arbH,
+ PF_ArbitraryH right_arbH,
+ PF_FpLong tF,
+ PF_ArbitraryH *interpPH)
+{
+ PF_Err err = PF_Err_NONE;
+
+ assert(FALSE); // we shouldn't be doing this
+
+ if(left_arbH && right_arbH && interpPH)
+ {
+ // allocate using our own func
+ err = ArbNewDefault(in_data, out_data, refconPV, interpPH);
+
+ if(!err && *interpPH)
+ {
+ // we're just going to copy the left_data
+ ArbitraryData *in_arb_data = (ArbitraryData *)PF_LOCK_HANDLE(left_arbH),
+ *out_arb_data = (ArbitraryData *)PF_LOCK_HANDLE(*interpPH);
+
+ CopyArbData(out_arb_data, in_arb_data);
+
+ PF_UNLOCK_HANDLE(left_arbH);
+ PF_UNLOCK_HANDLE(*interpPH);
+ }
+ }
+
+ return err;
+}
+
+
+static PF_Err ArbCompare(PF_InData *in_data, PF_OutData *out_data,
+ void *refconPV,
+ PF_ArbitraryH a_arbH,
+ PF_ArbitraryH b_arbH,
+ PF_ArbCompareResult *compareP)
+{
+ PF_Err err = PF_Err_NONE;
+
+ if(a_arbH && b_arbH)
+ {
+ ArbitraryData *a_data = (ArbitraryData *)PF_LOCK_HANDLE(a_arbH),
+ *b_data = (ArbitraryData *)PF_LOCK_HANDLE(b_arbH);
+
+
+ if( a_data->version == b_data->version &&
+ a_data->action == b_data->action &&
+ a_data->invert == b_data->invert &&
+ a_data->source == b_data->source &&
+ a_data->interpolation == b_data->interpolation &&
+ !strcmp(a_data->path, b_data->path) &&
+ !strcmp(a_data->input, b_data->input) &&
+ !strcmp(a_data->output, b_data->output) &&
+ !strcmp(a_data->transform, b_data->transform) &&
+ !strcmp(a_data->device, b_data->device) &&
+ !strcmp(a_data->look, b_data->look) )
+ {
+ *compareP = PF_ArbCompare_EQUAL;
+ }
+ else
+ {
+ *compareP = PF_ArbCompare_NOT_EQUAL;
+ }
+
+
+ PF_UNLOCK_HANDLE(a_arbH);
+ PF_UNLOCK_HANDLE(b_arbH);
+ }
+
+ return err;
+}
+
+
+PF_Err HandleArbitrary(
+ PF_InData *in_data,
+ PF_OutData *out_data,
+ PF_ParamDef *params[],
+ PF_LayerDef *output,
+ PF_ArbParamsExtra *extra)
+{
+ PF_Err err = PF_Err_NONE;
+
+ if(extra->id == OCIO_DATA_ID)
+ {
+ switch(extra->which_function)
+ {
+ case PF_Arbitrary_NEW_FUNC:
+ err = ArbNewDefault(in_data, out_data,
+ extra->u.new_func_params.refconPV,
+ extra->u.new_func_params.arbPH);
+ break;
+ case PF_Arbitrary_DISPOSE_FUNC:
+ err = ArbDispose(in_data, out_data,
+ extra->u.dispose_func_params.refconPV,
+ extra->u.dispose_func_params.arbH);
+ break;
+ case PF_Arbitrary_COPY_FUNC:
+ err = ArbCopy(in_data, out_data, extra->u.copy_func_params.refconPV,
+ extra->u.copy_func_params.src_arbH,
+ extra->u.copy_func_params.dst_arbPH);
+ break;
+ case PF_Arbitrary_FLAT_SIZE_FUNC:
+ err = ArbFlatSize(in_data, out_data,
+ extra->u.flat_size_func_params.refconPV,
+ extra->u.flat_size_func_params.arbH,
+ extra->u.flat_size_func_params.flat_data_sizePLu);
+ break;
+ case PF_Arbitrary_FLATTEN_FUNC:
+ err = ArbFlatten(in_data, out_data,
+ extra->u.flatten_func_params.refconPV,
+ extra->u.flatten_func_params.arbH,
+ extra->u.flatten_func_params.buf_sizeLu,
+ extra->u.flatten_func_params.flat_dataPV);
+ break;
+ case PF_Arbitrary_UNFLATTEN_FUNC:
+ err = ArbUnFlatten(in_data, out_data,
+ extra->u.unflatten_func_params.refconPV,
+ extra->u.unflatten_func_params.buf_sizeLu,
+ extra->u.unflatten_func_params.flat_dataPV,
+ extra->u.unflatten_func_params.arbPH);
+ break;
+ case PF_Arbitrary_INTERP_FUNC:
+ err = ArbInterpolate(in_data, out_data,
+ extra->u.interp_func_params.refconPV,
+ extra->u.interp_func_params.left_arbH,
+ extra->u.interp_func_params.right_arbH,
+ extra->u.interp_func_params.tF,
+ extra->u.interp_func_params.interpPH);
+ break;
+ case PF_Arbitrary_COMPARE_FUNC:
+ err = ArbCompare(in_data, out_data,
+ extra->u.compare_func_params.refconPV,
+ extra->u.compare_func_params.a_arbH,
+ extra->u.compare_func_params.b_arbH,
+ extra->u.compare_func_params.compareP);
+ break;
+ // these are necessary for copying and pasting keyframes
+ // for now, we better not be called to do this
+ case PF_Arbitrary_PRINT_SIZE_FUNC:
+ assert(FALSE);
+ break;
+ case PF_Arbitrary_PRINT_FUNC:
+ assert(FALSE);
+ break;
+ case PF_Arbitrary_SCAN_FUNC:
+ assert(FALSE);
+ break;
+ }
+ }
+
+
+ return err;
+}
diff --git a/src/aftereffects/OpenColorIO_AE_Context.cpp b/src/aftereffects/OpenColorIO_AE_Context.cpp
new file mode 100644
index 0000000..1da7ee8
--- /dev/null
+++ b/src/aftereffects/OpenColorIO_AE_Context.cpp
@@ -0,0 +1,1051 @@
+/*
+Copyright (c) 2003-2012 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#include "OpenColorIO_AE_Context.h"
+
+#include <fstream>
+#include <map>
+#include <sstream>
+
+#include "ocioicc.h"
+
+#include "OpenColorIO_AE_Dialogs.h"
+
+
+
+
+static const char mac_delimiter = '/';
+static const char win_delimiter = '\\';
+
+#ifdef WIN_ENV
+static const char delimiter = win_delimiter;
+#else
+static const char delimiter = mac_delimiter;
+#endif
+
+static const int LUT3D_EDGE_SIZE = 32;
+
+
+Path::Path(const std::string &path, const std::string &dir) :
+ _path(path),
+ _dir(dir)
+{
+
+}
+
+
+Path::Path(const Path &path)
+{
+ _path = path._path;
+ _dir = path._dir;
+}
+
+
+std::string Path::full_path() const
+{
+ if( is_relative(_path) && !_dir.empty() )
+ {
+ std::vector<std::string> path_vec = components( convert_delimiters(_path) );
+ std::vector<std::string> dir_vec = components(_dir);
+
+ int up_dirs = 0;
+ int down_dirs = 0;
+
+ while(down_dirs < path_vec.size() - 1 &&
+ (path_vec[down_dirs] == ".." || path_vec[down_dirs] == ".") )
+ {
+ down_dirs++;
+
+ if(path_vec[down_dirs] == "..")
+ up_dirs++;
+ }
+
+
+ std::string path;
+
+ if(path_type(_dir) == TYPE_MAC)
+ path += mac_delimiter;
+
+ for(int i=0; i < dir_vec.size() - up_dirs; i++)
+ {
+ path += dir_vec[i] + delimiter;
+ }
+
+ for(int i = down_dirs; i < path_vec.size() - 1; i++)
+ {
+ path += path_vec[i] + delimiter;
+ }
+
+ path += path_vec.back();
+
+ return path;
+ }
+ else
+ {
+ return _path;
+ }
+}
+
+
+std::string Path::relative_path(bool force) const
+{
+ if( is_relative(_path) || _dir.empty() || _path.empty() )
+ {
+ return _path;
+ }
+ else
+ {
+ std::vector<std::string> path_vec = components(_path);
+ std::vector<std::string> dir_vec = components(_dir);
+
+ int match_idx = 0;
+
+ while(match_idx < path_vec.size() &&
+ match_idx < dir_vec.size() &&
+ path_vec[match_idx] == dir_vec[match_idx])
+ match_idx++;
+
+ if(match_idx == 0)
+ {
+ // can't do relative path
+ if(force)
+ return _path;
+ else
+ return "";
+ }
+ else
+ {
+ std::string rel_path;
+
+ // is the file in a folder below or actually inside the dir?
+ if(match_idx == dir_vec.size())
+ {
+ rel_path += std::string(".") + delimiter;
+ }
+ else
+ {
+ for(int i = match_idx; i < dir_vec.size(); i++)
+ {
+ rel_path += std::string("..") + delimiter;
+ }
+ }
+
+ for(int i = match_idx; i < path_vec.size() - 1; i++)
+ {
+ rel_path += path_vec[i] + delimiter;
+ }
+
+ rel_path += path_vec.back();
+
+ return rel_path;
+ }
+ }
+}
+
+
+bool Path::exists() const
+{
+ std::string path = full_path();
+
+ if(path.empty())
+ return false;
+
+ std::ifstream f( path.c_str() );
+
+ return !!f;
+}
+
+
+Path::PathType Path::path_type(std::string path)
+{
+ if( path.empty() )
+ {
+ return TYPE_UNKNOWN;
+ }
+ if(path[0] == mac_delimiter)
+ {
+ return TYPE_MAC;
+ }
+ else if(path[1] == ':' && path[2] == win_delimiter)
+ {
+ return TYPE_WIN;
+ }
+ else if(path[0] == win_delimiter && path[1] == win_delimiter)
+ {
+ return TYPE_WIN;
+ }
+ else
+ {
+ size_t mac_pos = path.find(mac_delimiter);
+ size_t win_pos = path.find(win_delimiter);
+
+ if(mac_pos != std::string::npos && win_pos == std::string::npos)
+ {
+ return TYPE_MAC;
+ }
+ else if(mac_pos == std::string::npos && win_pos != std::string::npos)
+ {
+ return TYPE_WIN;
+ }
+ else if(mac_pos == std::string::npos && win_pos == std::string::npos)
+ {
+ return TYPE_UNKNOWN;
+ }
+ else // neither npos?
+ {
+ if(mac_pos < win_pos)
+ return TYPE_MAC;
+ else
+ return TYPE_WIN;
+ }
+ }
+}
+
+
+bool Path::is_relative(std::string path)
+{
+ Path::PathType type = path_type(path);
+
+ if(type == TYPE_MAC)
+ {
+ return (path[0] != mac_delimiter);
+ }
+ else if(type == TYPE_WIN)
+ {
+ return !( (path[1] == ':' && path[2] == win_delimiter) ||
+ (path[0] == win_delimiter && path[1] == win_delimiter) );
+ }
+ else
+ { // TYPE_UNKNOWN
+
+ // just a filename perhaps?
+ // should never have this: even a file in the same directory will be ./file.ocio
+ // we'll assume it's relative, but raise a stink during debugging
+ assert(type != TYPE_UNKNOWN);
+
+ return true;
+ }
+}
+
+
+std::string Path::convert_delimiters(std::string path)
+{
+#ifdef WIN_ENV
+ char search = mac_delimiter;
+ char replace = win_delimiter;
+#else
+ char search = win_delimiter;
+ char replace = mac_delimiter;
+#endif
+
+ for(int i=0; i < path.size(); i++)
+ {
+ if(path[i] == search)
+ path[i] = replace;
+ }
+
+ return path;
+}
+
+
+std::vector<std::string> Path::components(std::string path)
+{
+ std::vector<std::string> vec;
+
+ size_t pos = 0;
+ size_t len = path.size();
+
+ size_t start, finish;
+
+ while(path[pos] == delimiter && pos < len)
+ pos++;
+
+ while(pos < len)
+ {
+ start = pos;
+
+ while(path[pos] != delimiter && pos < len)
+ pos++;
+
+ finish = ((pos == len - 1) ? pos : pos - 1);
+
+ vec.push_back( path.substr(start, 1 + finish - start) );
+
+ while(path[pos] == delimiter && pos < len)
+ pos++;
+ }
+
+ return vec;
+}
+
+
+#pragma mark-
+
+
+OpenColorIO_AE_Context::OpenColorIO_AE_Context(const std::string &path, OCIO_Source source) :
+ _gl_init(false)
+{
+ _action = OCIO_ACTION_NONE;
+
+
+ _source = source;
+
+ if(_source == OCIO_SOURCE_ENVIRONMENT)
+ {
+ char *file = getenv("OCIO");
+
+ if(file)
+ {
+ _path = file;
+ }
+ else
+ throw OCIO::Exception("No $OCIO environment variable.");
+ }
+ else if(_source == OCIO_SOURCE_STANDARD)
+ {
+ _config_name = path;
+
+ _path = GetStdConfigPath(_config_name);
+
+ if( _path.empty() )
+ throw OCIO::Exception("Error getting config.");
+ }
+ else
+ {
+ _path = path;
+ }
+
+
+ if(!_path.empty())
+ {
+ std::string the_extension = _path.substr( _path.find_last_of('.') + 1 );
+
+ if(the_extension == "ocio")
+ {
+ _config = OCIO::Config::CreateFromFile( _path.c_str() );
+
+ _config->sanityCheck();
+
+ for(int i=0; i < _config->getNumColorSpaces(); ++i)
+ {
+ _inputs.push_back( _config->getColorSpaceNameByIndex(i) );
+ }
+
+
+ for(int i=0; i < _config->getNumDisplays(); ++i)
+ {
+ _devices.push_back( _config->getDisplay(i) );
+ }
+
+ const char * defaultDisplay = _config->getDefaultDisplay();
+ const char * defaultTransform = _config->getDefaultView(defaultDisplay);
+
+ for(int i=0; i < _config->getNumViews(defaultDisplay); ++i)
+ {
+ _transforms.push_back( _config->getView(defaultDisplay, i) );
+ }
+
+
+ OCIO::ConstColorSpaceRcPtr defaultInput = _config->getColorSpace(OCIO::ROLE_SCENE_LINEAR);
+
+ const char *defaultInputName = (defaultInput ? defaultInput->getName() : OCIO::ROLE_SCENE_LINEAR);
+
+
+ setupConvert(defaultInputName, defaultInputName);
+
+ _transform = defaultTransform;
+ _device = defaultDisplay;
+ }
+ else
+ {
+ _config = OCIO::Config::Create();
+
+ setupLUT(false, OCIO_INTERP_LINEAR);
+ }
+ }
+ else
+ throw OCIO::Exception("Got nothin");
+}
+
+
+OpenColorIO_AE_Context::OpenColorIO_AE_Context(const ArbitraryData *arb_data, const std::string &dir) :
+ _gl_init(false)
+{
+ _action = OCIO_ACTION_NONE;
+
+
+ _source = arb_data->source;
+
+ if(_source == OCIO_SOURCE_ENVIRONMENT)
+ {
+ char *file = getenv("OCIO");
+
+ if(file)
+ {
+ _path = file;
+ }
+ else
+ throw OCIO::Exception("No $OCIO environment variable.");
+ }
+ else if(_source == OCIO_SOURCE_STANDARD)
+ {
+ _config_name = arb_data->path;
+
+ _path = GetStdConfigPath(_config_name);
+
+ if( _path.empty() )
+ throw OCIO::Exception("Error getting config.");
+ }
+ else
+ {
+ Path absolute_path(arb_data->path, dir);
+ Path relative_path(arb_data->relative_path, dir);
+
+ if( absolute_path.exists() )
+ {
+ _path = absolute_path.full_path();
+ }
+ else
+ {
+ _path = relative_path.full_path();
+ }
+ }
+
+
+ if(!_path.empty())
+ {
+ std::string the_extension = _path.substr( _path.find_last_of('.') + 1 );
+
+ if(the_extension == "ocio")
+ {
+ _config = OCIO::Config::CreateFromFile( _path.c_str() );
+
+ _config->sanityCheck();
+
+ for(int i=0; i < _config->getNumColorSpaces(); ++i)
+ {
+ _inputs.push_back( _config->getColorSpaceNameByIndex(i) );
+ }
+
+
+ for(int i=0; i < _config->getNumDisplays(); ++i)
+ {
+ _devices.push_back( _config->getDisplay(i) );
+ }
+
+ const char * defaultDisplay = _config->getDefaultDisplay();
+ const char * defaultTransform = _config->getDefaultView(defaultDisplay);
+
+ for(int i=0; i < _config->getNumViews(defaultDisplay); ++i)
+ {
+ _transforms.push_back( _config->getView(defaultDisplay, i) );
+ }
+
+
+ if(arb_data->action == OCIO_ACTION_CONVERT)
+ {
+ setupConvert(arb_data->input, arb_data->output);
+
+ _transform = arb_data->transform;
+ _device = arb_data->device;
+ }
+ else
+ {
+ setupDisplay(arb_data->input, arb_data->transform, arb_data->device);
+
+ _output = arb_data->output;
+ }
+ }
+ else
+ {
+ _config = OCIO::Config::Create();
+
+ setupLUT(arb_data->invert, arb_data->interpolation);
+ }
+ }
+ else
+ throw OCIO::Exception("Got nothin");
+}
+
+
+OpenColorIO_AE_Context::~OpenColorIO_AE_Context()
+{
+ if(_gl_init)
+ {
+ glDeleteShader(_fragShader);
+ glDeleteProgram(_program);
+ glDeleteTextures(1, &_imageTexID);
+
+ if(_bufferWidth != 0 && _bufferHeight != 0)
+ glDeleteRenderbuffersEXT(1, &_renderBuffer);
+ }
+}
+
+
+bool OpenColorIO_AE_Context::Verify(const ArbitraryData *arb_data, const std::string &dir)
+{
+ if(_source != arb_data->source)
+ return false;
+
+ if(_source == OCIO_SOURCE_STANDARD)
+ {
+ if(_config_name != arb_data->path)
+ return false;
+ }
+ else if(_source == OCIO_SOURCE_CUSTOM)
+ {
+ // comparing the paths, cheking relative path only if necessary
+ if(_path != arb_data->path)
+ {
+ std::string rel_path(arb_data->relative_path);
+
+ if( !dir.empty() && !rel_path.empty() )
+ {
+ Path relative_path(rel_path, dir);
+
+ if( _path != relative_path.full_path() )
+ return false;
+ }
+ else
+ return false;
+ }
+ }
+
+ // we can switch between Convert and Display, but not LUT and non-LUT
+ if((arb_data->action == OCIO_ACTION_NONE) ||
+ (_action == OCIO_ACTION_LUT && arb_data->action != OCIO_ACTION_LUT) ||
+ (_action != OCIO_ACTION_LUT && arb_data->action == OCIO_ACTION_LUT) )
+ {
+ return false;
+ }
+
+ bool force_reset = (_action != arb_data->action);
+
+
+ // If the type and path are compatible, we can patch up
+ // differences here and return true.
+ // Returning false means the context will be deleted and rebuilt.
+ if(arb_data->action == OCIO_ACTION_LUT)
+ {
+ if(_invert != (bool)arb_data->invert ||
+ _interpolation != arb_data->interpolation ||
+ force_reset)
+ {
+ setupLUT(arb_data->invert, arb_data->interpolation);
+ }
+ }
+ else if(arb_data->action == OCIO_ACTION_CONVERT)
+ {
+ if(_input != arb_data->input ||
+ _output != arb_data->output ||
+ force_reset)
+ {
+ setupConvert(arb_data->input, arb_data->output);
+ }
+ }
+ else if(arb_data->action == OCIO_ACTION_DISPLAY)
+ {
+ if(_input != arb_data->input ||
+ _transform != arb_data->transform ||
+ _device != arb_data->device ||
+ force_reset)
+ {
+ setupDisplay(arb_data->input, arb_data->transform, arb_data->device);
+ }
+ }
+ else
+ throw OCIO::Exception("Bad OCIO type");
+
+
+ return true;
+}
+
+
+void OpenColorIO_AE_Context::setupConvert(const char *input, const char *output)
+{
+ OCIO::ColorSpaceTransformRcPtr transform = OCIO::ColorSpaceTransform::Create();
+
+ transform->setSrc(input);
+ transform->setDst(output);
+ transform->setDirection(OCIO::TRANSFORM_DIR_FORWARD);
+
+ _input = input;
+ _output = output;
+
+ _processor = _config->getProcessor(transform);
+
+ _action = OCIO_ACTION_CONVERT;
+
+ UpdateOCIOGLState();
+}
+
+
+void OpenColorIO_AE_Context::setupDisplay(const char *input, const char *xform, const char *device)
+{
+ OCIO::DisplayTransformRcPtr transform = OCIO::DisplayTransform::Create();
+
+ transform->setInputColorSpaceName(input);
+ transform->setView(xform);
+ transform->setDisplay(device);
+
+ _input = input;
+ _transform = xform;
+ _device = device;
+
+
+ _processor = _config->getProcessor(transform);
+
+ _action = OCIO_ACTION_DISPLAY;
+
+ UpdateOCIOGLState();
+}
+
+
+void OpenColorIO_AE_Context::setupLUT(bool invert, OCIO_Interp interpolation)
+{
+ OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create();
+
+ if(interpolation != OCIO_INTERP_NEAREST && interpolation != OCIO_INTERP_LINEAR &&
+ interpolation != OCIO_INTERP_TETRAHEDRAL && interpolation != OCIO_INTERP_BEST)
+ {
+ interpolation = OCIO_INTERP_LINEAR;
+ }
+
+ transform->setSrc( _path.c_str() );
+ transform->setInterpolation(static_cast<OCIO::Interpolation>(interpolation));
+ transform->setDirection(invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD);
+
+ _processor = _config->getProcessor(transform);
+
+ _invert = invert;
+ _interpolation = interpolation;
+
+ _action = OCIO_ACTION_LUT;
+
+ UpdateOCIOGLState();
+}
+
+
+bool OpenColorIO_AE_Context::ExportLUT(const std::string &path, const std::string &display_icc_path)
+{
+ std::string the_extension = path.substr( path.find_last_of('.') + 1 );
+
+ try{
+
+ if(the_extension == "icc")
+ {
+ int cubesize = 32;
+ int whitepointtemp = 6505;
+ std::string copyright = "OpenColorIO, Sony Imageworks";
+
+ // create a description tag from the filename
+ size_t filename_start = path.find_last_of(delimiter) + 1;
+ size_t filename_end = path.find_last_of('.') - 1;
+
+ std::string description = path.substr(path.find_last_of(delimiter) + 1,
+ 1 + filename_end - filename_start);
+
+ SaveICCProfileToFile(path, _processor, cubesize, whitepointtemp,
+ display_icc_path, description, copyright, false);
+ }
+ else
+ {
+ // this code lovingly pulled from ociobakelut
+
+ // need an extension->format map (yes, just did this one call up)
+ std::map<std::string, std::string> extensions;
+
+ for(int i=0; i < OCIO::Baker::getNumFormats(); ++i)
+ {
+ const char *extension = OCIO::Baker::getFormatExtensionByIndex(i);
+ const char *format = OCIO::Baker::getFormatNameByIndex(i);
+
+ extensions[ extension ] = format;
+ }
+
+ std::string format = extensions[ the_extension ];
+
+
+ OCIO::BakerRcPtr baker = OCIO::Baker::Create();
+
+ baker->setFormat(format.c_str());
+
+ if(_action == OCIO_ACTION_CONVERT)
+ {
+ baker->setConfig(_config);
+ baker->setInputSpace(_input.c_str());
+ baker->setTargetSpace(_output.c_str());
+
+ std::ofstream f(path.c_str());
+ baker->bake(f);
+ }
+ else if(_action == OCIO_ACTION_DISPLAY)
+ {
+ OCIO::ConfigRcPtr editableConfig = _config->createEditableCopy();
+
+ OCIO::ColorSpaceRcPtr inputColorSpace = OCIO::ColorSpace::Create();
+ std::string inputspace = "RawInput";
+ inputColorSpace->setName(inputspace.c_str());
+ editableConfig->addColorSpace(inputColorSpace);
+
+
+ OCIO::ColorSpaceRcPtr outputColorSpace = OCIO::ColorSpace::Create();
+ std::string outputspace = "ProcessedOutput";
+ outputColorSpace->setName(outputspace.c_str());
+
+ OCIO::DisplayTransformRcPtr transform = OCIO::DisplayTransform::Create();
+
+ transform->setInputColorSpaceName(_input.c_str());
+ transform->setView(_transform.c_str());
+ transform->setDisplay(_device.c_str());
+
+ outputColorSpace->setTransform(transform, OCIO::COLORSPACE_DIR_FROM_REFERENCE);
+
+ editableConfig->addColorSpace(outputColorSpace);
+
+
+ baker->setConfig(editableConfig);
+ baker->setInputSpace(inputspace.c_str());
+ baker->setTargetSpace(outputspace.c_str());
+
+ std::ofstream f(path.c_str());
+ baker->bake(f);
+ }
+ else if(_action == OCIO_ACTION_LUT)
+ {
+ OCIO::ConfigRcPtr editableConfig = OCIO::Config::Create();
+
+ OCIO::ColorSpaceRcPtr inputColorSpace = OCIO::ColorSpace::Create();
+ std::string inputspace = "RawInput";
+ inputColorSpace->setName(inputspace.c_str());
+ editableConfig->addColorSpace(inputColorSpace);
+
+
+ OCIO::ColorSpaceRcPtr outputColorSpace = OCIO::ColorSpace::Create();
+ std::string outputspace = "ProcessedOutput";
+ outputColorSpace->setName(outputspace.c_str());
+
+ OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create();
+
+ transform = OCIO::FileTransform::Create();
+ transform->setSrc(_path.c_str());
+ transform->setInterpolation(static_cast<OCIO::Interpolation>(_interpolation));
+ transform->setDirection(_invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD);
+
+ outputColorSpace->setTransform(transform, OCIO::COLORSPACE_DIR_FROM_REFERENCE);
+
+ editableConfig->addColorSpace(outputColorSpace);
+
+
+ baker->setConfig(editableConfig);
+ baker->setInputSpace(inputspace.c_str());
+ baker->setTargetSpace(outputspace.c_str());
+
+ std::ofstream f(path.c_str());
+ baker->bake(f);
+ }
+ }
+
+ }catch(...) { return false; }
+
+ return true;
+}
+
+
+void OpenColorIO_AE_Context::InitOCIOGL()
+{
+ if(!_gl_init)
+ {
+ SetPluginContext();
+
+ glGenTextures(1, &_imageTexID);
+ glGenTextures(1, &_lut3dTexID);
+
+ int num3Dentries = 3*LUT3D_EDGE_SIZE*LUT3D_EDGE_SIZE*LUT3D_EDGE_SIZE;
+ _lut3d.resize(num3Dentries);
+ memset(&_lut3d[0], 0, sizeof(float)*num3Dentries);
+
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_3D, _lut3dTexID);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+ glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA32F_ARB,
+ LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
+ 0, GL_RGB,GL_FLOAT, &_lut3d[0]);
+
+ _fragShader = 0;
+ _program = 0;
+
+ _bufferWidth = _bufferHeight = 0;
+
+ _gl_init = true;
+
+ SetAEContext();
+ }
+}
+
+
+static const char * g_fragShaderText = ""
+"\n"
+"uniform sampler2D tex1;\n"
+"uniform sampler3D tex2;\n"
+"\n"
+"void main()\n"
+"{\n"
+" vec4 col = texture2D(tex1, gl_TexCoord[0].st);\n"
+" gl_FragColor = OCIODisplay(col, tex2);\n"
+"}\n";
+
+
+static GLuint CompileShaderText(GLenum shaderType, const char *text)
+{
+ GLuint shader;
+ GLint stat;
+
+ shader = glCreateShader(shaderType);
+ glShaderSource(shader, 1, (const GLchar **) &text, NULL);
+ glCompileShader(shader);
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &stat);
+
+ if (!stat)
+ {
+ GLchar log[1000];
+ GLsizei len;
+ glGetShaderInfoLog(shader, 1000, &len, log);
+ return 0;
+ }
+
+ return shader;
+}
+
+
+static GLuint LinkShaders(GLuint fragShader)
+{
+ if (!fragShader) return 0;
+
+ GLuint program = glCreateProgram();
+
+ if (fragShader)
+ glAttachShader(program, fragShader);
+
+ glLinkProgram(program);
+
+ // check link
+ {
+ GLint stat;
+ glGetProgramiv(program, GL_LINK_STATUS, &stat);
+ if (!stat) {
+ GLchar log[1000];
+ GLsizei len;
+ glGetProgramInfoLog(program, 1000, &len, log);
+ //fprintf(stderr, "Shader link error:\n%s\n", log);
+ return 0;
+ }
+ }
+
+ return program;
+}
+
+
+void OpenColorIO_AE_Context::UpdateOCIOGLState()
+{
+ if(_gl_init)
+ {
+ SetPluginContext();
+
+ // Step 1: Create a GPU Shader Description
+ OCIO::GpuShaderDesc shaderDesc;
+ shaderDesc.setLanguage(OCIO::GPU_LANGUAGE_GLSL_1_0);
+ shaderDesc.setFunctionName("OCIODisplay");
+ shaderDesc.setLut3DEdgeLen(LUT3D_EDGE_SIZE);
+
+ // Step 2: Compute the 3D LUT
+ std::string lut3dCacheID = _processor->getGpuLut3DCacheID(shaderDesc);
+ if(lut3dCacheID != _lut3dcacheid)
+ {
+ _lut3dcacheid = lut3dCacheID;
+ _processor->getGpuLut3D(&_lut3d[0], shaderDesc);
+ }
+
+ // Step 3: Compute the Shader
+ std::string shaderCacheID = _processor->getGpuShaderTextCacheID(shaderDesc);
+ if(_program == 0 || shaderCacheID != _shadercacheid)
+ {
+ _shadercacheid = shaderCacheID;
+
+ std::ostringstream os;
+ os << _processor->getGpuShaderText(shaderDesc) << "\n";
+ os << g_fragShaderText;
+
+ if(_fragShader) glDeleteShader(_fragShader);
+ _fragShader = CompileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
+ if(_program) glDeleteProgram(_program);
+ _program = LinkShaders(_fragShader);
+ }
+
+ SetAEContext();
+ }
+}
+
+
+bool OpenColorIO_AE_Context::ProcessWorldGL(PF_EffectWorld *float_world)
+{
+ if(!_gl_init)
+ {
+ InitOCIOGL();
+ UpdateOCIOGLState();
+ }
+
+
+ if(_program == 0 || _fragShader == 0)
+ return false;
+
+
+ SetPluginContext();
+
+
+ GLint max;
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
+
+ if(max < float_world->width || max < float_world->height || GL_NO_ERROR != glGetError())
+ {
+ SetAEContext();
+ return false;
+ }
+
+
+ PF_PixelFloat *pix = (PF_PixelFloat *)float_world->data;
+ float *rgba_origin = &pix->red;
+
+
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, _imageTexID);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB, float_world->width, float_world->height, 0,
+ GL_RGBA, GL_FLOAT, rgba_origin);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+
+
+ glBindTexture(GL_TEXTURE_3D, _lut3dTexID);
+ glTexSubImage3D(GL_TEXTURE_3D, 0,
+ 0, 0, 0,
+ LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
+ GL_RGB, GL_FLOAT, &_lut3d[0]);
+
+
+ glUseProgram(_program);
+ glUniform1i(glGetUniformLocation(_program, "tex1"), 0);
+ glUniform1i(glGetUniformLocation(_program, "tex2"), 1);
+
+
+ if(GL_NO_ERROR != glGetError())
+ {
+ SetAEContext();
+ return false;
+ }
+
+
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, GetFrameBuffer());
+
+ if(_bufferWidth != float_world->width || _bufferHeight != float_world->height)
+ {
+ if(_bufferWidth != 0 && _bufferHeight != 0)
+ glDeleteRenderbuffersEXT(1, &_renderBuffer);
+
+ _bufferWidth = float_world->width;
+ _bufferHeight = float_world->height;
+
+ glGenRenderbuffersEXT(1, &_renderBuffer);
+ glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, _renderBuffer);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA, _bufferWidth, _bufferHeight);
+
+ // attach renderbuffer to framebuffer
+ glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ GL_RENDERBUFFER_EXT, _renderBuffer);
+ }
+
+ if(GL_FRAMEBUFFER_COMPLETE_EXT != glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT))
+ {
+ SetAEContext();
+ return false;
+ }
+
+ glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
+
+
+ glViewport(0, 0, float_world->width, float_world->height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0.0, float_world->width, 0.0, float_world->height, -100.0, 100.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+
+ glEnable(GL_TEXTURE_2D);
+ glClearColor(0.1f, 0.1f, 0.1f, 0.0f);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glColor3f(1, 1, 1);
+
+ glPushMatrix();
+ glBegin(GL_QUADS);
+ glTexCoord2f(0.0f, 1.0f);
+ glVertex2f(0.0f, float_world->height);
+
+ glTexCoord2f(0.0f, 0.0f);
+ glVertex2f(0.0f, 0.0f);
+
+ glTexCoord2f(1.0f, 0.0f);
+ glVertex2f(float_world->width, 0.0f);
+
+ glTexCoord2f(1.0f, 1.0f);
+ glVertex2f(float_world->width, float_world->height);
+
+ glEnd();
+ glPopMatrix();
+
+ glDisable(GL_TEXTURE_2D);
+
+
+ glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
+ glReadPixels(0, 0, float_world->width, float_world->height,
+ GL_RGBA, GL_FLOAT, rgba_origin);
+
+
+ glFinish();
+
+
+ SetAEContext();
+
+ return true;
+}
diff --git a/src/aftereffects/OpenColorIO_AE_Context.h b/src/aftereffects/OpenColorIO_AE_Context.h
new file mode 100644
index 0000000..8a3bf42
--- /dev/null
+++ b/src/aftereffects/OpenColorIO_AE_Context.h
@@ -0,0 +1,153 @@
+/*
+Copyright (c) 2003-2012 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY