Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed Aug 19, 2024
1 parent 780102b commit 83997e6
Show file tree
Hide file tree
Showing 25 changed files with 668 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ find_package(PNG REQUIRED)
find_package(JPEG REQUIRED)
find_package(TIFF REQUIRED)
find_package(OpenEXR REQUIRED)
find_package(minizip REQUIRED)
find_package(OpenColorIO REQUIRED)
find_package(OpenImageIO REQUIRED)
find_package(OTIO REQUIRED)
find_package(OpenFX REQUIRED)
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ with image sequences, effects, and transitions.
Dependencies:
* [OpenTimelineIO](https://github.com/AcademySoftwareFoundation/OpenTimelineIO) - Timelines
* [OpenImageIO](https://github.com/AcademySoftwareFoundation/OpenImageIO) - Image I/O and processing
* [OpenColorIO](https://github.com/AcademySoftwareFoundation/OpenColorIO) - Color space conversion
* [OpenFX](https://github.com/AcademySoftwareFoundation/openfx) - Plugins

Features
Expand All @@ -19,7 +20,7 @@ Features
* Filters: Blur, Color Map, Invert, Power, Saturate, Unsharp Mask
* Transforms: Flip, Flop, Resize, Rotate
* Transitions: Dissolve, Horizontal Wipe, Vertical Wipe
* Color space conversion: Premultiply Alpha, Un-Premultiply Alpha
* Color spaces: Color Convert, Premultiply Alpha, Un-Premultiply Alpha

Example Renders
===============
Expand Down Expand Up @@ -69,6 +70,10 @@ Transforms; resize, rotate, flip, and flop:

![Transforms](images/Transform.png)

Color space conversion:

![Color Space](images/ColorSpace.png)

Building
========

Expand Down
32 changes: 32 additions & 0 deletions cmake/SuperBuild/BuildOpenColorIO.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
include(ExternalProject)

set(OpenColorIO_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenColorIO.git")
set(OpenColorIO_GIT_TAG "v2.3.2")

set(OpenColorIO_ARGS
${toucan_EXTERNAL_PROJECT_ARGS}
-DCMAKE_INSTALL_LIBDIR=lib
-DOCIO_BUILD_APPS=OFF
-DOCIO_BUILD_TESTS=OFF
-DOCIO_BUILD_GPU_TESTS=OFF
-DOCIO_BUILD_PYTHON=OFF
-DOCIO_INSTALL_EXT_PACKAGES=NONE)
cmake_host_system_information(RESULT HAS_SSE2 QUERY HAS_SSE2)
list(APPEND OpenColorIO_ARGS -DOCIO_USE_SSE2=${HAS_SSE2})
#if(APPLE)
# execute_process(
# COMMAND uname -m
# RESULT_VARIABLE result
# OUTPUT_VARIABLE OpenColorIO_OSX_NATIVE_ARCH
# OUTPUT_STRIP_TRAILING_WHITESPACE)
# list(APPEND OpenColorIO_ARGS -DCMAKE_OSX_ARCHITECTURES=${OpenColorIO_OSX_NATIVE_ARCH})
#endif()

ExternalProject_Add(
OpenColorIO
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO
DEPENDS Imath yaml-cpp expat pystring minizip-ng ZLIB
GIT_REPOSITORY ${OpenColorIO_GIT_REPOSITORY}
GIT_TAG ${OpenColorIO_GIT_TAG}
LIST_SEPARATOR |
CMAKE_ARGS ${OpenColorIO_ARGS})
4 changes: 2 additions & 2 deletions cmake/SuperBuild/BuildOpenImageIO.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set(OpenImageIO_ARGS
-DOIIO_INSTALL_FONTS=ON
-DUSE_FREETYPE=ON
-DUSE_PNG=ON
-DUSE_OPENCOLORIO=ON
-DUSE_BZIP2=OFF
-DUSE_DCMTK=OFF
-DUSE_FFMPEG=OFF
Expand All @@ -21,7 +22,6 @@ set(OpenImageIO_ARGS
-DUSE_LIBHEIF=OFF
-DUSE_LIBRAW=OFF
-DUSE_NUKE=OFF
-DUSE_OPENCOLORIO=OFF
-DUSE_OPENCV=OFF
-DUSE_OPENJPEG=OFF
-DUSE_OPENVDB=OFF
Expand All @@ -34,7 +34,7 @@ set(OpenImageIO_ARGS
ExternalProject_Add(
OpenImageIO
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/OpenImageIO
DEPENDS TIFF PNG libjpeg-turbo OpenEXR Freetype
DEPENDS TIFF PNG libjpeg-turbo OpenEXR OpenColorIO Freetype
GIT_REPOSITORY ${OpenImageIO_GIT_REPOSITORY}
GIT_TAG ${OpenImageIO_GIT_TAG}
CMAKE_ARGS ${OpenImageIO_ARGS})
19 changes: 19 additions & 0 deletions cmake/SuperBuild/Buildexpat.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
include(ExternalProject)

set(expat_GIT_REPOSITORY "https://github.com/libexpat/libexpat.git")
set(expat_GIT_TAG "R_2_5_0")

set(expat_ARGS
${toucan_EXTERNAL_PROJECT_ARGS}
-DEXPAT_BUILD_TOOLS=OFF
-DEXPAT_BUILD_EXAMPLES=OFF
-DEXPAT_BUILD_TESTS=OFF)

ExternalProject_Add(
expat
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/expat
GIT_REPOSITORY ${expat_GIT_REPOSITORY}
GIT_TAG ${expat_GIT_TAG}
SOURCE_SUBDIR expat
LIST_SEPARATOR |
CMAKE_ARGS ${expat_ARGS})
27 changes: 27 additions & 0 deletions cmake/SuperBuild/Buildminizip-ng.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
include(ExternalProject)

set(minizip-ng_GIT_REPOSITORY "https://github.com/zlib-ng/minizip-ng.git")
set(minizip-ng_GIT_TAG "3.0.7")

set(minizip-ng_ARGS
${toucan_EXTERNAL_PROJECT_ARGS}
-DMZ_BZIP2=OFF
-DMZ_LZMA=OFF
-DMZ_ZSTD=OFF
-DMZ_LIBCOMP=OFF
-DMZ_FETCH_LIBS=OFF
-DMZ_PKCRYPT=OFF
-DMZ_WZAES=OFF
-DMZ_OPENSSL=OFF
-DMZ_BCRYPT=OFF
-DMZ_LIBBSD=OFF
-DMZ_ICONV=OFF)

ExternalProject_Add(
minizip-ng
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/minizip-ng
DEPENDS ZLIB
GIT_REPOSITORY ${minizip-ng_GIT_REPOSITORY}
GIT_TAG ${minizip-ng_GIT_TAG}
LIST_SEPARATOR |
CMAKE_ARGS ${minizip-ng_ARGS})
17 changes: 17 additions & 0 deletions cmake/SuperBuild/Buildpystring.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
include(ExternalProject)

set(pystring_GIT_REPOSITORY "https://github.com/imageworks/pystring.git")
set(pystring_GIT_TAG "v1.1.4")

set(pystring_ARGS ${toucan_EXTERNAL_PROJECT_ARGS})

ExternalProject_Add(
pystring
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pystring
GIT_REPOSITORY ${pystring_GIT_REPOSITORY}
GIT_TAG ${pystring_GIT_TAG}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/pystring-patch/CMakeLists.txt
${CMAKE_CURRENT_BINARY_DIR}/pystring/src/pystring/CMakeLists.txt
LIST_SEPARATOR |
CMAKE_ARGS ${pystring_ARGS})
18 changes: 18 additions & 0 deletions cmake/SuperBuild/Buildyaml-cpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include(ExternalProject)

set(yaml-cpp_GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git")
set(yaml-cpp_GIT_TAG "yaml-cpp-0.7.0")

set(yaml-cpp_ARGS
${toucan_EXTERNAL_PROJECT_ARGS}
-DYAML_CPP_BUILD_CONTRIB=OFF
-DYAML_CPP_BUILD_TOOLS=OFF
-DYAML_CPP_BUILD_TESTS=OFF)

ExternalProject_Add(
yaml-cpp
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/yaml-cpp
GIT_REPOSITORY ${yaml-cpp_GIT_REPOSITORY}
GIT_TAG ${yaml-cpp_GIT_TAG}
LIST_SEPARATOR |
CMAKE_ARGS ${yaml-cpp_ARGS})
5 changes: 5 additions & 0 deletions cmake/SuperBuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ include(BuildJPEG)
include(BuildTIFF)
include(BuildImath)
include(BuildOpenEXR)
include(Buildexpat)
include(Buildminizip-ng)
include(Buildpystring)
include(Buildyaml-cpp)
include(BuildOpenColorIO)
include(BuildOpenImageIO)
include(BuildOpenTimelineIO)
include(BuildOpenFX)
24 changes: 24 additions & 0 deletions cmake/SuperBuild/pystring-patch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.2)
project(pystring CXX)

#set(BUILD_SHARED_LIBS YES)

add_library(pystring
pystring.cpp
pystring.h
)
set_target_properties(pystring PROPERTIES PUBLIC_HEADER pystring.h)

add_executable (pystring_test test.cpp)
TARGET_LINK_LIBRARIES (pystring_test pystring)

#enable_testing()
#add_test(NAME PyStringTest COMMAND pystring_test)

include(GNUInstallDirs)

install(TARGETS pystring
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pystring
)

144 changes: 144 additions & 0 deletions data/ColorSpace.otio
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"OTIO_SCHEMA": "Timeline.1",
"metadata": {},
"name": "ColorSpace",
"tracks": {
"OTIO_SCHEMA": "Stack.1",
"children": [
{
"OTIO_SCHEMA": "Track.1",
"children": [
{
"OTIO_SCHEMA": "Clip.1",
"media_reference": {
"OTIO_SCHEMA": "ExternalReference.1",
"available_range": {
"OTIO_SCHEMA": "TimeRange.1",
"duration": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 3
},
"start_time": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 0
}
},
"target_url": "Charlie.jpg"
},
"source_range": {
"OTIO_SCHEMA": "TimeRange.1",
"duration": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 3
},
"start_time": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 0
}
},
"name": "Charlie"
},
{
"OTIO_SCHEMA": "Clip.1",
"media_reference": {
"OTIO_SCHEMA": "ExternalReference.1",
"available_range": {
"OTIO_SCHEMA": "TimeRange.1",
"duration": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 3
},
"start_time": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 0
}
},
"target_url": "Charlie.jpg"
},
"effects": [
{
"OTIO_SCHEMA": "ColorConvertEffect.1",
"effect_name": "",
"fromspace": "Linear Rec.709 (sRGB)",
"tospace": "ACEScct",
"unpremult": true,
"context_key": "",
"context_value": "",
"color_config": ""
}
],
"source_range": {
"OTIO_SCHEMA": "TimeRange.1",
"duration": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 3
},
"start_time": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 0
}
},
"name": "Charlie"
},
{
"OTIO_SCHEMA": "Clip.1",
"media_reference": {
"OTIO_SCHEMA": "ExternalReference.1",
"available_range": {
"OTIO_SCHEMA": "TimeRange.1",
"duration": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 3
},
"start_time": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 0
}
},
"target_url": "Charlie.jpg"
},
"effects": [
{
"OTIO_SCHEMA": "ColorConvertEffect.1",
"effect_name": "",
"fromspace": "Gamma 2.4 Rec.709 - Texture",
"tospace": "Linear P3-D65",
"unpremult": true,
"context_key": "",
"context_value": "",
"color_config": ""
}
],
"source_range": {
"OTIO_SCHEMA": "TimeRange.1",
"duration": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 3
},
"start_time": {
"OTIO_SCHEMA": "RationalTime.1",
"rate": 24,
"value": 0
}
},
"name": "Charlie"
}
],
"kind": "Video",
"name": "Video"
}
],
"name": "Stack"
}
}
Binary file added images/ColorSpace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions legal/LICENSE_expat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
Copyright (c) 2001-2022 Expat maintainers

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.
Loading

0 comments on commit 83997e6

Please sign in to comment.