Skip to content

Commit 7bdee2c

Browse files
lgritzscott-wilson
authored andcommitted
fix: Add some color space aliases (AcademySoftwareFoundation#4166)
Automatically recognize some additional color space name synonyms: "srgb_texture", "lin_rec709" and "lin_ap1" are names that MaterialX and USD use as canonical names. Also add common permutation "srgb_tx" and "srgb texture" as additional aliases for srgb. Fixes AcademySoftwareFoundation#4165 Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Scott Wilson <scott@propersquid.com>
1 parent 77b63cd commit 7bdee2c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/libOpenImageIO/color_ocio.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,15 +592,20 @@ ColorConfig::Impl::classify_by_name(CSInfo& cs)
592592
// believe them! Woe be unto the poor soul who names a color space "sRGB"
593593
// or "ACEScg" and it's really something entirely different.
594594
if (Strutil::iequals(cs.name, "sRGB")
595+
|| Strutil::iequals(cs.name, "srgb_tx")
596+
|| Strutil::iequals(cs.name, "srgb_texture")
597+
|| Strutil::iequals(cs.name, "srgb texture")
595598
|| Strutil::iequals(cs.name, "sRGB - Texture")) {
596599
cs.setflag(CSInfo::is_srgb, srgb_alias);
597600
} else if (Strutil::iequals(cs.name, "Rec709")) {
598601
cs.setflag(CSInfo::is_Rec709, Rec709_alias);
599602
} else if (Strutil::iequals(cs.name, "lin_srgb")
603+
|| Strutil::iequals(cs.name, "lin_rec709")
600604
|| Strutil::iequals(cs.name, "Linear Rec.709 (sRGB)")) {
601605
cs.setflag(CSInfo::is_lin_srgb | CSInfo::is_linear_response,
602606
lin_srgb_alias);
603-
} else if (Strutil::iequals(cs.name, "ACEScg")) {
607+
} else if (Strutil::iequals(cs.name, "ACEScg")
608+
|| Strutil::iequals(cs.name, "lin_ap1")) {
604609
cs.setflag(CSInfo::is_ACEScg | CSInfo::is_linear_response,
605610
ACEScg_alias);
606611
}
@@ -728,6 +733,8 @@ ColorConfig::Impl::reclassify_heuristics(CSInfo& cs)
728733
void
729734
ColorConfig::Impl::identify_builtin_equivalents()
730735
{
736+
if (disable_builtin_configs)
737+
return;
731738
#if OCIO_VERSION_HEX >= MAKE_OCIO_VERSION_HEX(2, 3, 0)
732739
Timer timer;
733740
if (auto n = IdentifyBuiltinColorSpace("srgb_tx")) {

0 commit comments

Comments
 (0)