Developer documentation
Version 3.0.3-105-gd3941f44
screen_capture.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __gui_mrview_tool_screen_capture_h__
18#define __gui_mrview_tool_screen_capture_h__
19
20#include <deque>
21
24#include "gui/mrview/spin_box.h"
25
26
27namespace MR
28{
29 namespace GUI
30 {
31
32 namespace MRView
33 {
34 class AdjustButton;
35
36 namespace Tool
37 {
38
39
40 class Capture : public Base
42 Q_OBJECT
43 public:
44 Capture (Dock* parent);
45 virtual ~Capture() {}
46
47 static void add_commandline_options (MR::App::OptionList& options);
48 virtual bool process_commandline_option (const MR::App::ParsedOption& opt);
49
50 private slots:
51 void on_image_changed ();
52 void on_rotation_type (int);
53 void on_translation_type (int);
54 void on_screen_capture ();
55 void on_screen_preview ();
56 void on_screen_stop ();
57 void select_output_folder_slot();
58 void on_output_update ();
59 void on_restore_capture_state ();
60
61 private:
62 enum RotationType { World = 0, Eye, Image } rotation_type;
63 QComboBox *rotation_type_combobox;
64 AdjustButton *rotation_axis_x;
65 AdjustButton *rotation_axis_y;
66 AdjustButton *rotation_axis_z;
67 AdjustButton *degrees_button;
68
69 enum TranslationType { Voxel = 0, Scanner, Camera } translation_type;
70
71 QComboBox* translation_type_combobox;
72 AdjustButton *translate_x;
73 AdjustButton *translate_y;
74 AdjustButton *translate_z;
75
76 SpinBox *target_volume;
77 AdjustButton *FOV_multipler;
78 SpinBox *start_index;
79 SpinBox *frames;
80 SpinBox *volume_axis;
81 QLineEdit *prefix_textbox;
82 QPushButton *folder_button;
83 int axis;
84
85 bool is_playing;
86
87 class CaptureState { MEMALIGN(CaptureState)
88 public:
89 Eigen::Quaternionf orientation;
90 Eigen::Vector3f focus, target;
91 float fov;
92 size_t volume, volume_axis;
93 size_t frame_index;
94 int plane;
95 CaptureState(const Eigen::Quaternionf& orientation,
96 const Eigen::Vector3f& focus, const Eigen::Vector3f& target, float fov,
97 size_t volume, size_t volume_axis,
98 size_t frame_index, int plane)
99 : orientation(orientation), focus(focus), target(target), fov(fov),
100 volume(volume), volume_axis(volume_axis),
101 frame_index(frame_index), plane(plane) {}
102 };
103 constexpr static size_t max_cache_size = 1;
104 std::deque<CaptureState> cached_state;
105
106 void run (bool with_capture);
107 void cache_capture_state ();
108 };
109
110 }
111 }
112 }
113}
114
115#endif
116
117
118
119
120
a class to hold the list of option groups
Definition: app.h:139
object storing information about option parsed from command-line
Definition: app.h:286
Definition: base.h:24
#define MEMALIGN(...)
Definition: types.h:185