Skip to content
Merged
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
27 changes: 27 additions & 0 deletions src/OpenColorIO/transforms/builtins/AppleCameras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
namespace OCIO_NAMESPACE
{

// Apple Wide Gamut primaries from the Apple Log 2 white paper.
namespace APPLE_WIDE_GAMUT
{
static const Chromaticities red_xy(0.725, 0.301);
static const Chromaticities grn_xy(0.221, 0.814);
static const Chromaticities blu_xy(0.068, -0.076);
static const Chromaticities wht_xy(0.3127, 0.3290);

const Primaries primaries(red_xy, grn_xy, blu_xy, wht_xy);
}

namespace APPLE_LOG
{

Expand Down Expand Up @@ -109,6 +120,22 @@ void RegisterAll(BuiltinTransformRegistryImpl & registry) noexcept
"Convert Apple Log to ACES2065-1",
APPLE_LOG_to_ACES2065_1_Functor);
}
{
// Apple Log 2 uses the same transfer function as Apple Log, but with the wider
// Apple Wide Gamut primaries rather than Rec.2020.
auto APPLE_LOG_APPLEWG_to_ACES2065_1_Functor = [](OpRcPtrVec & ops)
{
APPLE_LOG::GenerateAppleLogToLinearOps(ops);

MatrixOpData::MatrixArrayPtr matrix
= build_conversion_matrix(APPLE_WIDE_GAMUT::primaries, ACES_AP0::primaries, ADAPTATION_BRADFORD);
CreateMatrixOp(ops, matrix, TRANSFORM_DIR_FORWARD);
};

registry.addBuiltin("APPLE_LOG-APPLEWG_to_ACES2065-1",
"Convert Apple Log 2 Apple Wide Gamut to ACES2065-1",
APPLE_LOG_APPLEWG_to_ACES2065_1_Functor);
}
{
auto APPLE_LOG_to_Linear_Functor = [](OpRcPtrVec & ops)
{
Expand Down
3 changes: 3 additions & 0 deletions tests/cpu/transforms/BuiltinTransform_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,9 @@ AllValues UnitTestValues
{ "APPLE_LOG_to_ACES2065-1",
{ 1.0e-6f,
{ 0.5f, 0.4f, 0.3f }, { 0.153334766f, 0.083515430f, 0.032948254f } } },
{ "APPLE_LOG-APPLEWG_to_ACES2065-1",
{ 1.0e-6f,
{ 0.5f, 0.4f, 0.3f }, { 0.160302015f, 0.091223177f, 0.026405713f } } },
{ "CURVE - APPLE_LOG_to_LINEAR",
{ 1.0e-6f,
{ 0.5f, 0.4f, 0.3f }, { 0.198913991f, 0.083076466024f, 0.0315782763f } } },
Expand Down