Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgSettingsColorFilter.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef DLG_SETTINGS_COLOR_FILTER_H
8#define DLG_SETTINGS_COLOR_FILTER_H
9
10#include "ColorFilterMode.h"
12#include <QColor>
13#include <QImage>
14#include <QPixmap>
15
16class ButtonWhatsThis;
17class DlgFilterThread;
19class QComboBox;
20class QGraphicsScene;
21class QGridLayout;
22class QLabel;
23class QRadioButton;
24class ViewPreview;
25class ViewProfile;
28
31{
32 Q_OBJECT;
33
34public:
38
39 virtual void createOptionalSaveDefault (QHBoxLayout *layout);
40 virtual QWidget *createSubPanel ();
41 virtual void load (CmdMediator &cmdMediator);
42 virtual void setSmallDialogs (bool smallDialogs);
43
44public slots:
46 void slotTransferPiece (int xLeft,
47 QImage image);
48
49signals:
51 void signalApplyFilter (ColorFilterMode colorFilterMode,
52 double low,
53 double high);
54
55private slots:
56 void slotCurveName(const QString &curveName);
57 void slotDividerHigh (double);
58 void slotDividerLow (double);
59 void slotForeground();
60 void slotHue();
61 void slotIntensity();
62 void slotSaturation();
63 void slotValue();
64 void slotWhatsThis();
65
66protected:
67 virtual void handleOk ();
68
69private:
70
71 void createControls (QGridLayout *layout, int &row);
72 void createPreview (QGridLayout *layout, int &row);
73 void createProfileAndScale (QGridLayout *layout, int &row);
74 QRgb createThread (); // Returns background color
75 void loadForCurveName();
76 static int PROFILE_HEIGHT_IN_ROWS () { return 6; }
77 static int PROFILE_SCENE_WIDTH () { return 100; }
78 static int PROFILE_SCENE_HEIGHT () { return 100; }
79 void updateHistogram();
80 void updatePreview();
81
82 ButtonWhatsThis *m_btnWhatsThis;
83
84 QComboBox *m_cmbCurveName;
85
86 QRadioButton *m_btnIntensity;
87 QRadioButton *m_btnForeground;
88 QRadioButton *m_btnHue;
89 QRadioButton *m_btnSaturation;
90 QRadioButton *m_btnValue;
91
92 QGraphicsScene *m_sceneProfile;
93 ViewProfile *m_viewProfile;
94 ViewProfileScale *m_scale;
95
96 QGraphicsScene *m_scenePreview;
97 ViewPreview *m_viewPreview;
98 ViewProfileDivider *m_dividerLow;
99 ViewProfileDivider *m_dividerHigh;
100
101 // Apply filter parameters to preview image in a separate thread so dragging the dividers in the profile
102 // will not be slowed down by the filter parameter processing
103 DlgFilterThread *m_filterThread;
104
105 QImage m_imagePreview;
106
107 DocumentModelColorFilter *m_modelColorFilterBefore;
108 DocumentModelColorFilter *m_modelColorFilterAfter;
109};
110
111#endif // DLG_SETTINGS_COLOR_FILTER_H
ColorFilterMode
Unobtrusive button to trigger QWhatsThis since some operating systems (Linux Mint) do not show WhatsT...
Command queue stack.
Definition CmdMediator.h:24
Class for processing new filter settings. This is based on http://blog.debao.me/2013/08/how-to-use-qt...
DlgSettingsAbstractBase(const QString &title, const QString &dialogName, MainWindow &mainWindow)
Single constructor.
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
MainWindow & mainWindow()
Get method for MainWindow.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
DlgSettingsColorFilter(MainWindow &mainWindow)
Single constructor.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
void slotTransferPiece(int xLeft, QImage image)
Receive processed piece of preview image, to be inserted at xLeft to xLeft+pixmap....
virtual void handleOk()
Process slotOk.
void signalApplyFilter(ColorFilterMode colorFilterMode, double low, double high)
Send filter parameters to DlgFilterThread and DlgFilterWorker for processing.
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:95
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window,...
Definition ViewPreview.h:15
Divider that can be dragged, in a dialog QGraphicsView.
Linear horizontal scale, with the spectrum reflecting the active filter parameter.
Class that modifies QGraphicsView to present a two-dimensional profile, with movable dividers for sel...
Definition ViewProfile.h:16