OpenWareLaboratory
ScreenBuffer< Colour, BLACK, WHITE > Class Template Reference

Public Member Functions

void clear ()
 
void clear (int x, int y, int width, int height)
 
void drawChar (uint16_t x, uint16_t y, unsigned char ch, Colour c, Colour bg, uint8_t size)
 
void drawCircle (uint16_t x, uint16_t y, uint16_t r, Colour c)
 
void drawHorizontalLine (int x, int y, int length, Colour c)
 
void drawLine (int x0, int y0, int x1, int y1, Colour c)
 
void drawRectangle (int x, int y, int w, int h, Colour c)
 
void drawRotatedChar (uint16_t x, uint16_t y, unsigned char ch, Colour c, Colour bg, uint8_t size)
 
void drawVerticalLine (int x, int y, int length, Colour c)
 
void fade (uint16_t steps)
 
void fill (Colour c)
 
void fillCircle (uint16_t x, uint16_t y, uint16_t r, Colour c)
 
void fillRectangle (int x, int y, int w, int h, Colour c)
 
ColourgetBuffer ()
 
int getHeight ()
 
Colour getPixel (unsigned int x, unsigned int y)
 
int getWidth ()
 
void invert ()
 
void invert (int x, int y, int w, int h)
 
void invertPixel (unsigned int x, unsigned int y)
 
void print (const char *str)
 
void print (float num)
 
void print (int num)
 
void print (int x, int y, const char *text)
 
 ScreenBuffer (uint16_t w, uint16_t h)
 
void setBuffer (uint8_t *buffer)
 
void setCursor (uint16_t x, uint16_t y)
 
void setPixel (unsigned int x, unsigned int y, Colour c)
 
void setTextColour (Colour c)
 
void setTextColour (Colour c, Colour b)
 
void setTextSize (uint8_t s)
 
void setTextWrap (bool w)
 
void write (uint8_t c)
 

Detailed Description

template<typename Colour, Colour BLACK, Colour WHITE>
class ScreenBuffer< Colour, BLACK, WHITE >

Definition at line 11 of file ScreenBuffer.h.

Constructor & Destructor Documentation

◆ ScreenBuffer()

template<typename Colour , Colour BLACK, Colour WHITE>
ScreenBuffer< Colour, BLACK, WHITE >::ScreenBuffer ( uint16_t  w,
uint16_t  h 
)
inline

Definition at line 26 of file ScreenBuffer.h.

Member Function Documentation

◆ clear() [1/2]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::clear ( )
inline

Definition at line 47 of file ScreenBuffer.h.

References BLACK, and ScreenBuffer< Colour, BLACK, WHITE >::fill().

◆ clear() [2/2]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::clear ( int  x,
int  y,
int  width,
int  height 
)
inline

Definition at line 51 of file ScreenBuffer.h.

References BLACK, and ScreenBuffer< Colour, BLACK, WHITE >::fillRectangle().

◆ drawChar()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::drawChar ( uint16_t  x,
uint16_t  y,
unsigned char  ch,
Colour  c,
Colour  bg,
uint8_t  size 
)
inline

◆ drawCircle()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::drawCircle ( uint16_t  x,
uint16_t  y,
uint16_t  r,
Colour  c 
)
inline

Definition at line 193 of file ScreenBuffer.h.

References ScreenBuffer< Colour, BLACK, WHITE >::setPixel().

◆ drawHorizontalLine()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::drawHorizontalLine ( int  x,
int  y,
int  length,
Colour  c 
)
inline

◆ drawLine()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::drawLine ( int  x0,
int  y0,
int  x1,
int  y1,
Colour  c 
)
inline

Definition at line 109 of file ScreenBuffer.h.

References abs, and ScreenBuffer< Colour, BLACK, WHITE >::setPixel().

◆ drawRectangle()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::drawRectangle ( int  x,
int  y,
int  w,
int  h,
Colour  c 
)
inline

◆ drawRotatedChar()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::drawRotatedChar ( uint16_t  x,
uint16_t  y,
unsigned char  ch,
Colour  c,
Colour  bg,
uint8_t  size 
)
inline

