Skip to content

Commit

Permalink
Remove D60 DCDM built-ins
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
  • Loading branch information
doug-walker committed Sep 23, 2024
1 parent b9a0909 commit 9d2f28e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 45 deletions.
44 changes: 3 additions & 41 deletions src/OpenColorIO/transforms/builtins/Displays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,34 +215,11 @@ void RegisterAll(BuiltinTransformRegistryImpl & registry) noexcept
CreateGammaOp(ops, gammaData, TRANSFORM_DIR_FORWARD);
};

registry.addBuiltin("DISPLAY - CIE-XYZ-D65_to_DCDM-D65",
"Convert CIE XYZ (D65 white) to Gamma 2.6, XYZ-E with D65 white",
registry.addBuiltin("DISPLAY - CIE-XYZ-D65_to_DCDM-D65",
"Convert CIE XYZ (D65 white) to Gamma 2.6 (D65 white in XYZ-E encoding)",
CIE_XYZ_D65_to_DCDM_D65_Functor);
}

{
auto CIE_XYZ_D65_to_DCDM_D60_BFD_Functor = [](OpRcPtrVec & ops)
{
MatrixOpData::MatrixArrayPtr matrix
= build_vonkries_adapt(WHITEPOINT::D65_XYZ, WHITEPOINT::D60_XYZ, ADAPTATION_BRADFORD);
CreateMatrixOp(ops, matrix, TRANSFORM_DIR_FORWARD);

const double scale = 48.0 / 52.37;
const double scale4[4] = { scale, scale, scale, 1. };
CreateScaleOp(ops, scale4, TRANSFORM_DIR_FORWARD);

const GammaOpData::Params rgbParams = { 2.6 };
const GammaOpData::Params alphaParams = { 1.0 };
auto gammaData = std::make_shared<GammaOpData>(GammaOpData::BASIC_REV,
rgbParams, rgbParams, rgbParams, alphaParams);
CreateGammaOp(ops, gammaData, TRANSFORM_DIR_FORWARD);
};

registry.addBuiltin("DISPLAY - CIE-XYZ-D65_to_DCDM-D60-BFD",
"Convert CIE XYZ (D65 white) to Gamma 2.6, XYZ-E with D60 white (Bradford adaptation)",
CIE_XYZ_D65_to_DCDM_D60_BFD_Functor);
}

{
auto CIE_XYZ_D65_to_DisplayP3_Functor = [](OpRcPtrVec & ops)
{
Expand Down Expand Up @@ -334,25 +311,10 @@ void RegisterAll(BuiltinTransformRegistryImpl & registry) noexcept
};

registry.addBuiltin("DISPLAY - CIE-XYZ-D65_to_ST2084-DCDM-D65",
"Convert CIE XYZ (D65 white) to ST-2084 (PQ), XYZ-E with D65 white",
"Convert CIE XYZ (D65 white) to ST-2084 (PQ) (D65 white in XYZ-E encoding)",
CIE_XYZ_D65_to_ST2084_DCDM_D65_Functor);
}

{
auto CIE_XYZ_D65_to_ST2084_DCDM_D60_BFD_Functor = [](OpRcPtrVec & ops)
{
MatrixOpData::MatrixArrayPtr matrix
= build_vonkries_adapt(WHITEPOINT::D65_XYZ, WHITEPOINT::D60_XYZ, ADAPTATION_BRADFORD);
CreateMatrixOp(ops, matrix, TRANSFORM_DIR_FORWARD);

ST_2084::GenerateLinearToPQOps(ops);
};

registry.addBuiltin("DISPLAY - CIE-XYZ-D65_to_ST2084-DCDM-D60-BFD",
"Convert CIE XYZ (D65 white) to ST-2084 (PQ), XYZ-E with D60 white (Bradford adaptation)",
CIE_XYZ_D65_to_ST2084_DCDM_D60_BFD_Functor);
}

{
auto CIE_XYZ_D65_to_REC2100_HLG_1000nit_Functor = [](OpRcPtrVec & ops)
{
Expand Down
8 changes: 4 additions & 4 deletions tests/cpu/transforms/BuiltinTransform_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ AllValues UnitTestValues
{ { 0.5f, 0.4f, 0.3f }, { 0.892433142142f, 0.627011653770f, 0.608093643982f } } },
{ "DISPLAY - CIE-XYZ-D65_to_DCDM-D65",
{ { 0.5f, 0.4f, 0.3f }, { 0.740738422348f, 0.679816639411f, 0.608609083713f } } },
{ "DISPLAY - CIE-XYZ-D65_to_DCDM-D60-BFD",
{ { 0.5f, 0.4f, 0.3f }, { 0.743277474049f, 0.680864385526f, 0.590880497136f } } },
{ "DISPLAY - CIE-XYZ-D65_to_DisplayP3",
{ { 0.5f, 0.4f, 0.3f }, { 0.882580907776f, 0.581526360743f, 0.5606367050000f } } },

Expand All @@ -491,8 +489,6 @@ AllValues UnitTestValues
{ { 0.5f, 0.4f, 0.3f }, { 0.479939091128f, 0.392091860770f, 0.384886051856f } } },
{ "DISPLAY - CIE-XYZ-D65_to_ST2084-DCDM-D65",
{ { 0.5f, 0.4f, 0.3f }, { 0.440281573420f, 0.419284117712f, 0.392876186489f } } },
{ "DISPLAY - CIE-XYZ-D65_to_ST2084-DCDM-D60-BFD",
{ { 0.5f, 0.4f, 0.3f }, { 0.441127667134f, 0.419657032632f, 0.385952725452f } } },
{ "DISPLAY - CIE-XYZ-D65_to_REC.2100-HLG-1000nit",
{ { 0.5f, 0.4f, 0.3f }, { 0.5649694f, 0.4038837f, 0.3751478f } } }
};
Expand Down Expand Up @@ -533,4 +529,8 @@ OCIO_ADD_TEST(Builtins, validate)
ValidateBuiltinTransform(name, values.first, values.second, __LINE__);
}
}

// The above checks if a test values is missing, but not if there are test values
// that don't have an associated built-in.
OCIO_CHECK_EQUAL(UnitTestValues.size(), reg->getNumBuiltins());
}

0 comments on commit 9d2f28e

Please sign in to comment.