TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
BGR565 Class Reference

BGR color stored in 16-bit BGR565 format. More...

#include <BGR565.h>

Public Member Functions

 BGR565 ()=default
 Creates a black BGR565 color.
 
 BGR565 (uint8_t b, uint8_t g, uint8_t r)
 Creates a color from 8-bit blue, green, and red components.
 
 BGR565 (uint16_t packed)
 Creates a color from a packed BGR565 value.
 
void setValue (uint8_t b, uint8_t g, uint8_t r)
 Sets the color from 8-bit blue, green, and red components.
 
void setValue (uint16_t packed)
 Sets the color from a packed BGR565 value.
 
uint8_t getBlue () const
 Returns the blue component expanded to 8 bits.
 
uint8_t getGreen () const
 Returns the green component expanded to 8 bits.
 
uint8_t getRed () const
 Returns the red component expanded to 8 bits.
 
uint16_t getValue () const
 Returns the packed BGR565 value.
 

Static Public Member Functions

static uint8_t size ()
 Returns size in bits.
 

Protected Attributes

uint16_t value = 0
 

Detailed Description

BGR color stored in 16-bit BGR565 format.

The class provides conversion between 8-bit per channel BGR values and the packed 16-bit representation (BGR565) commonly used by embedded displays.

Constructor & Destructor Documentation

◆ BGR565() [1/3]

BGR565 ( )
default

Creates a black BGR565 color.

◆ BGR565() [2/3]

BGR565 ( uint8_t  b,
uint8_t  g,
uint8_t  r 
)
inline

Creates a color from 8-bit blue, green, and red components.

◆ BGR565() [3/3]

BGR565 ( uint16_t  packed)
inlineexplicit

Creates a color from a packed BGR565 value.

Member Function Documentation

◆ getBlue()

uint8_t getBlue ( ) const
inline

Returns the blue component expanded to 8 bits.

◆ getGreen()

uint8_t getGreen ( ) const
inline

Returns the green component expanded to 8 bits.

◆ getRed()

uint8_t getRed ( ) const
inline

Returns the red component expanded to 8 bits.

◆ getValue()

uint16_t getValue ( ) const
inline

Returns the packed BGR565 value.

◆ setValue() [1/2]

void setValue ( uint16_t  packed)
inline

Sets the color from a packed BGR565 value.

◆ setValue() [2/2]

void setValue ( uint8_t  b,
uint8_t  g,
uint8_t  r 
)
inline

Sets the color from 8-bit blue, green, and red components.

◆ size()

static uint8_t size ( )
inlinestatic

Returns size in bits.

Member Data Documentation

◆ value

uint16_t value = 0
protected

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