L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4Re::Video::Pixel_info Class Reference

Pixel information. More...

#include <colors>

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

Public Member Functions

Color_component const & r () const
 Return the red color compoment of the pixel.
 
Color_component const & g () const
 Return the green color compoment of the pixel.
 
Color_component const & b () const
 Return the blue color compoment of the pixel.
 
Color_component const & a () const
 Return the alpha color compoment of the pixel.
 
Color_component const padding () const
 Compute the padding pseudo component.
 
unsigned char bytes_per_pixel () const
 Query size of pixel in bytes.
 
unsigned char bits_per_pixel () const
 Number of bits of the pixel.
 
bool has_alpha () const
 Return whether the pixel has an alpha channel.
 
void r (Color_component const &c)
 Set the red color component of the pixel.
 
void g (Color_component const &c)
 Set the green color component of the pixel.
 
void b (Color_component const &c)
 Set the blue color component of the pixel.
 
void a (Color_component const &c)
 Set the alpha color component of the pixel.
 
void bytes_per_pixel (unsigned char bpp)
 Set the size of the pixel in bytes.
 
 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.
 
template<typename VBI >
 Pixel_info (VBI const *vbi)
 Convenience constructor.
 
bool operator== (Pixel_info const &o) const
 Compare for complete equality of the color space.
 
template<typename OUT >
void dump (OUT &s) const
 Dump information on the pixel to a stream.
 

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 105 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 223 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 235 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 134 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 198 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 128 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 192 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 167 of file colors.

References L4Re::Video::Color_component::size().

+ Here is the call graph for this function:

◆ 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 161 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 204 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

Definition at line 257 of file colors.

Referenced by L4Re::Video::View::Info::dump().

+ Here is the caller graph for this function:

◆ 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 122 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 186 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 174 of file colors.

References L4Re::Video::Color_component::size().

+ Here is the call graph for this function:

◆ 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 247 of file colors.

◆ padding()

Color_component const L4Re::Video::Pixel_info::padding ( ) const
inline

Compute the padding pseudo component.

The padding pseudo component represents the tailing bits that are reserved in RGB32 and similar pixel formats.

Returns
Padding pseudo component.

Definition at line 142 of file colors.

References L4Re::Video::Color_component::shift(), and L4Re::Video::Color_component::size().

+ Here is the call graph for this function:

◆ 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 116 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 180 of file colors.


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