-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathHDRViewer.h
80 lines (64 loc) · 2.24 KB
/
HDRViewer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// Copyright (C) Wojciech Jarosz <wjarosz@gmail.com>. All rights reserved.
// Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE.txt file.
//
#pragma once
#include <nanogui/nanogui.h>
#include <vector>
#include <iostream>
#include <spdlog/spdlog.h>
#include "Fwd.h"
#include "CommandHistory.h"
using namespace nanogui;
using namespace Eigen;
class HDRViewScreen : public Screen
{
public:
HDRViewScreen(float exposure, float gamma, bool sRGB, bool dither, std::vector<std::string> args);
~HDRViewScreen() override;
// overridden virtual functions from Screen
void drawContents() override;
bool dropEvent(const std::vector<std::string> &filenames) override;
bool mouseButtonEvent(const Eigen::Vector2i &p, int button, bool down, int modifiers) override;
bool mouseMotionEvent(const Eigen::Vector2i& p, const Eigen::Vector2i& rel, int button, int modifiers) override;
bool keyboardEvent(int key, int scancode, int action, int modifiers) override;
bool loadImage();
void saveImage();
void askCloseImage(int index);
void askCloseAllImages();
void flipImage(bool h);
void clearFocusPath() {mFocusPath.clear();}
int modifiers() const {return mModifiers;}
void updateCaption();
private:
void toggleHelpWindow();
void updateLayout();
bool atSidePanelEdge(const Eigen::Vector2i& p)
{
return p.x() - m_sidePanel->fixedWidth() < 10 && p.x() - m_sidePanel->fixedWidth() > -5;
}
Window * m_topPanel = nullptr;
Window * m_sidePanel = nullptr;
Window * m_statusBar = nullptr;
HDRImageViewer * m_imageView = nullptr;
ImageListPanel * m_imagesPanel = nullptr;
Button * m_helpButton = nullptr;
Button * m_sidePanelButton = nullptr;
HelpWindow* m_helpWindow = nullptr;
Label * m_zoomLabel = nullptr;
Label * m_pixelInfoLabel = nullptr;
VScrollPanel * m_sideScrollPanel = nullptr;
Widget * m_sidePanelContents = nullptr;
double m_guiAnimationStart;
bool m_guiTimerRunning = false;
enum EAnimationGoal : int
{
TOP_PANEL = 1 << 0,
SIDE_PANEL = 1 << 1,
BOTTOM_PANEL = 1 << 2,
} m_animationGoal = EAnimationGoal(TOP_PANEL|SIDE_PANEL|BOTTOM_PANEL);
MessageDialog * m_okToQuitDialog = nullptr;
bool m_draggingSidePanel = false;
std::shared_ptr<spdlog::logger> console;
};