1 | // Aseprite |
2 | // Copyright (C) 2017 David Capello |
3 | // |
4 | // This program is distributed under the terms of |
5 | // the End-User License Agreement for Aseprite. |
6 | |
7 | #ifndef APP_UI_DITHERING_SELECTOR_H_INCLUDED |
8 | #define APP_UI_DITHERING_SELECTOR_H_INCLUDED |
9 | #pragma once |
10 | |
11 | #include "obs/connection.h" |
12 | #include "render/dithering_algorithm.h" |
13 | #include "render/ordered_dither.h" |
14 | #include "ui/box.h" |
15 | #include "ui/combobox.h" |
16 | |
17 | namespace app { |
18 | |
19 | class DitheringSelector : public ui::ComboBox { |
20 | public: |
21 | enum Type { |
22 | SelectBoth, |
23 | SelectMatrix, |
24 | }; |
25 | |
26 | DitheringSelector(Type type); |
27 | |
28 | render::DitheringAlgorithm ditheringAlgorithm(); |
29 | render::DitheringMatrix ditheringMatrix(); |
30 | |
31 | protected: |
32 | void onInitTheme(ui::InitThemeEvent& ev) override; |
33 | |
34 | private: |
35 | void regenerate(); |
36 | |
37 | Type m_type; |
38 | obs::scoped_connection m_extChanges; |
39 | }; |
40 | |
41 | } // namespace app |
42 | |
43 | #endif |
44 | |