forked from my3rs/ImageQt
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhistogram.h
executable file
·41 lines (35 loc) · 1.14 KB
/
histogram.h
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
#ifndef HISTOGRAM_H
#define HISTOGRAM_H
#include <QWidget>
#include <QLabel>
#include <QPainter>
#include <QDebug>
class Histogram : public QLabel
{
public:
Histogram(QWidget* parent = 0);
Histogram(QWidget*, Histogram*);
void computeHstgrm(QImage img);
void paintEvent(QPaintEvent *e);
void drawBwHstgrm(int xBase, int yBase, int height);
void drawRedHstgrm(int xBase, int yBase, int height);
void drawGreenHstgrm(int xBase, int yBase, int height);
void drawBlueHstgrm(int xBase, int yBase, int height);
int getBwHstgrm(int index);
int getRedHstgrm(int index);
int getGreenHstgrm(int index);
int getBlueHstgrm(int index);
private:
// index 0 to 255 => count of image's pixels for this value
// index 256 => maximum value
// index 257 => total value of the dark component
// index 258 => total value of the light component
int bwHstgrm[259];
// index 0 to 255 => count of image's pixels for this value
// index 256 => maximum value
// index 257 => total value of the component
int redHstgrm[258];
int greenHstgrm[258];
int blueHstgrm[258];
};
#endif // HISTOGRAM_H