Skip to content

Commit

Permalink
Merge branch 'main' into cozdas/MSVC_FindImprovement
Browse files Browse the repository at this point in the history
  • Loading branch information
cozdas authored Sep 4, 2024
2 parents ab585d6 + 46bce12 commit d9fc002
Show file tree
Hide file tree
Showing 150 changed files with 4,019 additions and 29,935 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
image: aswf/ci-ocio:${{ matrix.vfx-cy }}
strategy:
fail-fast: true
matrix:
build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
include:
Expand Down Expand Up @@ -233,6 +234,8 @@ jobs:
env:
CXX: ${{ matrix.cxx-compiler }}
CC: ${{ matrix.cc-compiler }}
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -316,7 +319,7 @@ jobs:
# ---------------------------------------------------------------------------

macos:
name: 'macOS 11
name: 'macOS 12
<AppleClang
arch=${{ matrix.arch-type }},
config=${{ matrix.build-type }},
Expand All @@ -330,7 +333,7 @@ jobs:
if: |
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name != github.repository
runs-on: macos-11
runs-on: macos-12
strategy:
matrix:
build: [1, 2, 3, 4]
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ mastercopy
*.pyc
!*.yml
.vscode

src/apps/ocioview/poetry.lock
39 changes: 39 additions & 0 deletions docs/api/python/src/pyopencolorio_gradingprimary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,42 @@
:members:
:undoc-members:
:special-members: __init__, __str__

.. attribute:: brightness
:type: GradingRGBM

.. attribute:: clampBlack
:type: float

.. attribute:: clampWhite
:type: float

.. attribute:: contrast
:type: GradingRGBM

.. attribute:: exposure
:type: GradingRGBM

.. attribute:: gain
:type: GradingRGBM

.. attribute:: gamma
:type: GradingRGBM

.. attribute:: lift
:type: GradingRGBM

.. attribute:: offset
:type: GradingRGBM

.. attribute:: pivot
:type: float

.. attribute:: pivotBlack
:type: float

.. attribute:: pivotWhite
:type: float

.. attribute:: saturation
:type: float
4 changes: 2 additions & 2 deletions docs/concepts/overview/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ high fidelity color imaging in modern computer graphics. This section introduces
those concepts and general workflow practices. Additional information can be
found in Jeremy Selan's Cinematic Color `document <http://cinematiccolor.org/>`_.

While OCIO is a color management library, it's only knowledge of color science
comes from it's execution of the transforms defined in the OCIO configuration
While OCIO is a color management library, its only knowledge of color science
comes from its execution of the transforms defined in the OCIO configuration
file. These transforms are either defined by the end user in a custom OCIO
config or inherited from the publicly available configs.

Expand Down
5 changes: 4 additions & 1 deletion docs/guides/using_ocio/compatible_software.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,12 @@ PhotoFlow supports OCIO via a dedicated tool that can load a given configuration
Website : `<https://github.com/aferrero2707/PhotoFlow>`__


Photoshop
Photoshop (beta)
*********
OCIO can be enabled via a technology preview checkbox in preferences. For more details see `OpenColorIO and 32-bit Editing now available in Photoshop Beta <https://community.adobe.com/t5/photoshop-beta-discussions/new-feature-opencolorio-and-32-bit-editing-now-available-in-photoshop-beta/td-p/14767506>`__.

Photoshop
*********
OpenColorIO display luts can be exported as ICC profiles for use in photoshop. 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.

Website : `<https://www.adobe.com/products/photoshop.html>`__
Expand Down
8 changes: 4 additions & 4 deletions docs/site/homepage/data/en/supported_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ supported_apps:
- name : Adobe After Effects
image : images/supported_apps/ae.png
categories : ["2D", "Compositing", "Animation"]
content : Plugin required.
link : "http://fnordware.blogspot.com/2012/05/opencolorio-for-after-effects.html"
content : Native support.
link : "https://helpx.adobe.com/after-effects/using/opencolorio-aces-color-management.html"

# portfolio item loop
- name : Anchorpoint
Expand Down Expand Up @@ -161,8 +161,8 @@ supported_apps:
- name : Adobe Photoshop
image : images/supported_apps/ps.png
categories : ["2D", "Photography", "Paint"]
content : Plugin required.
link : "http://fnordware.blogspot.com/2017/02/opencolorio-for-photoshop.html"
content : Beta support.
link : "https://community.adobe.com/t5/photoshop-beta-discussions/new-feature-opencolorio-and-32-bit-editing-now-available-in-photoshop-beta/m-p/14787280"

# portfolio item loop
- name : PhotoFlow
Expand Down
1 change: 1 addition & 0 deletions include/OpenColorIO/OpenColorIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <string>
#include <fstream>
#include <vector>
#include <cstdint>

#include "OpenColorABI.h"
#include "OpenColorTypes.h"
Expand Down
8 changes: 7 additions & 1 deletion share/ci/scripts/linux/yum/install_docs_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ set -ex

