Pervasive Displays Library Suite - Reference Manual 9.0.3
Library for Pervasive Displays e-paper screens, extension boards and development kits
Loading...
Searching...
No Matches
hV_Colours565 Class Reference

for 5-6-5 coded colours = 64K colours More...

#include <hV_Colours565.h>

Public Member Functions

 hV_Colours565 ()
 Constructor.
 
Colours utilities
Note
Advanced edition only
uint16_t calculate (uint8_t red, uint8_t green, uint8_t blue)
 Calculate 16-bit colour from 8-bit Red-Green-Blue components.
 
void split (uint16_t rgb, uint8_t &red, uint8_t &green, uint8_t &blue)
 Calculate 8-bit Red-Green-Blue components from 16-bit colour.
 
uint16_t halve (uint16_t rgb)
 Half 16-bit colour.
 
uint16_t average (uint16_t rgb1, uint16_t rgb2)
 Average two 16-bit colours.
 
uint16_t weightedAverage (uint16_t rgb1, uint8_t weight1, uint16_t rgb2, uint8_t weight2)
 Weighted-average two 16-bit colours.
 
uint16_t reverse (uint16_t rgb)
 Reverse 16-bit colour.
 
uint16_t code (uint8_t value09)
 Return 16-bit colour from international colour code.
 

Static Public Attributes

Colours constants
Note
Both syntaxes are valid
static const uint16_t black = 0b0000000000000000
 black
 
static const uint16_t white = 0b1111111111111111
 white
 
static const uint16_t red = 0b1111100000000000
 red
 
static const uint16_t green = 0b0000011111100000
 green
 
static const uint16_t blue = 0b0000000000011111
 blue
 
static const uint16_t yellow = 0b1111111111100000
 yellow
 
static const uint16_t cyan = 0b0000011111111111
 cyan
 
static const uint16_t orange = 0b1111101111100000
 orange
 
static const uint16_t magenta = 0b1111100000001111
 magenta
 
static const uint16_t violet = 0b1111100000011111
 violet
 
static const uint16_t grey = 0b0111101111101111
 grey
 
static const uint16_t darkGrey = 0b0011100111100111
 dark grey
 
static const uint16_t brown = 0b0111100000000000
 brown
 
static const uint16_t gray = 0b0111101111101111
 American-English variants.
 
static const uint16_t darkGray = 0b0011100111100111
 American-English variant for dark grey.
 
static const uint16_t darkRed = 0b0011100000000000
 dark red for BWR and BWRY colour screens
 
static const uint16_t lightRed = 0b1111100011100011
 light red for BWR and BWRY colour screens
 
static const uint16_t darkYellow = 0b0011100011100000
 dark yellow for BWRY colour screens
 
static const uint16_t lightYellow = 0b1111111111100011
 light yellow for BWRY colour screens
 

Detailed Description

for 5-6-5 coded colours = 64K colours

red: 5 bits, green: 6 bits, blue: 5 bits

Member Function Documentation

◆ average()

uint16_t hV_Colours565::average ( uint16_t rgb1,
uint16_t rgb2 )

Average two 16-bit colours.

Parameters
rgb1first 16-bit colour
rgb2second 16-bit colour
Returns
averaged 16-bit colour
Note
Advanced edition only


More: Colours

◆ calculate()

uint16_t hV_Colours565::calculate ( uint8_t red,
uint8_t green,
uint8_t blue )

Calculate 16-bit colour from 8-bit Red-Green-Blue components.

Parameters
redred component, 0x00..0xff
greengreen component, 0x00..0xff
blueblue component, 0x00..0xff
Returns
16-bit colour
Note
Advanced edition only


More: Colours

◆ code()

uint16_t hV_Colours565::code ( uint8_t value09)

Return 16-bit colour from international colour code.

Parameters
value090..9 for normal colours, 10..19 for dark colours
Returns
rgb 16-bit colour
See also
IEC 60062:2016 Marking codes for resistors and capacitors
Note
Advanced edition only


More: Colours

◆ halve()

uint16_t hV_Colours565::halve ( uint16_t rgb)

Half 16-bit colour.

Parameters
rgb16-bit colour
Returns
halved 16-bit colour
Note
Advanced edition only


More: Colours

◆ reverse()

uint16_t hV_Colours565::reverse ( uint16_t rgb)

Reverse 16-bit colour.

Parameters
rgb16-bit colour
Returns
reversed 16-bit colour
Note
Advanced edition only


More: Colours

◆ split()

void hV_Colours565::split ( uint16_t rgb,
uint8_t & red,
uint8_t & green,
uint8_t & blue )

Calculate 8-bit Red-Green-Blue components from 16-bit colour.

Parameters
rgb16-bit colour
redred component, 0x00..0xff
greengreen component, 0x00..0xff
blueblue component, 0x00..0xff
Note
Advanced edition only


More: Colours

◆ weightedAverage()

uint16_t hV_Colours565::weightedAverage ( uint16_t rgb1,
uint8_t weight1,
uint16_t rgb2,
uint8_t weight2 )

Weighted-average two 16-bit colours.

Parameters
rgb1first 16-bit colour
weight1weight of the first colour
rgb2second 16-bit colour
weight2weight of the second colour
Returns
averaged 16-bit colour
Note
Advanced edition only


More: Colours

Member Data Documentation

◆ gray

const uint16_t hV_Colours565::gray = 0b0111101111101111
static

American-English variants.

American-English variant for grey


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