L4Re - L4 Runtime Environment
L4Re::Video::Pixel_info Class Reference

Pixel information. More...

+ Collaboration diagram for L4Re::Video::Pixel_info:

Public Member Functions

Color_component const & r () const
 Return the red color compoment of the pixel. More...
 
Color_component const & g () const
 Return the green color compoment of the pixel. More...
 
Color_component const & b () const
 Return the blue color compoment of the pixel. More...
 
Color_component const & a () const
 Return the alpha color compoment of the pixel. More...
 
unsigned char bytes_per_pixel () const
 Query size of pixel in bytes. More...
 
unsigned char bits_per_pixel () const
 Number of bits of the pixel. More...
 
bool has_alpha () const
 Return whether the pixel has an alpha channel. More...
 
void r (Color_component const &c)
 Set the red color component of the pixel. More...
 
void g (Color_component const &c)
 Set the green color component of the pixel. More...
 
void b (Color_component const &c)
 Set the blue color component of the pixel. More...
 
void a (Color_component const &c)
 Set the alpha color component of the pixel. More...
 
void bytes_per_pixel (unsigned char bpp)
 Set the size of the pixel in bytes. More...
 
 Pixel_info ()
 Constructor.
 
 Pixel_info (unsigned char bpp, char r, char rs, char g, char gs, char b, char bs, char a=0, char as=0)
 Constructor. More...
 
template<typename VBI >
 Pixel_info (VBI const *vbi)
 Convenience constructor. More...
 
bool operator== (Pixel_info const &o) const
 Compare for complete equality of the color space. More...
 
template<typename OUT >
void dump (OUT &s) const
 Dump information on the pixel to a stream. More...
 

Detailed Description

Pixel information.

This class wraps the information on a pixel, such as the size and position of each color component in the pixel.

Definition at line 106 of file colors.

Constructor & Destructor Documentation

◆ Pixel_info() [1/2]

L4Re::Video::Pixel_info::Pixel_info ( unsigned char  bpp,
char  r,
char  rs,
char  g,
char  gs,
char  b,
char  bs,
char  a = 0,
char  as = 0 
)
inline

Constructor.

Parameters
bppSize of pixel in bytes.
rRed component size.
rsRed component shift.
gGreen component size.
gsGreen component shift.
bBlue component size.
bsBlue component shift.
aAlpha component size, defaults to 0.
asAlpha component shift, defaults to 0.

Definition at line 203 of file colors.

◆ Pixel_info() [2/2]

template<typename VBI >
L4Re::Video::Pixel_info::Pixel_info ( VBI const *  vbi)
inlineexplicit

Convenience constructor.

Parameters
vbiSuitable information structure. Convenience constructor to create the pixel info from a VESA Framebuffer Info.

Definition at line 215 of file colors.

Member Function Documentation

◆ a() [1/2]

Color_component const& L4Re::Video::Pixel_info::a ( ) const
inline

Return the alpha color compoment of the pixel.

Returns
Alpha color component.

Definition at line 135 of file colors.

◆ a() [2/2]

void L4Re::Video::Pixel_info::a ( Color_component const &  c)
inline

Set the alpha color component of the pixel.

Parameters
cAlpha color component.

Definition at line 178 of file colors.

◆ b() [1/2]

Color_component const& L4Re::Video::Pixel_info::b ( ) const
inline

Return the blue color compoment of the pixel.

Returns
Blue color component.

Definition at line 129 of file colors.

◆ b() [2/2]

void L4Re::Video::Pixel_info::b ( Color_component const &  c)
inline

Set the blue color component of the pixel.

Parameters
cBlue color component.

Definition at line 172 of file colors.

◆ bits_per_pixel()

unsigned char L4Re::Video::Pixel_info::bits_per_pixel ( ) const
inline

Number of bits of the pixel.

Returns
Number of bits used by the pixel.

Definition at line 147 of file colors.

◆ bytes_per_pixel() [1/2]

unsigned char L4Re::Video::Pixel_info::bytes_per_pixel ( ) const
inline

Query size of pixel in bytes.

Returns
Size of pixel in bytes.

Definition at line 141 of file colors.

◆ bytes_per_pixel() [2/2]

void L4Re::Video::Pixel_info::bytes_per_pixel ( unsigned char  bpp)
inline

Set the size of the pixel in bytes.

Parameters
bppSize of pixel in bytes.

Definition at line 184 of file colors.

◆ dump()

template<typename OUT >
void L4Re::Video::Pixel_info::dump ( OUT &  s) const
inline

Dump information on the pixel to a stream.

Parameters
sStream
Returns
The stream

Definition at line 238 of file colors.

◆ g() [1/2]

Color_component const& L4Re::Video::Pixel_info::g ( ) const
inline

Return the green color compoment of the pixel.

Returns
Green color component.

Definition at line 123 of file colors.

◆ g() [2/2]

void L4Re::Video::Pixel_info::g ( Color_component const &  c)
inline

Set the green color component of the pixel.

Parameters
cGreen color component.

Definition at line 166 of file colors.

◆ has_alpha()

bool L4Re::Video::Pixel_info::has_alpha ( ) const
inline

Return whether the pixel has an alpha channel.

Returns
True if the pixel has an alpha channel, false if not.

Definition at line 154 of file colors.

◆ operator==()

bool L4Re::Video::Pixel_info::operator== ( Pixel_info const &  o) const
inline

Compare for complete equality of the color space.

Parameters
oA Pixel_info to compare to.
Returns
true if the both Pixel_info's are equal, false if not.

Definition at line 227 of file colors.

◆ r() [1/2]

Color_component const& L4Re::Video::Pixel_info::r ( ) const
inline

Return the red color compoment of the pixel.

Returns
Red color component.

Definition at line 117 of file colors.

◆ r() [2/2]

void L4Re::Video::Pixel_info::r ( Color_component const &  c)
inline

Set the red color component of the pixel.

Parameters
cRed color component.

Definition at line 160 of file colors.


The documentation for this class was generated from the following file: