|
Claw 1.7.3
|
RGBA pixel. More...
#include <pixel.hpp>
Public Types | |
| typedef unsigned char | component_type |
| The type of the components of the color. | |
Public Member Functions | |
| rgba_pixel () | |
| Default constructor. | |
| rgba_pixel (const rgb_pixel &that) | |
| Constructor. | |
| rgba_pixel (component_type r, component_type g, component_type b, component_type a) | |
| Constructor. | |
| rgba_pixel (const std::string &c) | |
| Constructor from a color name or code. | |
| rgba_pixel & | operator= (const rgb_pixel &that) |
| Assignement operator. | |
| bool | operator== (const rgba_pixel &that) const |
| Tell if two pixels are equal. | |
| bool | operator!= (const rgba_pixel &that) const |
| Tell if two pixels are different. | |
| component_type | luminosity () const |
| Get the luminosity of the pixel. | |
Public Attributes | |
| union { | |
| unsigned int pixel | |
| Compressed representation. More... | |
| struct { | |
| component_type red | |
| Red component. More... | |
| component_type green | |
| Green component. More... | |
| component_type blue | |
| Blue component. More... | |
| component_type alpha | |
| Translucy. More... | |
| } components | |
| Component by component representation. | |
| }; | |
| typedef unsigned char claw::graphic::rgba_pixel::component_type |
| claw::graphic::rgba_pixel::rgba_pixel | ( | ) |
Default constructor.
Definition at line 190 of file pixel.cpp.
Referenced by operator!=(), and operator==().
| claw::graphic::rgba_pixel::rgba_pixel | ( | const rgb_pixel & | that | ) |
Constructor.
| that | The other pixel. |
Definition at line 201 of file pixel.cpp.
References claw::graphic::rgb_pixel::blue, claw::graphic::rgb_pixel::components, components, claw::graphic::rgb_pixel::green, and claw::graphic::rgb_pixel::red.
| claw::graphic::rgba_pixel::rgba_pixel | ( | component_type | r, |
| component_type | g, | ||
| component_type | b, | ||
| component_type | a ) |
Constructor.
| r | The value of the red field. |
| g | The value of the green field. |
| b | The value of the blue field. |
| a | The value of the alpha field. |
Definition at line 217 of file pixel.cpp.
References components.
|
explicit |
Constructor from a color name or code.
| c | The color name or code. |
Definition at line 231 of file pixel.cpp.
References components.
| claw::graphic::rgba_pixel::component_type claw::graphic::rgba_pixel::luminosity | ( | ) | const |
Get the luminosity of the pixel.
The luminosity is approximated with integers: 


Definition at line 306 of file pixel.cpp.
References components.
| bool claw::graphic::rgba_pixel::operator!= | ( | const rgba_pixel & | that | ) | const |
Tell if two pixels are different.
| that | The other pixel. |
Definition at line 290 of file pixel.cpp.
References pixel, and rgba_pixel().
| claw::graphic::rgba_pixel & claw::graphic::rgba_pixel::operator= | ( | const rgb_pixel & | that | ) |
Assignement operator.
| that | The other pixel. |
Definition at line 265 of file pixel.cpp.
References claw::graphic::rgb_pixel::blue, claw::graphic::rgb_pixel::components, components, claw::graphic::rgb_pixel::green, and claw::graphic::rgb_pixel::red.
| bool claw::graphic::rgba_pixel::operator== | ( | const rgba_pixel & | that | ) | const |
Tell if two pixels are equal.
| that | The other pixel. |
Definition at line 280 of file pixel.cpp.
References pixel, and rgba_pixel().
| component_type claw::graphic::rgba_pixel::alpha |
| component_type claw::graphic::rgba_pixel::blue |
Blue component.
Definition at line 99 of file pixel.hpp.
Referenced by claw::graphic::image::fill(), and claw::graphic::rgb_pixel::rgb_pixel().
| component_type claw::graphic::rgba_pixel::green |
Green component.
Definition at line 96 of file pixel.hpp.
Referenced by claw::graphic::image::fill(), and claw::graphic::rgb_pixel::rgb_pixel().
| unsigned int claw::graphic::rgba_pixel::pixel |
Compressed representation.
Definition at line 87 of file pixel.hpp.
Referenced by operator!=(), and operator==().
| component_type claw::graphic::rgba_pixel::red |
Red component.
Definition at line 93 of file pixel.hpp.
Referenced by claw::graphic::image::fill(), and claw::graphic::rgb_pixel::rgb_pixel().