-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHistogram.h
More file actions
58 lines (44 loc) · 1.32 KB
/
Histogram.h
File metadata and controls
58 lines (44 loc) · 1.32 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef HISTOGRAM_H
#define HISTOGRAM_H
#include <cmath>
#include <iostream>
#include "utils/Array.h"
#include "Image.h"
using namespace std;
class Histogram {
private:
Array<int> histogram;
int numLevels;
int maxLevel;
int minLevel;
int maxFreq;
double contrast;
void print(std::ostream & outStream) const;
void calculateContrast();
public:
Histogram();
Histogram(const int & numLevelsValue);
Histogram(const Histogram & histogramObject);
Histogram(Image * image);
~Histogram();
void calculate(Image * imagen);
Histogram* calculatesCum();
bool isEmpty();
double average(const int & startIndex, const int & endIndex);
Image paintHistogram();
static Image equalize(Image * image);
int getLevels();
void setMaxLevel(const int & maxLevelValue);
int getMaxLevel();
void setMinLevel(const int & minLevelValue);
int getMinLevel();
int getMaxFreq();
double getContrast();
void setAt(const int & index, const int & value);
int getAt(const int & index);
int & operator[] (const int & index);
int operator[] (const int & index) const;
friend std::ostream & operator<<(std::ostream & outStream, const Histogram & histogramObject);
friend std::ostream & operator<<(std::ostream & outStream, const Histogram * histogramObject);
};
#endif // #ifndef HISTOGRAM_H