Skip to content

Commit 00237a1

Browse files
authored
Merge branch 'main' into feature/add_rgba_for_metal
2 parents 0e66261 + 62d3557 commit 00237a1

File tree

87 files changed

+145
-28905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+145
-28905
lines changed

.readthedocs.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright Contributors to the OpenColorIO Project.
3+
4+
# Read the Docs configuration file
5+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
6+
7+
version: 2
8+
9+
build:
10+
os: ubuntu-20.04
11+
tools:
12+
python: "3.9"
13+
14+
sphinx:
15+
configuration: docs/conf.py
16+
17+
formats:
18+
- pdf
19+
- htmlzip
20+
21+
python:
22+
install:
23+
- requirements: docs/requirements.txt

docs/concepts/overview/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ high fidelity color imaging in modern computer graphics. This section introduces
1717
those concepts and general workflow practices. Additional information can be
1818
found in Jeremy Selan's Cinematic Color `document <http://cinematiccolor.org/>`_.
1919

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

docs/site/homepage/data/en/supported_apps.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ supported_apps:
1414
- name : Adobe After Effects
1515
image : images/supported_apps/ae.png
1616
categories : ["2D", "Compositing", "Animation"]
17-
content : Plugin required.
18-
link : "http://fnordware.blogspot.com/2012/05/opencolorio-for-after-effects.html"
17+
content : Native support.
18+
link : "https://helpx.adobe.com/after-effects/using/opencolorio-aces-color-management.html"
1919

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

167167
# portfolio item loop
168168
- name : PhotoFlow

include/OpenColorIO/OpenColorIO.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <string>
1313
#include <fstream>
1414
#include <vector>
15+
#include <cstdint>
1516

1617
#include "OpenColorABI.h"
1718
#include "OpenColorTypes.h"

share/dev/windows/ocio.bat

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ set INSTALL_PATH_OK=n
2222
rem Python location
2323
set PYTHON_PATH=
2424

25-
rem Microsoft Visual Studio path
26-
set MSVS_PATH=%programfiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build
25+
rem Microsoft Visual Studio path (will auto-find if not passed in cmd args)
26+
set MSVS_PATH=
2727

2828
set DO_CONFIGURE=0
2929

@@ -75,6 +75,22 @@ if NOT "%~1"=="" (
7575
goto :args_loop
7676
)
7777

78+
rem If not overridden by the cmd line args, find and use the latest Visual Studio
79+
if NOT DEFINED MSVS_PATH (
80+
for /f %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -format value -property installationPath -latest') do (
81+
echo Found Visual Studio installation at '%%i'
82+
set MSVS_PATH=%%i
83+
)
84+
)
85+
86+
IF NOT EXIST "!MSVS_PATH!" (
87+
echo Could not find MS Visual Studio. Please provide the location for Microsoft Visual Studio vcvars64.bat or modify MSVS_PATH in the script.
88+
rem The double dash are in quote here because otherwise the echo command thow an error.
89+
echo "--msvs <path>"
90+
echo E.g. C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
91+
exit /b
92+
)
93+
7894
rem Testing the path before cmake
7995
IF NOT EXIST "!VCPKG_PATH!" (
8096
echo Could not find Vcpkg. Please provide the location for vcpkg or modify VCPKG_PATH in this script.
@@ -103,14 +119,6 @@ if NOT EXIST "!PYTHON_PATH!\python.exe" (
103119
)
104120
)
105121