HERE=$(dirname $0)

bash $HERE/install_doxygen.sh latest
# The yum install doxygen command started failing during CI since mirrorlist.centos.org
# was turned off. However, it seems that Doxygen is already installed on the containers
# used for CI, so this command is not currently necessary there. You will need to
# uncomment this line if you want to build the documentation on Linux but don't have
# doxygen already installed.
# bash $HERE/install_doxygen.sh latest

pip install -r $HERE/../../../../../docs/requirements.txt
1 change: 1 addition & 0 deletions share/cmake/modules/install/Installminizip-ng.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ if(NOT minizip-ng_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_P
--config ${CMAKE_BUILD_TYPE}
--target install
--parallel
DEPENDS ZLIB::ZLIB # minizip-ng depends on zlib
)

add_dependencies(MINIZIP::minizip-ng minizip-ng_install)
Expand Down
26 changes: 11 additions & 15 deletions src/OpenColorIO/OCIOYaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4034,7 +4034,7 @@ inline void load(const YAML::Node & node, ViewingRulesRcPtr & vr)
catch (Exception & ex)
{
std::ostringstream os;
os << "File rules: " << ex.what();
os << "Viewing rules: " << ex.what();
throwError(node, os.str().c_str());
}
}
Expand Down Expand Up @@ -4658,13 +4658,15 @@ inline void load(const YAML::Node& node, ConfigRcPtr & config, const char* filen
config->setWorkingDir(configrootdir.c_str());
}

