This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
DisplayInterface Class Referenceabstract

An interface for displays. More...

#include <DisplayInterface.hpp>

Inheritance diagram for DisplayInterface:
Collaboration diagram for DisplayInterface:

Public Member Functions

virtual ~DisplayInterface ()
 
virtual void begin ()
 Initialize the display. More...
 
virtual void clear ()=0
 Clear the frame buffer or display. More...
 
virtual void drawBackground ()
 Draw a custom background. More...
 
virtual void display ()=0
 Write the frame buffer to the display. More...
 
virtual void drawPixel (int16_t x, int16_t y, uint16_t color)=0
 Paint a single pixel with the given color. More...
 
virtual void setTextColor (uint16_t color)=0
 Set the text color. More...
 
virtual void setTextSize (uint8_t size)=0
 Set the text size. More...
 
virtual void setCursor (int16_t x, int16_t y)=0
 Set the cursor position. More...
 
size_t write (uint8_t c) override=0
 Write a character to the display. More...
 
virtual void drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)=0
 Draw a line between two points. More...
 
virtual void drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color)=0
 Draw a vertical line. More...
 
virtual void drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color)=0
 Draw a horizontal line. More...
 
virtual void drawXBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)=0
 Draw a bitmap to the display. More...
 
virtual void fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 Draw a filled rectangle. More...
 
virtual void drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color)
 Draw a circle. More...
 
virtual void fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color)
 Draw a disk (filled circle). More...
 
void clearAndDrawBackground ()
 Clear the frame buffer, and draw the custom background. More...
 

Static Public Member Functions

static void beginAll ()
 Initialize all displays. More...
 

Protected Member Functions

 DisplayInterface ()
 

Protected Attributes

DisplayInterfacenext
 
DisplayInterfaceprevious
 

Static Private Attributes

static DoublyLinkedList< DisplayInterfaceelements
 

Detailed Description

An interface for displays.

Inspired by the Adafruit GFX library for easy compatibility.

Definition at line 14 of file DisplayInterface.hpp.

Constructor & Destructor Documentation

◆ DisplayInterface()

DisplayInterface::DisplayInterface ( )
inlineprotected
Todo:
Do I need to keep a list now that I have sorted all DisplayElements?

Definition at line 18 of file DisplayInterface.hpp.

◆ ~DisplayInterface()

virtual DisplayInterface::~DisplayInterface ( )
inlinevirtual
Todo:
Do I need to keep a list now that I have sorted all DisplayElements?

Definition at line 25 of file DisplayInterface.hpp.

Member Function Documentation

◆ begin()

void DisplayInterface::begin ( )
virtual

Initialize the display.

Examples
2.VU-Meter-OLED-USB-DAC.ino, MCU-OLED-SSD1306-x2.ino, MCU-OLED-SSD1306.ino, and VU-Meter-Bridge.ino.

Definition at line 7 of file DisplayInterface.cpp.

◆ clear()

virtual void DisplayInterface::clear ( )
pure virtual

Clear the frame buffer or display.

Implemented in SSD1306_DisplayInterface.

◆ drawBackground()

virtual void DisplayInterface::drawBackground ( )
inlinevirtual

Draw a custom background.

Reimplemented in SSD1306_DisplayInterface.

Definition at line 33 of file DisplayInterface.hpp.

◆ display()

virtual void DisplayInterface::display ( )
pure virtual

Write the frame buffer to the display.

Implemented in SSD1306_DisplayInterface.

◆ drawPixel()

virtual void DisplayInterface::drawPixel ( int16_t  x,
int16_t  y,
uint16_t  color 
)
pure virtual

Paint a single pixel with the given color.

Implemented in SSD1306_DisplayInterface.

◆ setTextColor()

virtual void DisplayInterface::setTextColor ( uint16_t  color)
pure virtual

Set the text color.

Implemented in SSD1306_DisplayInterface.

◆ setTextSize()

virtual void DisplayInterface::setTextSize ( uint8_t  size)
pure virtual

Set the text size.

Implemented in SSD1306_DisplayInterface.

◆ setCursor()

virtual void DisplayInterface::setCursor ( int16_t  x,
int16_t  y 
)
pure virtual

Set the cursor position.

Implemented in SSD1306_DisplayInterface.

◆ write()

size_t DisplayInterface::write ( uint8_t  c)
overridepure virtual

Write a character to the display.

See also
setCursor
setTextSize
setTextColor

Implemented in SSD1306_DisplayInterface.

◆ drawLine()

virtual void DisplayInterface::drawLine ( int16_t  x0,
int16_t  y0,
int16_t  x1,
int16_t  y1,
uint16_t  color 
)
pure virtual

Draw a line between two points.

Implemented in SSD1306_DisplayInterface.

◆ drawFastVLine()

virtual void DisplayInterface::drawFastVLine ( int16_t  x,
int16_t  y,
int16_t  h,
uint16_t  color 
)
pure virtual

Draw a vertical line.

Implemented in SSD1306_DisplayInterface.

◆ drawFastHLine()

virtual void DisplayInterface::drawFastHLine ( int16_t  x,
int16_t  y,
int16_t  w,
uint16_t  color 
)
pure virtual

Draw a horizontal line.

Implemented in SSD1306_DisplayInterface.

◆ drawXBitmap()

virtual void DisplayInterface::drawXBitmap ( int16_t  x,
int16_t  y,
const uint8_t  bitmap[],
int16_t  w,
int16_t  h,
uint16_t  color 
)
pure virtual

Draw a bitmap to the display.

Implemented in SSD1306_DisplayInterface.

◆ fillRect()

void DisplayInterface::fillRect ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
uint16_t  color 
)
virtual

Draw a filled rectangle.

Definition at line 13 of file DisplayInterface.cpp.

◆ drawCircle()

void DisplayInterface::drawCircle ( int16_t  x0,
int16_t  y0,
int16_t  r,
uint16_t  color 
)
virtual

Draw a circle.

Definition at line 19 of file DisplayInterface.cpp.

◆ fillCircle()

void DisplayInterface::fillCircle ( int16_t  x0,
int16_t  y0,
int16_t  r,
uint16_t  color 
)
virtual

Draw a disk (filled circle).

Definition at line 42 of file DisplayInterface.cpp.

◆ beginAll()

void DisplayInterface::beginAll ( )
static

Initialize all displays.

See also
begin

Definition at line 61 of file DisplayInterface.cpp.

◆ clearAndDrawBackground()

void DisplayInterface::clearAndDrawBackground ( )
inline

Clear the frame buffer, and draw the custom background.

See also
clear
drawBackground

Definition at line 89 of file DisplayInterface.hpp.

Member Data Documentation

◆ elements

DoublyLinkedList< DisplayInterface > DisplayInterface::elements
staticprivate

Definition at line 95 of file DisplayInterface.hpp.

◆ next

DisplayInterface * DoublyLinkable< DisplayInterface >::next
protectedinherited

Definition at line 301 of file LinkedList.hpp.

◆ previous

DisplayInterface * DoublyLinkable< DisplayInterface >::previous
protectedinherited

Definition at line 302 of file LinkedList.hpp.


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