#include <pixel.hpp>
Definition at line 80 of file pixel.hpp.
Public Types | |
| typedef unsigned char | component_type |
Public Member Functions | |
| pixel32 () | |
| Default constructor. | |
| pixel32 (component_type r, component_type g, component_type b, component_type a) | |
| Constructor. | |
| pixel32 & | operator= (const pixel24 &that) |
| Assignement operator. | |
| bool | operator== (const pixel32 &that) const |
| Tell if two pixels are equal. | |
| bool | operator!= (const pixel32 &that) const |
| Tell if two pixels are different. | |
| component_type | luminosity () const |
| Get the luminosity of the pixel. | |
Public Attributes | |
| 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 |
| typedef unsigned char claw::graphic::pixel32::component_type |
| claw::graphic::pixel32::pixel32 | ( | ) | [inline] |
| claw::graphic::pixel32::pixel32 | ( | component_type | r, | |
| component_type | g, | |||
| component_type | b, | |||
| component_type | a | |||
| ) | [inline] |
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 115 of file pixel.hpp.
References components.
00117 { 00118 components.red = r; 00119 components.green = g; 00120 components.blue = b; 00121 components.alpha = a; 00122 } // pixel32()
Assignement operator.
| that | The other pixel. |
Definition at line 129 of file pixel.hpp.
References claw::graphic::pixel24::blue, claw::graphic::pixel24::components, components, claw::graphic::pixel24::green, and claw::graphic::pixel24::red.
00130 { 00131 components.red = that.components.red; 00132 components.green = that.components.green; 00133 components.blue = that.components.blue; 00134 components.alpha = 255; 00135 00136 return *this; 00137 } // operator=()
| bool claw::graphic::pixel32::operator== | ( | const pixel32 & | that | ) | const [inline] |
| bool claw::graphic::pixel32::operator!= | ( | const pixel32 & | that | ) | const [inline] |
| component_type claw::graphic::pixel32::luminosity | ( | ) | const [inline] |
Get the luminosity of the pixel.
Definition at line 166 of file pixel.hpp.
References components.
00167 { 00168 return ((unsigned int)components.red * 183 00169 + (unsigned int)components.green * 54 00170 + (unsigned int)components.blue * 18 00171 ) / 256; 00172 } // luminosity()
| unsigned int claw::graphic::pixel32::pixel |
Compressed representation.
Definition at line 85 of file pixel.hpp.
Referenced by operator!=(), and operator==().
Red component.
Definition at line 91 of file pixel.hpp.
Referenced by claw::graphic::targa::reader::file_input_buffer< Pixel >::get_pixel(), claw::graphic::jpeg::reader::grayscale_to_pixel32::operator()(), claw::graphic::jpeg::reader::RGB_to_pixel32::operator()(), and claw::graphic::targa::writer::file_output_buffer< Pixel >::order_pixel_bytes().
Green component.
Definition at line 94 of file pixel.hpp.
Referenced by claw::graphic::targa::reader::file_input_buffer< Pixel >::get_pixel(), claw::graphic::jpeg::reader::grayscale_to_pixel32::operator()(), claw::graphic::jpeg::reader::RGB_to_pixel32::operator()(), and claw::graphic::targa::writer::file_output_buffer< Pixel >::order_pixel_bytes().
Blue component.
Definition at line 97 of file pixel.hpp.
Referenced by claw::graphic::targa::reader::file_input_buffer< Pixel >::get_pixel(), claw::graphic::jpeg::reader::grayscale_to_pixel32::operator()(), claw::graphic::jpeg::reader::RGB_to_pixel32::operator()(), and claw::graphic::targa::writer::file_output_buffer< Pixel >::order_pixel_bytes().
Translucy.
Definition at line 100 of file pixel.hpp.
Referenced by claw::graphic::targa::reader::file_input_buffer< Pixel >::get_pixel(), claw::graphic::jpeg::reader::grayscale_to_pixel32::operator()(), claw::graphic::jpeg::reader::RGB_to_pixel32::operator()(), and claw::graphic::targa::writer::file_output_buffer< Pixel >::order_pixel_bytes().
| struct { ... } claw::graphic::pixel32::components |
Referenced by claw::graphic::targa::reader::file_input_buffer< Pixel >::get_pixel(), luminosity(), claw::graphic::jpeg::reader::grayscale_to_pixel32::operator()(), claw::graphic::jpeg::reader::RGB_to_pixel32::operator()(), operator=(), claw::graphic::targa::writer::file_output_buffer< Pixel >::order_pixel_bytes(), and pixel32().
1.5.5