-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImage.h
121 lines (101 loc) · 3.53 KB
/
Image.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Image.h
* Author: Joy_Admin
*
* Created on 17 octobre 2016, 12:21
*/
#ifndef IMAGE_H
#define IMAGE_H
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
class Image
{
// construction de la matrix avex le vecteur recuppérer
protected:
void printMatrix(vector< vector<int> > I);
// les attributs pour chaque images
private:
int height;
int width;
string version;
int niveau;
int maxval;
int minval;
double luminance ;
int** array;
string fileName;
string output;
bool valide;
// les différentes méthodes de traitement
public:
Image();
Image(string file);
Image(bool val);
virtual ~Image();
// les getteurs et setteurs
int Getheight() { return height; }
void Setheight(int val) { height = val; }
int Getwidth() { return width; }
void Setwidth(int val) { width = val; }
string Getversion() { return version; }
void Setversion(string val) { version = val; }
int Getmaxval() { return maxval; }
void Setmaxval(int val) { maxval = val; }
string GetfileName() { return fileName; }
void SetfileName(string val) { fileName = val; }
string GetOutput() { return output; }
void SetOutput(string val) { output = val; }
int Getminval() { return minval; }
void Setminval(int val) { minval = val; }
int GetNiveau() { return niveau; }
void SetNiveau(int val) { niveau = val; }
int** GetArray() { return array; }
void setArray(int** arr) { array = arr; }
void SetLuminance(double val) { luminance = val; }
double GetLuminance() { return luminance; }
bool GetValide(){return valide;}
bool SetValide(bool val){valide = val;}
bool test(string name);
bool reload(string output);
bool writeImage(string output);
bool writeImage(int** arr);
bool writeImage(int** arr, int i,int j);
bool writeImage(int** arr, int i,int j,bool val);
//différentes opérations sur les images
double CalLuminance();
double CalLuminance(int** arr);
double CalContraste();
double CalContraste(int** arr);
bool transformationLineaire();
bool transformationLineaireSaturation(int sMin,int sMax);
bool egalisationHistogramme();
int* constructionHistogramme(int** arr);
double* normalistationHistogramme(int* histogramme);
double* densiteHistogramme(double* histogramme);
bool additionImage(Image &image);
int** additionImage(int** R,int** R1);
bool soustractionImage(Image &image);
bool multiplicationImage(double fac);
bool luminositeImage(double fac);
bool contrasteImage(double fac);
bool inversionImage();
bool renverseImage();
bool zoomImage(int zoom1,int zoom2);
bool convolutionFiltreMoyenneur(int dim);
bool convolutionFiltreGaussien(int dim);
bool convolutionFiltreMedian(int dim);
int mediane(int** K,int dim);
bool contourRoberts();
bool contourPrewitt();
bool contourSobel();
int** convolution(int** arr,double** K,int dim);
};
#endif // IMAGE_H