auto defaultCS = config->getColorSpace(ROLE_DEFAULT);
if (!fileRulesFound)
{
if (config->getMajorVersion() >= 2)
{
if (!defaultCS)
if (!config->hasRole(ROLE_DEFAULT))
{
// Note that no validation of the default color space is done (e.g. to check that
// it exists in the config) in order to enable loading configs that are only
// partially complete. The caller may use config->validate() after, if desired.
throwError(node, "The config must contain either a Default file rule or "
"the 'default' role.");
}
Expand All @@ -4683,6 +4685,7 @@ inline void load(const YAML::Node& node, ConfigRcPtr & config, const char* filen
else
{
// If default role is also defined.
auto defaultCS = config->getColorSpace(ROLE_DEFAULT);
if (defaultCS)
{
const auto defaultRule = fileRules->getNumEntries() - 1;
Expand Down Expand Up @@ -4815,18 +4818,11 @@ inline void save(YAML::Emitter & out, const Config & config)
const char* role = config.getRoleName(i);
if(role && *role)
{
ConstColorSpaceRcPtr colorspace = config.getColorSpace(role);
if(colorspace)
{
out << YAML::Key << role;
out << YAML::Value << config.getColorSpace(role)->getName();
}
else
{
std::ostringstream os;
os << "Colorspace associated to the role '" << role << "', does not exist.";
throw Exception(os.str().c_str());
}
// Note that no validation of the name strings is done here (e.g. to check that
// they exist in the config) in order to enable serializing configs that are only
// partially complete. The caller may use config->validate() first, if desired.
out << YAML::Key << role;
out << YAML::Value << config.getRoleColorSpace(i);
}
}
out << YAML::EndMap;
Expand Down
139 changes: 109 additions & 30 deletions src/apps/ocioconvert/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,40 @@ int main(int argc, const char **argv)
std::vector<std::string> intAttrs;
std::vector<std::string> stringAttrs;

bool usegpu = false;
bool usegpuLegacy = false;
bool outputgpuInfo = false;
bool verbose = false;
bool help = false;
bool useLut = false;
bool useDisplayView = false;
bool useInvertView = false;
bool usegpu = false;
bool usegpuLegacy = false;
bool outputgpuInfo = false;
bool verbose = false;
bool help = false;
bool useLut = false;
bool useDisplayView = false;
bool useInvertView = false;
bool useNamedTransform = false;
bool useInvNamedTransform = false;

ap.options("ocioconvert -- apply colorspace transform to an image \n\n"
"usage: ocioconvert [options] inputimage inputcolorspace outputimage outputcolorspace\n"
" or: ocioconvert [options] --lut lutfile inputimage outputimage\n"
" or: ocioconvert [options] --view inputimage inputcolorspace outputimage displayname viewname\n"
" or: ocioconvert [options] --invertview inputimage displayname viewname outputimage outputcolorspace\n\n",
" or: ocioconvert [options] --invertview inputimage displayname viewname outputimage outputcolorspace\n"
" or: ocioconvert [options] --namedtransform transformname inputimage outputimage\n"
" or: ocioconvert [options] --invnamedtransform transformname inputimage outputimage\n\n",
"%*", parse_end_args, "",
"<SEPARATOR>", "Options:",
"--lut", &useLut, "Convert using a LUT rather than a config file",
"--view", &useDisplayView, "Convert to a (display,view) pair rather than to "
"an output color space",
"--invertview", &useInvertView, "Convert from a (display,view) pair rather than "
"from a color space",
"--gpu", &usegpu, "Use GPU color processing instead of CPU (CPU is the default)",
"--gpulegacy", &usegpuLegacy, "Use the legacy (i.e. baked) GPU color processing "
"instead of the CPU one (--gpu is ignored)",
"--gpuinfo", &outputgpuInfo, "Output the OCIO shader program",
"--h", &help, "Display the help and exit",
"--help", &help, "Display the help and exit",
"-v" , &verbose, "Display general information",
"--lut", &useLut, "Convert using a LUT rather than a config file",
"--view", &useDisplayView, "Convert to a (display,view) pair rather than to "
"an output color space",
"--invertview", &useInvertView, "Convert from a (display,view) pair rather than "
"from a color space",
"--namedtransform", &useNamedTransform, "Convert using a named transform in the forward direction",
"--invnamedtransform", &useInvNamedTransform, "Convert using a named transform in the inverse direction",
"--gpu", &usegpu, "Use GPU color processing instead of CPU (CPU is the default)",
"--gpulegacy", &usegpuLegacy, "Use the legacy (i.e. baked) GPU color processing "
"instead of the CPU one (--gpu is ignored)",
"--gpuinfo", &outputgpuInfo, "Output the OCIO shader program",
"--h", &help, "Display the help and exit",
"--help", &help, "Display the help and exit",
"-v" , &verbose, "Display general information",
"<SEPARATOR>", "\nOpenImageIO or OpenEXR options:",
"--float-attribute %L", &floatAttrs, "\"name=float\" pair defining OIIO float attribute "
"for outputimage",
Expand Down Expand Up @@ -109,15 +115,16 @@ int main(int argc, const char **argv)
}
#endif // OCIO_GPU_ENABLED

const char * inputimage = nullptr;
const char * inputcolorspace = nullptr;
const char * outputimage = nullptr;
const char * outputcolorspace = nullptr;
const char * lutFile = nullptr;
const char * display = nullptr;
const char * view = nullptr;

if (!useLut && !useDisplayView && !useInvertView)
const char * inputimage = nullptr;
const char * inputcolorspace = nullptr;
const char * outputimage = nullptr;
const char * outputcolorspace = nullptr;
const char * lutFile = nullptr;
const char * display = nullptr;
const char * view = nullptr;
const char * namedtransform = nullptr;

if (!useLut && !useDisplayView && !useInvertView && !useNamedTransform && !useInvNamedTransform)
{
if (args.size() != 4)
{
Expand Down Expand Up @@ -186,6 +193,50 @@ int main(int argc, const char **argv)
outputimage = args[3].c_str();
outputcolorspace = args[4].c_str();
}
else if (useNamedTransform)
{
if (useLut || useDisplayView || useInvertView || useInvNamedTransform)
{
std::cerr << "ERROR: Option namedtransform can't be used with lut, view, invertview, \
or invnamedtransform at the same time." << std::endl;
ap.usage();
exit(1);
}

if (args.size() != 3)
{
std::cerr << "ERROR: Expecting 3 arguments for --namedtransform option, found "
<< args.size() << "." << std::endl;
ap.usage();
exit(1);
}

namedtransform = args[0].c_str();
inputimage = args[1].c_str();
outputimage = args[2].c_str();
}
else if (useInvNamedTransform)
{
if (useLut || useDisplayView || useInvertView || useNamedTransform)
{
std::cerr << "ERROR: Option invnamedtransform can't be used with lut, view, invertview, \
or namedtransform at the same time." << std::endl;
ap.usage();
exit(1);
}

if (args.size() != 3)
{
std::cerr << "ERROR: Expecting 3 arguments for --invnamedtransform option, found "
<< args.size() << "." << std::endl;
ap.usage();
exit(1);
}

namedtransform = args[0].c_str();
inputimage = args[1].c_str();
outputimage = args[2].c_str();
}

if (verbose)
{
Expand Down Expand Up @@ -343,6 +394,34 @@ int main(int argc, const char **argv)
t->setView(view);
processor = config->getProcessor(t, OCIO::TRANSFORM_DIR_INVERSE);
}
else if (useNamedTransform)
{
auto nt = config->getNamedTransform(namedtransform);

if (nt)
{
processor = config->getProcessor(nt, OCIO::TRANSFORM_DIR_FORWARD);
}
else
{
std::cout << "ERROR: Could not get NamedTransform " << namedtransform << std::endl;
exit(1);
}
}
else if (useInvNamedTransform)
{
auto nt = config->getNamedTransform(namedtransform);

if (nt)
{
processor = config->getProcessor(nt, OCIO::TRANSFORM_DIR_INVERSE);
}
else
{
std::cout << "ERROR: Could not get NamedTransform " << namedtransform << std::endl;
exit(1);
}
}
else
{
processor = config->getProcessor(inputcolorspace, outputcolorspace);
Expand Down
Loading

0 comments on commit d9fc002

Please sign in to comment.