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

RGB color stored in 18-bit RGB666 format. More...

#include <RGB666.h>

Public Member Functions

 RGB666 ()=default
 Creates a black RGB666 color.
 
 RGB666 (uint8_t r, uint8_t g, uint8_t b)
 Creates a color from 8-bit red, green, and blue components.
 
void setValue (uint8_t r, uint8_t g, uint8_t b)
 Sets the color from 8-bit red, green, and blue components.
 
uint8_t getRed () const
 Returns the red component (expanded to 8 bits).
 
uint8_t getGreen () const
 Returns the green component (expanded to 8 bits).
 
uint8_t getBlue () const
 Returns the blue component (expanded to 8 bits).
 
const uint8_t * getValue () const
 Returns the packed RGB666 value as a pointer to 3 bytes (upper 6 bits used).
 

Static Public Member Functions

static uint8_t size ()
 Returns size in bits.
 

Protected Attributes

uint8_t value [3] = {0, 0, 0}
 

Detailed Description

RGB color stored in 18-bit RGB666 format.

The class provides conversion between 8-bit per channel RGB values and the packed 18-bit representation (3 bytes, 6 bits per channel, upper bits used) commonly used in displays.

Constructor & Destructor Documentation

◆ RGB666() [1/2]

RGB666 ( )
default

Creates a black RGB666 color.

◆ RGB666() [2/2]

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

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

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()

const uint8_t * getValue ( ) const
inline

Returns the packed RGB666 value as a pointer to 3 bytes (upper 6 bits used).

◆ setValue()

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

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

◆ size()

static uint8_t size ( )
inlinestatic

Returns size in bits.

Member Data Documentation

◆ value

uint8_t value[3] = {0, 0, 0}
protected

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