Struct Rgb565Pixel#

Struct Documentation#

struct Rgb565Pixel#

A 16bit pixel that has 5 red bits, 6 green bits and 5 blue bits.

Public Functions

inline constexpr Rgb565Pixel()#

Default constructor.

inline explicit constexpr Rgb565Pixel(const Rgb8Pixel &pixel)#

Constructor that constructs from an Rgb8Pixel.

inline constexpr uint8_t red() const#

Get the red component as an 8-bit value.

The bits are shifted so that the result is between 0 and 255.

Returns:

The red component as an 8-bit value.

inline constexpr uint8_t green() const#

Get the green component as an 8-bit value.

The bits are shifted so that the result is between 0 and 255.

Returns:

The green component as an 8-bit value.

inline constexpr uint8_t blue() const#

Get the blue component as an 8-bit value.

The bits are shifted so that the result is between 0 and 255.

Returns:

The blue component as an 8-bit value.

inline constexpr operator Rgb8Pixel() const#

Convert to Rgb8Pixel.

Public Members

uint16_t b#

The blue component, encoded in 5 bits.

uint16_t g#

The green component, encoded in 6 bits.

uint16_t r#

The red component, encoded in 5 bits.

Friends

friend bool operator==(const Rgb565Pixel &lhs, const Rgb565Pixel &rhs) = default#

Returns true if lhs rhs are pixels with identical colors.