Skip to content

slint::platform::Rgb565Pixel Struct

struct Rgb565Pixel;
C++
#include <slint-platform.h>
C++

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

uint16_t slint::platform::Rgb565Pixel::b

The blue component, encoded in 5 bits.

uint16_t slint::platform::Rgb565Pixel::g

The green component, encoded in 6 bits.

uint16_t slint::platform::Rgb565Pixel::r

The red component, encoded in 5 bits.

constexpr constexpr slint::platform::Rgb565Pixel::Rgb565Pixel()

Default constructor.

explicit constexpr constexpr slint::platform::Rgb565Pixel::Rgb565Pixel(const Rgb8Pixel &pixel)

Constructor that constructs from an Rgb8Pixel.

constexpr constexpr uint8_t uint8_t slint::platform::Rgb565Pixel::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.

constexpr constexpr uint8_t uint8_t slint::platform::Rgb565Pixel::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.

constexpr constexpr uint8_t uint8_t slint::platform::Rgb565Pixel::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.

constexpr constexpr slint::platform::Rgb565Pixel::operator Rgb8Pixel() const

Convert to Rgb8Pixel.

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

Returns true if lhs rhs are pixels with identical colors.


© 2026 SixtyFPS GmbH