libepaper 2.0.0
A C++23 library for controlling Waveshare e-paper displays on Raspberry Pi, featuring transparent sleep/wake management and a fluent builder API.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
epaper::RGBA Struct Reference

#include <color.hpp>

Public Member Functions

constexpr RGBA ()
 Default constructor initializes to transparent black.
 
constexpr RGBA (std::uint8_t red, std::uint8_t green, std::uint8_t blue, std::uint8_t alpha=255)
 Construct RGBA color from components.
 
constexpr RGBA (const RGB &rgb)
 Construct RGBA from RGB (fully opaque).
 
constexpr auto operator== (const RGBA &other) const noexcept -> bool=default
 Equality comparison.
 
constexpr auto to_rgb () const noexcept -> RGB
 Convert to RGB (discards alpha channel).
 
constexpr auto to_grayscale () const noexcept -> std::uint8_t
 Convert to grayscale using standard luminance formula.
 

Public Attributes

std::uint8_t a
 Alpha component (0-255, 0=transparent, 255=opaque)
 
std::uint8_t b
 Blue component (0-255)
 
std::uint8_t g
 Green component (0-255)
 
std::uint8_t r
 Red component (0-255)
 

Constructor & Destructor Documentation

◆ RGBA() [1/3]

constexpr epaper::RGBA::RGBA ( )
inlineconstexpr

Default constructor initializes to transparent black.

Examples
/mnt/nas/libepaper/include/epaper/color/color.hpp.

◆ RGBA() [2/3]

constexpr epaper::RGBA::RGBA ( std::uint8_t  red,
std::uint8_t  green,
std::uint8_t  blue,
std::uint8_t  alpha = 255 
)
inlineconstexpr

Construct RGBA color from components.

Parameters
redRed component (0-255)
greenGreen component (0-255)
blueBlue component (0-255)
alphaAlpha component (0-255, default 255=opaque)

◆ RGBA() [3/3]

constexpr epaper::RGBA::RGBA ( const RGB rgb)
inlineexplicitconstexpr

Construct RGBA from RGB (fully opaque).

Parameters
rgbRGB color

Member Function Documentation

◆ operator==()

constexpr auto epaper::RGBA::operator== ( const RGBA other) const -> bool=default
constexprdefaultnoexcept

◆ to_grayscale()

constexpr auto epaper::RGBA::to_grayscale ( ) const -> std::uint8_t
inlineconstexprnoexcept

Convert to grayscale using standard luminance formula.

Returns
Grayscale value (0-255)
Examples
/mnt/nas/libepaper/include/epaper/color/color.hpp.

◆ to_rgb()

constexpr auto epaper::RGBA::to_rgb ( ) const -> RGB
inlineconstexprnoexcept

Convert to RGB (discards alpha channel).

Returns
RGB color
Examples
/mnt/nas/libepaper/include/epaper/color/color.hpp.

Member Data Documentation

◆ a

std::uint8_t epaper::RGBA::a

Alpha component (0-255, 0=transparent, 255=opaque)

Examples
/mnt/nas/libepaper/include/epaper/color/color.hpp.

◆ b

std::uint8_t epaper::RGBA::b

Blue component (0-255)

Examples
/mnt/nas/libepaper/include/epaper/color/color.hpp.

◆ g

std::uint8_t epaper::RGBA::g

Green component (0-255)

Examples
/mnt/nas/libepaper/include/epaper/color/color.hpp.

◆ r

std::uint8_t epaper::RGBA::r

Red component (0-255)

Examples
/mnt/nas/libepaper/include/epaper/color/color.hpp.

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