-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhistogrammtab.cpp
More file actions
38 lines (32 loc) · 1.16 KB
/
histogrammtab.cpp
File metadata and controls
38 lines (32 loc) · 1.16 KB
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
#include "histogrammtab.h"
#include "histogramm.h"
#include "fleximage.h"
#include "controller.h"
#include <iostream>
HistogrammTab::HistogrammTab() : QWidget(){
histLayout->addWidget(blackHist.get());
histLayout->addWidget(rHist.get());
histLayout->addWidget(gHist.get());
histLayout->addWidget(bHist.get());
layout->addLayout(histLayout.get());
cumulHistLayout->addWidget(blackHistCumul.get());
cumulHistLayout->addWidget(rHistCumul.get());
cumulHistLayout->addWidget(gHistCumul.get());
cumulHistLayout->addWidget(bHistCumul.get());
layout->addLayout(cumulHistLayout.get());
}
void HistogrammTab::updateHistogramms(){
FlexImage* pic = Controller::instance()->getLastImage();
std::array<int,256> gray = pic->getGrayScale();
std::array<int,256> red = pic->getRedScale();
std::array<int,256> green = pic->getGreenScale();
std::array<int,256> blue = pic->getBlueScale();
blackHist->resetWith(gray);
rHist->resetWith(red);
gHist->resetWith(green);
bHist->resetWith(blue);
blackHistCumul->resetWith(gray);
rHistCumul->resetWith(red);
gHistCumul->resetWith(green);
bHistCumul->resetWith(blue);
}