◆ drawVerticalLine()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::drawVerticalLine ( int  x,
int  y,
int  length,
Colour  c 
)
inline

◆ fade()

void MonochromeScreenBuffer::fade ( uint16_t  steps)

Definition at line 54 of file ColourScreenPatch.cpp.

References BLUE, GREEN, and RED.

◆ fill()

void MonochromeScreenBuffer::fill ( Colour  c)

Definition at line 63 of file ColourScreenPatch.cpp.

Referenced by ScreenBuffer< Colour, BLACK, WHITE >::clear().

◆ fillCircle()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::fillCircle ( uint16_t  x,
uint16_t  y,
uint16_t  r,
Colour  c 
)
inline

◆ fillRectangle()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::fillRectangle ( int  x,
int  y,
int  w,
int  h,
Colour  c 
)
inline

◆ getBuffer()

template<typename Colour , Colour BLACK, Colour WHITE>
Colour* ScreenBuffer< Colour, BLACK, WHITE >::getBuffer ( )
inline

Definition at line 39 of file ScreenBuffer.h.

◆ getHeight()

template<typename Colour , Colour BLACK, Colour WHITE>
int ScreenBuffer< Colour, BLACK, WHITE >::getHeight ( )
inline

Definition at line 33 of file ScreenBuffer.h.

◆ getPixel()

Colour MonochromeScreenBuffer::getPixel ( unsigned int  x,
unsigned int  y 
)

Definition at line 35 of file ColourScreenPatch.cpp.

◆ getWidth()

template<typename Colour , Colour BLACK, Colour WHITE>
int ScreenBuffer< Colour, BLACK, WHITE >::getWidth ( )
inline

Definition at line 30 of file ScreenBuffer.h.

◆ invert() [1/2]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::invert ( )
inline

Definition at line 167 of file ScreenBuffer.h.

◆ invert() [2/2]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::invert ( int  x,
int  y,
int  w,
int  h 
)
inline

◆ invertPixel()

void MonochromeScreenBuffer::invertPixel ( unsigned int  x,
unsigned int  y 
)

Definition at line 48 of file ColourScreenPatch.cpp.

References WHITE.

Referenced by ScreenBuffer< Colour, BLACK, WHITE >::invert().

◆ print() [1/4]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::print ( const char *  str)
inline

◆ print() [2/4]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::print ( float  num)
inline

Definition at line 62 of file ScreenBuffer.h.

References msg_ftoa(), and ScreenBuffer< Colour, BLACK, WHITE >::print().

◆ print() [3/4]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::print ( int  num)
inline

Definition at line 66 of file ScreenBuffer.h.

References msg_itoa(), and ScreenBuffer< Colour, BLACK, WHITE >::print().

◆ print() [4/4]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::print ( int  x,
int  y,
const char *  text 
)
inline

◆ setBuffer()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::setBuffer ( uint8_t *  buffer)
inline

Definition at line 36 of file ScreenBuffer.h.

Referenced by onDrawCallback().

◆ setCursor()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::setCursor ( uint16_t  x,
uint16_t  y 
)
inline

Definition at line 143 of file ScreenBuffer.h.

Referenced by ScreenBuffer< Colour, BLACK, WHITE >::print().

◆ setPixel()

◆ setTextColour() [1/2]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::setTextColour ( Colour  c)
inline

Definition at line 152 of file ScreenBuffer.h.

◆ setTextColour() [2/2]

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::setTextColour ( Colour  c,
Colour  b 
)
inline

Definition at line 158 of file ScreenBuffer.h.

◆ setTextSize()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::setTextSize ( uint8_t  s)
inline

Definition at line 148 of file ScreenBuffer.h.

◆ setTextWrap()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::setTextWrap ( bool  w)
inline

Definition at line 163 of file ScreenBuffer.h.

◆ write()

template<typename Colour , Colour BLACK, Colour WHITE>
void ScreenBuffer< Colour, BLACK, WHITE >::write ( uint8_t  c)
inline

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