-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMosaitPixel.h
38 lines (35 loc) · 917 Bytes
/
MosaitPixel.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
/**
* Mosait by Tangui Morlier
* Under GPLv3
*/
#ifndef MOSAIT_PIXEL
#define MOSAIT_PIXEL
#include "MosaitCommon.h"
#include <vector>
class MosaitPixel
{
public:
MosaitPixel(float r, float g, float b);
inline bool operator==(const MosaitPixel p) const {
// cerr << p.rgb_r << "==" << rgb_r << endl;
return ((p.rgb_r == rgb_r) && (p.rgb_g == rgb_g) && (p.rgb_b == rgb_b));
};
inline bool operator<(const MosaitPixel& p ) const {
cerr << "operator< on Img\n";
return p.rgb_r < rgb_r;
};
friend std::ostream& operator<<(std::ostream& os, MosaitPixel mp);
friend istream & operator >>(istream &ins, MosaitPixel & mp);
MosaitPixel();
float getDistanceWith(const MosaitPixel & pixel, bool withlight = 1) const;
void setAverage(vector<MosaitPixel> pixels);
private:
void fill_xyy();
float xyY_x;
float xyY_y;
float xyY_Y;
float rgb_r;
float rgb_g;
float rgb_b;
};
#endif