Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIIO #143

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

OIIO #143

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
CC: ${{matrix.cc_compiler}}
CMAKE_CXX_STANDARD: ${{matrix.cxx_std}}
OPENEXR_VERSION: ${{matrix.openexr_ver}}
CMAKE_CXX_FLAGS: "-lstdc++fs"
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -83,40 +84,46 @@ jobs:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
title: [ubuntu, windows, macos]
build_type: [Release]
c_compiler: [gcc, clang, cl]
include:
- os: windows-latest
- title: windows
os: windows-latest
c_compiler: cl
cpp_compiler: cl
install_deps: install_deps_windows
toolchain_file: "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
build_shared_libs: OFF
- os: ubuntu-latest
- title: ubuntu
os: ubuntu-24.04
c_compiler: gcc
cpp_compiler: g++
install_deps: install_deps_linux
- os: ubuntu-latest
c_compiler: clang
- title: ubuntu
os: ubuntu-24.04
cpp_compiler: clang++
install_deps: install_deps_linux
- os: macos-latest
- title: macos
os: macos-latest
c_compiler: clang
cpp_compiler: clang++
install_deps: install_deps_mac
exclude:
- os: windows-latest
- title: windows
c_compiler: gcc
- os: windows-latest
- title: windows
c_compiler: clang
- os: ubuntu-latest
- title: ubuntu
c_compiler: cl
- os: macos-latest
- title: macos
c_compiler: cl
- os: macos-latest
- title: macos
c_compiler: gcc

env:
CMAKE_CXX_FLAGS: "-lstdc++fs"

steps:
- uses: actions/checkout@v4

Expand All @@ -140,7 +147,7 @@ jobs:
cmake
-B ${{ steps.strings.outputs.build-output-dir }}
-S ${{ github.workspace }}
-DCXX_STANDARD=C++14
-DCXX_STANDARD=C++17
-DCMAKE_TOOLCHAIN_FILE="${{ matrix.toolchain_file }}"
-DENABLE_SHARED="${{ matrix.build_shared_libs }}"

Expand Down
33 changes: 4 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ set(RAWTOACESLIB "rawtoaces_util")
set( CMAKE_MACOSX_RPATH 1 )

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# set(warnings "/W4 /WX /EHsc")
add_compile_options ( /W0 )
add_compile_definitions( NOMINMAX )
add_compile_options ( $<$<COMPILE_LANGUAGE:CXX>:/utf-8> )
endif()

if (NOT CONFIGURED_ONCE)
Expand Down Expand Up @@ -74,8 +74,10 @@ include_directories( "${PROJECT_SOURCE_DIR}/include" )
add_definitions( -DPACKAGE="RAWTOACES" -DVERSION="${RAWTOACES_VERSION}" )
add_subdirectory("src/${RAWTOACESIDTLIB}")
add_subdirectory("src/${RAWTOACESLIB}")
add_subdirectory("src/rawtoaces")


add_subdirectory("src/rawtoaces_util2")
add_subdirectory("src/rawtoaces2")