106-
IF NOT EXIST "!MSVS_PATH!" (
107-
echo Could not find MS Visual Studio. Please provide the location for Microsoft Visual Studio vcvars64.bat or modify MSVS_PATH in the script.
108-
rem The double dash are in quote here because otherwise the echo command thow an error.
109-
echo "--msvs <path>"
110-
echo E.g. C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build
111-
exit /b
112-
)
113-
114122
if !CUSTOM_BUILD_PATH!==0 (
115123
echo.
116124
set /p BUILD_PATH_OK=Default build path [!BUILD_PATH!] is used. Is it ok? [y/n]:
@@ -139,7 +147,7 @@ set INSTALL_PATH=!INSTALL_PATH!\!CMAKE_BUILD_TYPE!
139147

140148
rem ****************************************************************************************************************
141149
rem Setting up the environment using MS Visual Studio batch script
142-
set VCVARS64_PATH="!MSVS_PATH!\vcvars64.bat"
150+
set VCVARS64_PATH="!MSVS_PATH!\VC\Auxiliary\Build\vcvars64.bat"
143151
IF NOT EXIST !VCVARS64_PATH! (
144152
rem Checking for vcvars64.bat script.
145153
rem !MSVS_PATH! is checked earlier in the script
@@ -295,8 +303,8 @@ echo.
295303
echo Optional options depending on the environment:
296304
echo --python Python installation location
297305
echo.
298-
echo --msvs path where to find vcvars64.bat from Microsoft Visual Studio
299-
echo Default: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build
306+
echo --msvs Root folder of the Microsoft Visual Studio. (E.g. C:\Program Files\Microsoft Visual Studio\2022)
307+
echo Default: installation path of the latest Visual Studio found in the system by the vswhere.exe tool.
300308
echo.
301309
echo --b build location
302310
echo Default: %TEMP%\OCIO\build

share/dev/windows/ocio_deps.bat

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,14 @@ if ErrorLevel 1 (
104104
)
105105

106106
echo Checking for Microsoft Visual Studio...
107-
set MSVS=0
108-
for /d %%a in ("%programfiles%\Microsoft Visual Studio*") do (
109-
for /f "tokens=3 delims=\" %%x in ("%%a") do set MSVS=1
107+
set MSVS_PATH=
108+
for /f %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -format value -property installationPath -latest') do (
109+
echo Found Visual Studio installation at '%%i'
110+
set MSVS_PATH=%%i
110111
)
111112

112-
if !MSVS!==0 (
113-
echo No Microsoft Visual Studio installation was found in !programfiles!.
114-
echo For non-standard installation path, please use the following option:
115-
rem The double dash are in quote here because otherwise the echo command thow an error.
116-
echo "ocio_deps --vs <path>"
113+
if NOT EXIST !MSVS_PATH! (
114+
echo No Microsoft Visual Studio installation was found in the system.
117115
exit /b
118116
)
119117

src/OpenColorIO/FileRules.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ std::string ConvertToRegularExpression(const char * globPattern, bool ignoreCase
6262

6363
if (ignoreCase)
6464
{
65-
const size_t length = strlen(globPattern);
65+
const size_t length = std::strlen(globPattern);
6666
bool respectCase = false;
6767
for (size_t i = 0; i < length; ++i)
6868
{

src/OpenColorIO/NamedTransform.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,16 @@ std::ostream & operator<< (std::ostream & os, const NamedTransform & t)
244244
const auto numAliases = t.getNumAliases();
245245
if (numAliases == 1)
246246
{
247-
os << "alias= " << t.getAlias(0) << ", ";
247+
os << ", alias= " << t.getAlias(0);
248248
}
249249
else if (numAliases > 1)
250250
{
251-
os << "aliases=[" << t.getAlias(0);
251+
os << ", aliases=[" << t.getAlias(0);
252252
for (size_t aidx = 1; aidx < numAliases; ++aidx)
253253
{
254254
os << ", " << t.getAlias(aidx);
255255
}
256-
os << "], ";
256+
os << "]";
257257
}
258258
const std::string strFamily{ t.getFamily() };
259259
if (!strFamily.empty())

src/OpenColorIO/ops/lut1d/Lut1DOpGPU.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void GetLut1DGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator,
258258
{
259259
static const float NEG_MIN_EXP = 15.0f;
260260
static const float EXP_SCALE = 1024.0f;
261-
static const float HALF_DENRM_MAX = 6.09755515e-05f; // e.g. 2^-14 - 2^-24
261+
static const float INV_DENRM_STEP = 16777216.0f; // 1 / 2^-24
262262

263263
ss.newLine() << "float dep;";
264264
ss.newLine() << "float abs_f = abs(f);";
@@ -282,15 +282,15 @@ void GetLut1DGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator,
282282
ss.newLine() << "else";
283283
ss.newLine() << "{";
284284
ss.indent();
285-
// Extract bits from denormalized values
286-
ss.newLine() << "dep = abs_f * 1023.0 / " << HALF_DENRM_MAX << ";";
285+
// Extract bits from denormalized values.
286+
ss.newLine() << "dep = abs_f * " << INV_DENRM_STEP << ";";
287287
ss.dedent();
288288
ss.newLine() << "}";
289289

290-
// Adjust position for negative values
291-
ss.newLine() << "dep += step(f, 0.0) * 32768.0;";
290+
// Adjust position for negative values.
291+
ss.newLine() << "dep += (f < 0.) ? 32768.0 : 0.0;";
292292

293-
// At this point 'dep' contains the raw half
293+
// At this point 'dep' contains the raw half.
294294
// Note: Raw halfs for NaN floats cannot be computed using
295295
// floating-point operations.
296296
}

tests/cpu/Processor_tests.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace OCIO = OCIO_NAMESPACE;
1313

1414

15-
OCIO_ADD_TEST(Processor, basic)
15+
OCIO_ADD_TEST(Processor, basic_cache)
1616
{
1717
OCIO::ConfigRcPtr config = OCIO::Config::Create();
1818
OCIO::GroupTransformRcPtr group = OCIO::GroupTransform::Create();
@@ -56,6 +56,36 @@ OCIO_ADD_TEST(Processor, basic)
5656
OCIO_CHECK_EQUAL(std::string(processorMat->getCacheID()), "1b1880136f7669351adb0dcae0f4f9fd");
5757
}
5858

59+
OCIO_ADD_TEST(Processor, basic_cache_lut)
60+
{
61+
OCIO::ConfigRcPtr config = OCIO::Config::Create();
62+
OCIO::GroupTransformRcPtr group = OCIO::GroupTransform::Create();
63+
64+
auto processorEmptyGroup = config->getProcessor(group);
65+
OCIO_CHECK_EQUAL(processorEmptyGroup->getNumTransforms(), 0);
66+
OCIO_CHECK_EQUAL(std::string(processorEmptyGroup->getCacheID()), "<NOOP>");
67+
68+
auto lut = OCIO::Lut3DTransform::Create(3);
69+
// Make sure it's not an identity.
70+
lut->setValue(2, 2, 2, 2.f, 3.f, 4.f);
71+
72+
auto processorLut = config->getProcessor(lut);
73+
OCIO_CHECK_EQUAL(processorLut->getNumTransforms(), 1);
74+
OCIO_CHECK_EQUAL(std::string(processorLut->getCacheID()), "2b26d0097cdcf8f141fe3b3d6e21b5ec");
75+
76+
// Check behaviour of the cacheID
77+
78+
// Change a value and check that the cacheID changes.
79+
lut->setValue(2, 2, 2, 1.f, 3.f, 4.f);
80+
processorLut = config->getProcessor(lut);
81+
OCIO_CHECK_EQUAL(std::string(processorLut->getCacheID()), "288ec8ea132adaca5b5aed24a296a1a2");
82+
83+
// Restore the original value, check that the cache ID matches what it used to be.
84+
lut->setValue(2, 2, 2, 2.f, 3.f, 4.f);
85+
processorLut = config->getProcessor(lut);
86+
OCIO_CHECK_EQUAL(std::string(processorLut->getCacheID()), "2b26d0097cdcf8f141fe3b3d6e21b5ec");
87+
}
88+
5989
OCIO_ADD_TEST(Processor, unique_dynamic_properties)
6090
{
6191
OCIO::TransformDirection direction = OCIO::TRANSFORM_DIR_FORWARD;

0 commit comments

Comments
 (0)