-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiltre.h
45 lines (33 loc) · 932 Bytes
/
filtre.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
#include <string>
#include <vector>
#include "image.h"
using namespace std;
#ifndef FILTRE_H_INCLUDED
#define FILTRE_H_INCLUDED
class Filtre {
private:
vector<vector<float>> _action;
int _rayon;
public:
Filtre(vector<vector<float>>, int); // constructeur
Image application(const Image& img) const; // application
};
// constantes pour les filtres
const vector<vector<float>> ACTIONG3 = {
{1.0/16, 1.0/8, 1.0/16},
{1.0/8, 1.0/4, 1.0/8},
{1.0/16, 1.0/8, 1.0/16}
};
const vector<vector<float>> ACTIONG5 = {
{1.0/256, 4.0/256, 6.0/256, 4.0/256, 1.0/256 },
{4.0/256, 16.0/256, 24.0/256, 16.0/256, 4.0/256 },
{6.0/256, 24.0/256, 36.0/256, 24.0/256, 6.0/256 },
{4.0/256, 16.0/256, 24.0/256, 16.0/256, 4.0/256 },
{1.0/256, 4.0/256, 6.0/256, 4.0/256, 1.0/256 }
};
const int RAYONG3 = 1;
const int RAYONG5 = 2;
// filtres
const Filtre flouG3(ACTIONG3, RAYONG3);
const Filtre flouG5(ACTIONG5, RAYONG5);
#endif