Loading...
Searching...
No Matches
L4Re::Video::Pixel_info Class Reference
L4Re C++ Interface » Video API

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 94 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

  bpp | Size of pixel in bytes.
  r | Red component size.
  rs | Red component shift.
  g | Green component size.
  gs | Green component shift.
  b | Blue component size.
  bs | Blue component shift.
  a | Alpha component size, defaults to 0.
  as | Alpha component shift, defaults to 0.

Definition at line 212 of file colors.

References a(), b(), g(), and r().

Here is the call graph for this function:

## Pixel_info() [2/2]

template<typename VBI>

L4Re::Video::Pixel_info::Pixel_info | ( | VBI const * | vbi | ) |

inlineexplicit

Convenience constructor.

Parameters

  vbi | Suitable information structure. Convenience constructor to create the pixel info from a VESA Framebuffer Info.

Definition at line 224 of file colors.

References bits_per_pixel().

Here is the call graph for this function:

## 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 123 of file colors.

Referenced by dump(), and Pixel_info().

Here is the caller graph for this function:

## a() [2/2]

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

inline

Set the alpha color component of the pixel.

Parameters

  c | Alpha color component.

Definition at line 187 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 117 of file colors.

Referenced by dump(), and Pixel_info().

Here is the caller graph for this function:

## b() [2/2]

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

inline

Set the blue color component of the pixel.

Parameters

  c | Blue color component.

Definition at line 181 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 156 of file colors.

Referenced by Pixel_info().

Here is the caller 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 150 of file colors.

Referenced by dump().

Here is the caller graph for this function:

## 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

  bpp | Size of pixel in bytes.

Definition at line 193 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

  s | Stream

Definition at line 246 of file colors.

References a(), b(), bytes_per_pixel(), g(), and r().

Here is the call 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 111 of file colors.

Referenced by dump(), and Pixel_info().

Here is the caller graph for this function:

## g() [2/2]

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

inline

Set the green color component of the pixel.

Parameters

  c | Green color component.

Definition at line 175 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 163 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

  o | A Pixel_info to compare to.

Returns
  true if the both Pixel_info's are equal, false if not.

Definition at line 236 of file colors.

References Pixel_info().

Here is the call graph for this function:

## 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 131 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 105 of file colors.

Referenced by dump(), and Pixel_info().

Here is the caller graph for this function:

## r() [2/2]

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

inline

Set the red color component of the pixel.

Parameters

  c | Red color component.

Definition at line 169 of file colors.

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

- l4/re/video/colors