# Create a RAWTOACESBuildTreeSettings.cmake file for the use from the build tree
file(RELATIVE_PATH CONF_REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${INSTALL_INCLUDE_DIR}")
Expand All @@ -102,36 +104,9 @@ if ( APPLE OR UNIX )
install (DIRECTORY data DESTINATION include/rawtoaces)
endif()

### to build rawtoaces ###

add_executable( rawtoaces
main.cpp
)

target_include_directories( rawtoaces
PUBLIC
${AcesContainer_INCLUDE_DIRS}
)

target_link_libraries ( rawtoaces
PUBLIC
${RAWTOACESLIB}
INTERFACE
Boost::headers
)

if ( LIBRAW_CONFIG_FOUND )
target_link_libraries ( rawtoaces PUBLIC libraw::raw )
else ()
target_link_directories(rawtoaces PUBLIC ${libraw_LIBRARY_DIRS} )
target_link_libraries(rawtoaces PUBLIC ${libraw_LIBRARIES} ${libraw_LDFLAGS_OTHER} )
endif ()

enable_testing()
add_subdirectory(unittest)

install( TARGETS rawtoaces DESTINATION bin )

# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
Expand Down
1 change: 1 addition & 0 deletions build_scripts/install_deps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ time sudo apt-get update

time sudo apt-get -q -f install -y \
libunwind-dev libilmbase-dev libopenexr-dev \
libopenimageio-dev \
libboost-dev libboost-thread-dev libboost-filesystem-dev \
libboost-test-dev \
libraw-dev libceres-dev
8 changes: 6 additions & 2 deletions build_scripts/install_deps_linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ set -ex
time sudo apt-get update

time sudo apt-get -q -f install -y \
libunwind-dev libimath-dev \
libunwind-dev \
libimath-dev libopenexr-dev \
libboost-dev libboost-filesystem-dev \
libboost-test-dev \
libraw-dev libceres-dev
libraw-dev libceres-dev \
libopencv-dev \
openimageio-tools \
libopenimageio-dev
2 changes: 1 addition & 1 deletion build_scripts/install_deps_mac.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -ex

brew install ceres-solver imath openexr libraw boost
brew install ceres-solver imath openexr libraw boost openimageio
1 change: 1 addition & 0 deletions build_scripts/install_deps_windows.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ vcpkg install \
libraw:x64-windows \
ceres:x64-windows \
imath:x64-windows \
openimageio:x64-windows \
boost-system:x64-windows \
boost-foreach:x64-windows \
boost-filesystem:x64-windows \
Expand Down
1 change: 1 addition & 0 deletions configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/CMake")


find_package ( OpenImageIO CONFIG REQUIRED )
find_package ( AcesContainer CONFIG REQUIRED )
find_package ( Eigen3 CONFIG REQUIRED )
find_package ( Imath CONFIG REQUIRED )
Expand Down
18 changes: 16 additions & 2 deletions include/rawtoaces/define.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,20 @@ static const double XYZ_acesrgb_4[4][4] = {
{ 0.0, 0.0, 0.0, 1.0 }
};

static const float XYZ_acesrgb_float_4[4][4] = {
{ 1.0498110175, 0.0000000000, -0.0000974845, 0.0 },
{ -0.4959030231, 1.3733130458, 0.0982400361, 0.0 },
{ 0.0000000000, 0.0000000000, 0.9912520182, 0.0 },
{ 0.0, 0.0, 0.0, 1.0 }
};

static const float XYZ_acesrgb_transposed_4[4][4] = {
{ 1.0498110175, -0.4959030231, 0.0000000000, 0.0 },
{ 0.0000000000, 1.3733130458, 0.0000000000, 0.0 },
{ -0.0000974845, 0.0982400361, 0.9912520182, 0.0 },
{ 0.0000000000, 0.0000000000, 0.0000000000, 1.0 }
};

static const double acesrgb_XYZ_3[3][3] = {
{ 0.952552395938186, 0.0, 9.36786316604686e-05 },
{ 0.343966449765075, 0.728166096613485, -0.0721325463785608 },
Expand Down Expand Up @@ -390,8 +404,8 @@ inline bool isCTLetterDigit( const char c )
// to represent color temperature(s) (e.g., D60, 3200K)
inline bool isValidCT( string str )
{
int i = 0;
int length = str.length();
int i = 0;
size_t length = str.length();

if ( length == 0 )
return false;
Expand Down
29 changes: 29 additions & 0 deletions include/rawtoaces/metadata.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright Contributors to the rawtoaces project.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/AcademySoftwareFoundation/rawtoaces

#ifndef RTA_METADATA_H_
#define RTA_METADATA_H_

namespace rta
{

struct Metadata
{
// Colorimetry
std::vector<double> cameraCalibration1;
std::vector<double> cameraCalibration2;
std::vector<double> xyz2rgbMatrix1;
std::vector<double> xyz2rgbMatrix2;
double calibrationIlluminant1;
double calibrationIlluminant2;

std::vector<double> analogBalance;
std::vector<double> neutralRGB;

double baselineExposure;
};

} // namespace rta

#endif // RTA_METADATA_H_
Loading