From fbba11b06b26d67a75df48d11b12bc23528c8e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 8 Mar 2024 06:32:54 -0300 Subject: [PATCH] Made OCIO's ICS be a parameter of the image. --- mrv2/docs/HISTORY.md | 2 ++ mrv2/lib/mrvApp/mrvApp.cpp | 6 +++++- mrv2/lib/mrvApp/mrvFilesModel.h | 2 ++ mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index d9358d73f..708a5dae2 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -16,6 +16,8 @@ v1.0.8 - Added -ics (-ocioInput), -od (ocioDisplay), -ov (-ocioView) and -ol (-ocioLook) command-line flags to override the default settings. Note that -ocioDisplay and -ocioView must be used together. + - Made OCIO Input Color Space be stored with the image, except when doing + comparisons in which the first image's Input Color Space is used. v1.0.7 ====== diff --git a/mrv2/lib/mrvApp/mrvApp.cpp b/mrv2/lib/mrvApp/mrvApp.cpp index b59982381..0c036a6c9 100644 --- a/mrv2/lib/mrvApp/mrvApp.cpp +++ b/mrv2/lib/mrvApp/mrvApp.cpp @@ -1259,6 +1259,7 @@ namespace mrv p.active[0]->audioOffset = p.timelinePlayers[0]->audioOffset(); p.active[0]->annotations = p.timelinePlayers[0]->getAllAnnotations(); + p.active[0]->ocioIcs = image::ocioIcs(); } std::vector newTimelinePlayers; @@ -1423,7 +1424,10 @@ namespace mrv set_edit_mode_cb(EditMode::kFull, ui); } - Preferences::updateICS(); + if (p.active[0]->ocioIcs.empty()) + Preferences::updateICS(); + else + image::setOcioIcs(p.active[0]->ocioIcs); if (p.running) { diff --git a/mrv2/lib/mrvApp/mrvFilesModel.h b/mrv2/lib/mrvApp/mrvFilesModel.h index c1ad934ee..39ebf750b 100644 --- a/mrv2/lib/mrvApp/mrvFilesModel.h +++ b/mrv2/lib/mrvApp/mrvFilesModel.h @@ -48,6 +48,8 @@ namespace mrv bool mute = false; double audioOffset = 0.0; + std::string ocioIcs; + std::vector > annotations; }; diff --git a/mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp b/mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp index 7a195c086..c469f6c48 100644 --- a/mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp +++ b/mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp @@ -24,6 +24,7 @@ namespace mrv j["volume"] = value.volume; j["mute"] = value.mute; j["audioOffset"] = value.audioOffset; + j["ocioIcs"] = value.ocioIcs; std::vector< draw::Annotation > annotations; for (const auto& annotation : value.annotations) { @@ -65,6 +66,8 @@ namespace mrv j.at("volume").get_to(value.volume); j.at("mute").get_to(value.mute); j.at("audioOffset").get_to(value.audioOffset); + if (j.contains("ocioIcs")) + j.at("ocioIcs").get_to(value.ocioIcs); const nlohmann::json& annotations = j["annotations"]; for (const auto& annotation : annotations) {