|
Pixel | abs (const Pixel &p) |
|
Pixel | sqrt (const Pixel &p) |
|
Pixel | operator+ (Pixel p1, const Pixel &p2) |
|
Pixel | operator- (Pixel p1, const Pixel &p2) |
|
Pixel | operator- (Pixel p) |
|
Pixel | operator* (Pixel p1, const Pixel &p2) |
|
Pixel | operator/ (Pixel p1, const Pixel &p2) |
|
bool | operator== (const Pixel &p, int val) |
|
bool | operator== (const Pixel &p1, const Pixel &p2) |
|
bool | operator!= (const Pixel &p1, const Pixel &p2) |
|
bool | operator> (const Pixel &p1, const Pixel &p2) |
|
bool | operator< (const Pixel &p1, const Pixel &p2) |
|
bool | operator>= (const Pixel &p1, const Pixel &p2) |
|
bool | operator<= (const Pixel &p1, const Pixel &p2) |
|
std::ostream & | operator<< (std::ostream &os, const Pixel &p) |
|
Representation of a pixel.
- Copyright
- Dahoux Sami 2018 All rights reserved.
- Date
- 19/12/2018
- Author
- samiBendou
Providing multiple color scale and conversion between theses.
The class provides an interface with char primitive
type by converting a char value onto a grey scale pixel and vice versa if needed.
A pixel can be in several states theses can be used for image processing computation :
- `format` : either Red, Green, Blue (RGB) or Grey Scale (GScale).
- `limited` : the value of each component can be limited to be between 0 and 255.
If the value of a component is set negative the result is 0. Else,
the if the value is greater than MAX_LIMIT_CMP than the set value
is the original value mod `MAX_LIMIT_CMP + 1`.
The pixel is stored in memory as a RGB value even if the format is not RGB. Getting and
setting components generally implies a constant time calculation to translate between RGB
and other formats.