Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
wkjarosz committed Feb 4, 2024
1 parent d3a1962 commit b480142
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CPM_DOWNLOAD_VERSION 0.35.1)
set(CPM_DOWNLOAD_VERSION 0.38.6)

if(CPM_SOURCE_CACHE)
# Expand relative path. This is important if the provided path contains a tilde (~)
Expand Down
2 changes: 1 addition & 1 deletion src/brush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
//

#include "brush.h"

#include "color.h"
#include "common.h"
#include "parallelfor.h"
#include <nanogui/vector.h>

using namespace nanogui;
Expand Down
10 changes: 7 additions & 3 deletions src/commandpalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
// Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE.txt file.
//
//
// The part of the Command::draw function that performs the substring highlighting logic is adapted from ImGui
// Command Palette, it's license follows.
// Outside sources:
// [1]
// The part of the Command::draw function that performs the substring highlighting logic is adapted from
// [ImGui Command Palette](https://github.com/hnOsmium0001/imgui-command-palette), it's license follows.
//
// The MIT License (MIT)
//
Expand Down Expand Up @@ -207,6 +208,9 @@ void Command::draw(NVGcontext *ctx)
draw_shadowed_text(false, m_caption.c_str());
else
{
//
// CITATION: The logic below is adapted from the ImGui Command Palette. See [1] above.
//
auto text = m_caption.c_str();
int range_begin;
int range_end;
Expand Down
1 change: 1 addition & 0 deletions src/filters/zap_gremlins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "hdrimage.h"
#include "hdrviewscreen.h"
#include "imagelistpanel.h"
#include "parallelfor.h"
#include "xpuimage.h"
#include <spdlog/fmt/ostr.h>
#include <spdlog/spdlog.h>
Expand Down
5 changes: 2 additions & 3 deletions src/hdrimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
#define STB_IMAGE_RESIZE_IMPLEMENTATION
#include "stb_image_resize.h" // for stbir_resize_float

#include "parallelfor.h"

using namespace std;
using Imath::M33f;
using Imath::V2f;
using Imath::V3f;

// local functions
namespace
Expand Down
2 changes: 0 additions & 2 deletions src/hdrimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#include "array2d.h"
#include "box.h"
#include "color.h" // for Color4, max, min
#include "parallelfor.h"
#include "progress.h"
#include <ImathMatrix.h>
#include <functional> // for function
#include <nanogui/vector.h>
#include <set> // for set
Expand Down
10 changes: 1 addition & 9 deletions src/hdrimageio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,9 @@ bool HDRImage::load(const string &filename)
Imath::M44f chr_M; // the conversion matrix to rec709 RGB; defaults to identity
if (hasChromaticities(file.header()))
{
// equality comparison for Imf::Chromaticities
auto chr_eq = [](const Imf::Chromaticities &a, const Imf::Chromaticities &b)
{
return (a.red - b.red).length2() + (a.green - b.green).length2() + (a.blue - b.blue).length2() +
(a.white - b.white).length2() <
1e-8f;
};

Imf::Chromaticities rec709_chr; // default rec709 (sRGB) primaries
Imf::Chromaticities file_chr = Imf::chromaticities(file.header());
if (!chr_eq(file_chr, rec709_chr))
if (file_chr != rec709_chr)
{
chr_M = Imf::RGBtoXYZ(file_chr, 1) * Imf::XYZtoRGB(rec709_chr, 1);
spdlog::info("Converting pixel values to Rec709/sRGB primaries and whitepoint.");
Expand Down
4 changes: 2 additions & 2 deletions src/hdrviewscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,9 @@ void HDRViewScreen::create_menubar()
{{GLFW_MOD_ALT, 'H'}});
add_item({"Flip vertically", "Mirror vertically"}, FA_ARROWS_ALT_V, flip_callback(false, m_images_panel),
{{GLFW_MOD_ALT, 'V'}});
add_item({"Rotate 90° clockwise", "Turn clockwise"}, FA_REDO, rotate_callback(true, m_images_panel),
add_item({"Rotate 90° clockwise", "Rotate right", "Turn clockwise"}, FA_REDO, rotate_callback(true, m_images_panel),
{{SYSTEM_COMMAND_MOD, ']'}});
add_item({"Rotate 90° counter clockwise", "Turn counter clockwise"}, FA_UNDO,
add_item({"Rotate 90° counter clockwise", "Rotate left", "Turn counter clockwise"}, FA_UNDO,
rotate_callback(false, m_images_panel), {{SYSTEM_COMMAND_MOD, '['}});
menu->popup()->add<Separator>();
add_item({"Crop to selection"}, FA_CROP, crop_callback(m_images_panel), {{GLFW_MOD_ALT, 'C'}});
Expand Down
1 change: 1 addition & 0 deletions src/tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "hscrollpanel.h"
#include "imagelistpanel.h"
#include "menu.h"
#include "parallelfor.h"
#include "rasterdraw.h"
#include "well.h"
#include <hdrview_resources.h>
Expand Down

0 comments on commit b480142

Please sign in to comment.