COSA
An Object-Oriented Platform for Arduino Programming
Canvas::color16_t Union Reference

#include <Canvas.hh>

Collaboration diagram for Canvas::color16_t:
Collaboration graph

Public Member Functions

 color16_t ()
 
 color16_t (uint16_t color)
 
 color16_t (uint8_t r, uint8_t g, uint8_t b)
 
 operator uint16_t ()
 

Public Attributes

uint16_t rgb
 
struct {
   unsigned int   blue:5
 
   unsigned int   green:6
 
   unsigned int   red:5
 
}; 
 

Detailed Description

16-bit RGB<5,6,5> color.

Definition at line 49 of file Canvas.hh.

Constructor & Destructor Documentation

Canvas::color16_t::color16_t ( )
inline

Construct default color.

Definition at line 60 of file Canvas.hh.

Canvas::color16_t::color16_t ( uint16_t  color)
inline

Construct color from given 16-bit value.

Parameters
[in]color.

Definition at line 69 of file Canvas.hh.

Canvas::color16_t::color16_t ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)
inline

Construct color from given 8-bit values. Scaled from 8-bit to 5-bits for blue and red, and 6-bits for green.

Parameters
[in]r.
[in]g.
[in]b.

Definition at line 81 of file Canvas.hh.

Member Function Documentation

Canvas::color16_t::operator uint16_t ( )
inline

Cast color to 16-bit unsigned integer.

Definition at line 91 of file Canvas.hh.

Member Data Documentation

struct { ... }
unsigned int Canvas::color16_t::blue

Definition at line 52 of file Canvas.hh.

unsigned int Canvas::color16_t::green

Definition at line 53 of file Canvas.hh.

unsigned int Canvas::color16_t::red

Definition at line 54 of file Canvas.hh.

uint16_t Canvas::color16_t::rgb

Definition at line 50 of file Canvas.hh.


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