RGBA pixel.
More...
#include <pixel.hpp>
List of all members.
Public Types |
|
typedef unsigned char | component_type |
Public Attributes |
|
union { |
| unsigned int pixel |
| | Compressed representation.
|
| struct { |
| component_type red |
| | Red component.
|
| component_type green |
| | Green component.
|
| component_type blue |
| | Blue component.
|
| component_type alpha |
| | Translucy.
|
| } components |
| | Component by component representation.
|
| }; | |
Detailed Description
RGBA pixel.
Definition at line 78 of file pixel.hpp.
Constructor & Destructor Documentation
| claw::graphic::rgba_pixel::rgba_pixel |
( |
const rgb_pixel & |
that | ) |
|
| claw::graphic::rgba_pixel::rgba_pixel |
( |
component_type |
r, |
|
|
component_type |
g, |
|
|
component_type |
b, |
|
|
component_type |
a |
|
) |
| |
Constructor.
- Parameters:
-
| 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 213 of file pixel.cpp.
| claw::graphic::rgba_pixel::rgba_pixel |
( |
const std::string & |
c | ) |
|
|
explicit |
Constructor from a color name or code.
- Parameters:
-
Definition at line 226 of file pixel.cpp.
Member Function Documentation
| claw::graphic::rgba_pixel::component_type claw::graphic::rgba_pixel::luminosity |
( |
| ) |
const |
Get the luminosity of the pixel.
- Returns:
- The luminosity between 0 (dark) and 255 (light).
The luminosity is approximated with integers:
Definition at line 301 of file pixel.cpp.
| bool claw::graphic::rgba_pixel::operator!= |
( |
const rgba_pixel & |
that | ) |
const |
Tell if two pixels are different.
- Parameters:
-
Definition at line 285 of file pixel.cpp.
References pixel.
| bool claw::graphic::rgba_pixel::operator== |
( |
const rgba_pixel & |
that | ) |
const |
Tell if two pixels are equal.
- Parameters:
-
Definition at line 275 of file pixel.cpp.
References pixel.
The documentation for this struct was generated from the following files: