Skip to content

Commit

Permalink
Bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Sep 16, 2024
1 parent 78c8b1e commit a36aebd
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 21 deletions.
3 changes: 3 additions & 0 deletions src/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ v1.2.8
Compare Mode.
- A/B Wipe Comparison now properly follows the cursor when zoomed in.
- Fixed and simplified bakeOCIO.py demo script.
- Fixed changing displayOptions through python not reflecting the changes in
the UI.
- Fixed compareDemo.py script to reflect new A/B Comparison changes.


v1.2.7
Expand Down
3 changes: 2 additions & 1 deletion src/lib/mrvApp/mrvMainControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,13 @@ namespace mrv
Viewport* view = p.ui->uiView;
view->setLUTOptions(p.lutOptions);
view->setDisplayOptions({p.displayOptions});
view->updateDisplayOptions();
if (p.ui->uiSecondary)
{
view = p.ui->uiSecondary->viewport();
view->setLUTOptions(p.lutOptions);
view->setDisplayOptions({p.displayOptions});
view->updateDisplayOptions();
}

auto display = p.ui->uiTimeline->getDisplayOptions();
Expand Down Expand Up @@ -261,7 +263,6 @@ namespace mrv
{
TLRENDER_P();


App* app = p.ui->app;
p.volume = app->volume();
p.mute = app->isMuted();
Expand Down
53 changes: 44 additions & 9 deletions src/lib/mrvGL/mrvTimelineViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ namespace mrv
if (value == p.lutOptions)
return;
p.lutOptions = value;

auto display = p.ui->uiTimeline->getDisplayOptions();
display.lut = value;
p.ui->uiTimeline->setDisplayOptions(display);
Expand All @@ -830,6 +830,44 @@ namespace mrv
if (value == p.displayOptions)
return;
p.displayOptions = value;

const auto& d = p.displayOptions[0];

float gamma, saturation, gain;
if (d.levels.enabled)
{
gamma = d.levels.gamma;
}
else
{
gamma = 1.0;
}
if (d.color.enabled)
{
gain = d.color.brightness.x;
saturation = d.color.saturation.x;

if (d.exrDisplay.exposure > 0.001F)
{
gain /= d.exrDisplay.exposure;
}
}
else
{
gain = 1.0;
saturation = 1.0;
}

//
// Update UI sliders
//
p.ui->uiGain->value(gain);
p.ui->uiGainInput->value(gain);
p.ui->uiGamma->value(gamma);
p.ui->uiGammaInput->value(gamma);
p.ui->uiSaturation->value(saturation);
p.ui->uiSaturationInput->value(saturation);

redraw();
}

Expand Down Expand Up @@ -2062,7 +2100,6 @@ namespace mrv
{
TLRENDER_P();


p.displayOptions.resize(p.videoData.size());
if (p.displayOptions.empty())
{
Expand Down Expand Up @@ -2358,7 +2395,7 @@ namespace mrv
const timeline::DisplayOptions& d) noexcept
{
TLRENDER_P();

for (auto& display : p.displayOptions)
{
display = d;
Expand Down Expand Up @@ -2405,23 +2442,21 @@ namespace mrv
}

void TimelineViewport::_updateMonitorDisplayView(
const int screen,
const timeline::OCIOOptions& o) const noexcept
const int screen, const timeline::OCIOOptions& o) const noexcept
{
TLRENDER_P();

if (this != p.ui->uiView)
return;

if (screen != p.previous_screen)
{
p.previous_screen = screen;
const std::string& combined =
ocio::combineView(o.display, o.view);
const std::string& combined = ocio::combineView(o.display, o.view);
p.ui->uiOCIOView->copy_label(combined.c_str());
}
}

void TimelineViewport::hsv_to_info(
const image::Color4f& hsv, area::Info& info) const noexcept
{
Expand Down
21 changes: 10 additions & 11 deletions src/lib/mrvPy/Cmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ namespace mrv2
void
compare(const int itemA, const int itemB, timeline::CompareMode mode)
{

auto model = filesModel();

auto o = model->observeCompareOptions()->get();
Expand Down Expand Up @@ -224,7 +223,7 @@ namespace mrv2
ViewerUI* ui = App::ui;
toggle_data_window_cb(nullptr, ui);
}

void toggleDisplayWindow()
{
ViewerUI* ui = App::ui;
Expand All @@ -236,13 +235,13 @@ namespace mrv2
ViewerUI* ui = App::ui;
toggle_safe_areas_cb(nullptr, ui);
}

void toggleIgnoreDisplayWindow()
{
ViewerUI* ui = App::ui;
toggle_ignore_display_window_cb(nullptr, ui);
}

void toggleAutoNormalize()
{
ViewerUI* ui = App::ui;
Expand Down Expand Up @@ -357,7 +356,7 @@ namespace mrv2
}
return out;
}

/**
* \brief Refresh the UI.
*
Expand Down Expand Up @@ -531,31 +530,31 @@ Used to run main commands and get arguments and set the display, image, compare,
cmds.def(
"setMute", &mrv2::cmd::setMute, _("Set the muting of the audio."),
py::arg("mute"));

cmds.def(
"toggleAutoNormalize", &mrv2::cmd::toggleAutoNormalize,
_("Toggle Image Auto Normalize."));

cmds.def(
"toggleDataWindow", &mrv2::cmd::toggleDataWindow,
_("Toggle Data Window."));

cmds.def(
"toggleDisplayWindow", &mrv2::cmd::toggleDisplayWindow,
_("Toggle Display Window."));

cmds.def(
"toggleIgnoreDisplayWindow", &mrv2::cmd::toggleIgnoreDisplayWindow,
_("Toggle Ignored Display Window on OpenEXRs."));

cmds.def(
"toggleInvalidValues", &mrv2::cmd::toggleInvalidValues,
_("Toggle Image invalid values."));

cmds.def(
"toggleSafeAreas", &mrv2::cmd::toggleSafeAreas,
_("Toggle Safe Areas."));

cmds.def("volume", &mrv2::cmd::volume, _("Get the playback volume."));

cmds.def(
Expand Down

0 comments on commit a36aebd

Please sign in to comment.