Skip to content

Commit

Permalink
Made OCIO's ICS be a parameter of the image.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Mar 8, 2024
1 parent 4317303 commit fbba11b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
======
Expand Down
6 changes: 5 additions & 1 deletion mrv2/lib/mrvApp/mrvApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TimelinePlayer*> newTimelinePlayers;
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions mrv2/lib/mrvApp/mrvFilesModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace mrv
bool mute = false;
double audioOffset = 0.0;

std::string ocioIcs;

std::vector<std::shared_ptr<draw::Annotation > > annotations;
};

Expand Down
3 changes: 3 additions & 0 deletions mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit fbba11b

Please sign in to comment.