forked from githubdoe/DFTFringe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
colorchannel.cpp
54 lines (49 loc) · 1.46 KB
/
colorchannel.cpp
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
#include "colorchannel.h"
#include <qsettings.h>
colorChannel *colorChannel::m_Instance = 0;
colorChannel *colorChannel::get_instance(){
if (m_Instance == NULL){
m_Instance = new colorChannel();
}
return m_Instance;
}
colorChannel::colorChannel(QObject *parent) : QObject(parent), useAuto(true), useRed(false),
useGreen(false), useBlue(false), m_showOriginalColorImage(false)
{
QSettings set;
useAuto = set.value("colorChannelUseAuto", true).toBool();
useRed = set.value("colorChannelUseRed",false).toBool();
useGreen = set.value("colorChannelUseGreen", false).toBool();
useBlue = set.value("colorChannelUseBlue", false).toBool();
m_showOriginalColorImage = set.value("colorChannelShowColor", false).toBool();
}
void colorChannel::clearAll(){
useAuto = false;
useRed = false;
useGreen = false;
useBlue = false;
}
void colorChannel::setAuto(bool flag){
clearAll();
useAuto = flag;
emit useChannelsChanged();
}
void colorChannel::setRed(bool flag){
clearAll();
useRed = flag;
emit useChannelsChanged();
}
void colorChannel::setGreen(bool flag){
clearAll();
useGreen = flag;
emit useChannelsChanged();
}
void colorChannel::setBlue(bool flag){
clearAll();
useBlue = flag;
emit useChannelsChanged();
}
void colorChannel::showOriginalColorImage(bool flag){
m_showOriginalColorImage = flag;
emit useChannelsChanged();
}