Pervasive Displays Library Suite - Basic edition 8.0.8
Library for Pervasive Displays e-paper screens and EXT3 extension board
Loading...
Searching...
No Matches
hV_Screen_Buffer Class Referenceabstract

Generic buffered screen class. More...

#include <hV_Screen_Buffer.h>

Inheritance diagram for hV_Screen_Buffer:
Collaboration diagram for hV_Screen_Buffer:

Public Member Functions

 hV_Screen_Buffer ()
 Constructor.
 
General
virtual void begin ()
 Initialisation.
 
virtual String WhoAmI ()=0
 Request information about the screen.
 
virtual void clear (uint16_t colour=myColours.black)
 Clear the screen.
 
virtual void flush ()=0
 Send frame-buffer to display.
 
virtual void setOrientation (uint8_t orientation)
 Set orientation.
 
uint8_t getOrientation ()
 Get orientation.
 
virtual uint16_t screenSizeX ()
 Screen size, x-axis of logical screen.
 
virtual uint16_t screenSizeY ()
 Screen size, y-axis of logical screen.
 
virtual uint16_t screenDiagonal ()
 Screen size, diagonal.
 
virtual uint8_t screenColourBits ()
 Screen colour depth.
 
Graphics
virtual void circle (uint16_t x0, uint16_t y0, uint16_t radius, uint16_t colour)
 Draw circle.
 
virtual void line (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t colour)
 Draw line, rectangle coordinates.
 
virtual void dLine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, uint16_t colour)
 Draw line, vector coordinates.
 
virtual void setPenSolid (bool flag=true)
 Set pen opaque.
 
virtual void triangle (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, uint16_t colour)
 Draw triangle, rectangle coordinates.
 
virtual void rectangle (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t colour)
 Draw rectangle, rectangle coordinates.
 
virtual void dRectangle (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, uint16_t colour)
 Draw rectangle, vector coordinates.
 
virtual void point (uint16_t x1, uint16_t y1, uint16_t colour)
 Draw pixel.
 
Text
virtual void selectFont (uint8_t font)
 Select font number.
 
virtual uint8_t getFont ()
 Get font number.
 
virtual uint8_t addFont (font_s fontName)
 Add a font.
 
virtual void setFontSolid (bool flag=true)
 Set transparent or opaque text.
 
virtual void setFontSpaceX (uint8_t number=1)
 Set additional spaces between two characters, horizontal axis.
 
virtual void setFontSpaceY (uint8_t number=1)
 Set additional spaces between two characters, vertical axis.
 
virtual uint16_t characterSizeX (uint8_t character=0x00)
 Character size, x-axis.
 
virtual uint16_t characterSizeY ()
 Character size, y-axis.
 
virtual uint16_t stringSizeX (String text)
 String size, x-axis.
 
virtual uint8_t stringLengthToFitX (String text, uint16_t pixels)
 Number of characters to fit a size, x-axis.
 
virtual uint8_t fontMax ()
 Number of fonts.
 
virtual void gText (uint16_t x0, uint16_t y0, String text, uint16_t textColour=myColours.black, uint16_t backColour=myColours.white)
 Draw ASCII Text (pixel coordinates) with selection of size.
 
virtual void gTextLarge (uint16_t x0, uint16_t y0, String text, uint16_t textColour=myColours.black, uint16_t backColour=myColours.white)
 Draw ASCII Text (pixel coordinates) with selection of size.
 
Touch
Note
Those functions are optional, and thus defined as empty and not compulsory.
bool isTouch ()
 Is touch available?
 
bool isTouchEvent ()
 Are touch events available?
 
bool getTouch (uint16_t &x, uint16_t &y, uint16_t &z, uint16_t &t)
 Poll touch.
 
void clearTouch ()
 Clear touch.
 
bool getTouchInterrupt ()
 Check touch interrupt.
 
void calibrateTouch ()
 Calibrate the touch.
 

Detailed Description

Generic buffered screen class.

This class provides the text and graphic primitives for the buffered screen

Member Function Documentation

◆ addFont()

uint8_t hV_Screen_Buffer::addFont ( font_s fontName)
virtual

Add a font.

Parameters
fontNamename of the font
Returns
number of the font, 0 otherwise
Note
Previously selectFont()
More: Fonts

◆ begin()

void hV_Screen_Buffer::begin ( )
virtual

Initialisation.

Reimplemented in Screen_EPD_EXT3_Fast.

◆ characterSizeX()

uint16_t hV_Screen_Buffer::characterSizeX ( uint8_t character = 0x00)
virtual

Character size, x-axis.

Parameters
charactercharacter to evaluate, default = 0 = font general size
Returns
horizontal size of the font for the specified character, in pixels
Note
With setSpaceX included
In variable font, each character has a specific size. The general size is indicative.
Previously fontSizeX()
More: Fonts

◆ characterSizeY()

uint16_t hV_Screen_Buffer::characterSizeY ( )
virtual

Character size, y-axis.

Returns
vertical size for current font, in pixels
Note
Previously fontSizeY()
More: Fonts

◆ circle()

void hV_Screen_Buffer::circle ( uint16_t x0,
uint16_t y0,
uint16_t radius,
uint16_t colour )
virtual

Draw circle.

Parameters
x0center, point coordinate, x-axis
y0center, point coordinate, y-axis
radiusradius
colour16-bit colour


More: Coordinate, Colour

◆ clear()

void hV_Screen_Buffer::clear ( uint16_t colour = myColours.black)
virtual

Clear the screen.

Parameters
colour16-bit colour, default = white

Reimplemented in Screen_EPD_EXT3_Fast.

◆ dLine()

void hV_Screen_Buffer::dLine ( uint16_t x0,
uint16_t y0,
uint16_t dx,
uint16_t dy,
uint16_t colour )
virtual

Draw line, vector coordinates.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
colour16-bit colour


More: Coordinate, Colour

◆ dRectangle()

void hV_Screen_Buffer::dRectangle ( uint16_t x0,
uint16_t y0,
uint16_t dx,
uint16_t dy,
uint16_t colour )
virtual

Draw rectangle, vector coordinates.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
colour16-bit colour


More: Coordinate, Colour

◆ flush()

void hV_Screen_Buffer::flush ( )
pure virtual

Send frame-buffer to display.

Implemented in Screen_EPD_EXT3_Fast.

◆ fontMax()

uint8_t hV_Screen_Buffer::fontMax ( )
virtual

Number of fonts.

Returns
number of fonts available
Note
First font is numbered 0, second 1, ...
The latest font is numbered fontMax()-1

◆ getFont()

uint8_t hV_Screen_Buffer::getFont ( )
virtual

Get font number.

Returns
Number of the font, 0..fontMax()-1

◆ getOrientation()

uint8_t hV_Screen_Buffer::getOrientation ( )

Get orientation.

Returns
orientation orientation:
  • 0 = portrait
  • 1 = right rotated landscape
  • 2 = reverse portrait
  • 3 = left rotated landscape

◆ getTouch()

bool hV_Screen_Buffer::getTouch ( uint16_t & x,
uint16_t & y,
uint16_t & z,
uint16_t & t )

Poll touch.

Parameters
[out]xx coordinate
[out]yy coordinate
[out]zz coordinate=pressure
[out]tevent if available, otherwise 0
Returns
true if pressed


More: Coordinate, Touch

◆ getTouchInterrupt()

bool hV_Screen_Buffer::getTouchInterrupt ( )

Check touch interrupt.

Returns
true interrupt raised, false otherwise

◆ gText()

void hV_Screen_Buffer::gText ( uint16_t x0,
uint16_t y0,
String text,
uint16_t textColour = myColours.black,
uint16_t backColour = myColours.white )
virtual

Draw ASCII Text (pixel coordinates) with selection of size.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
texttext string
textColour16-bit colour, default = white
backColour16-bit colour, default = black
Note
Previously gText() with ix and iy


More: Colour, Fonts, Coordinate

◆ gTextLarge()

void hV_Screen_Buffer::gTextLarge ( uint16_t x0,
uint16_t y0,
String text,
uint16_t textColour = myColours.black,
uint16_t backColour = myColours.white )
virtual

Draw ASCII Text (pixel coordinates) with selection of size.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
texttext string
textColour16-bit colour, default = white
backColour16-bit colour, default = black
Note
Previously gText() with ix and iy


More: Colour, Fonts, Coordinate

◆ isTouch()

bool hV_Screen_Buffer::isTouch ( )

Is touch available?

Returns
true is touch available, false otherwise

◆ isTouchEvent()

bool hV_Screen_Buffer::isTouchEvent ( )

Are touch events available?

Returns
true if touch events available, false otherwise

◆ line()

void hV_Screen_Buffer::line ( uint16_t x1,
uint16_t y1,
uint16_t x2,
uint16_t y2,
uint16_t colour )
virtual

Draw line, rectangle coordinates.

Parameters
x1top left coordinate, x-axis
y1top left coordinate, y-axis
x2bottom right coordinate, x-axis
y2bottom right coordinate, y-axis
colour16-bit colour


More: Coordinate, Colour

◆ point()

void hV_Screen_Buffer::point ( uint16_t x1,
uint16_t y1,
uint16_t colour )
virtual

Draw pixel.

Parameters
x1point coordinate, x-axis
y1point coordinate, y-axis
colour16-bit colour


More: Coordinate, Colour

◆ rectangle()

void hV_Screen_Buffer::rectangle ( uint16_t x1,
uint16_t y1,
uint16_t x2,
uint16_t y2,
uint16_t colour )
virtual

Draw rectangle, rectangle coordinates.

Parameters
x1top left coordinate, x-axis
y1top left coordinate, y-axis
x2bottom right coordinate, x-axis
y2bottom right coordinate, y-axis
colour16-bit colour


More: Coordinate, Colour

◆ screenColourBits()

uint8_t hV_Screen_Buffer::screenColourBits ( )
virtual

Screen colour depth.

Returns
colour depth, in bits
Note
Examples: BW=1, BWR=2, RGB565=16


More: Coordinate

◆ screenDiagonal()

uint16_t hV_Screen_Buffer::screenDiagonal ( )
virtual

Screen size, diagonal.

Returns
diagonal size of the screen, in inches x 100
Note
320 means 3.20"

◆ screenSizeX()

uint16_t hV_Screen_Buffer::screenSizeX ( )
virtual

Screen size, x-axis of logical screen.

Returns
x-axis size of the screen, in pixels
Note
240 means 240 pixels and thus 0..239 coordinates (decimal)

◆ screenSizeY()

uint16_t hV_Screen_Buffer::screenSizeY ( )
virtual

Screen size, y-axis of logical screen.

Returns
y-axis size of the screen, in pixels
Note
240 means 240 pixels and thus 0..239 coordinates (decimal)

◆ selectFont()

void hV_Screen_Buffer::selectFont ( uint8_t font)
virtual

Select font number.

Parameters
fontdefault = 0, 0..fontMax()-1

◆ setFontSolid()

void hV_Screen_Buffer::setFontSolid ( bool flag = true)
virtual

Set transparent or opaque text.

Parameters
flagdefault = 1 = opaque = solid, false = transparent

◆ setFontSpaceX()

void hV_Screen_Buffer::setFontSpaceX ( uint8_t number = 1)
virtual

Set additional spaces between two characters, horizontal axis.

Parameters
numberof spaces default = 1 pixel

◆ setFontSpaceY()

void hV_Screen_Buffer::setFontSpaceY ( uint8_t number = 1)
virtual

Set additional spaces between two characters, vertical axis.

Parameters
numberof spaces default = 1 pixel

◆ setOrientation()

void hV_Screen_Buffer::setOrientation ( uint8_t orientation)
virtual

Set orientation.

Parameters
orientationorientation,
  • 0 = default
  • 1 = right rotated
  • 2 = reverse default
  • 3 = left rotated
  • ORIENTATION_PORTRAIT = 6 = check portrait
  • ORIENTATION_LANDSCAPE = 7 = check landscape
Note
Run the Common_Orientation.ino example to identify the options

◆ setPenSolid()

void hV_Screen_Buffer::setPenSolid ( bool flag = true)
virtual

Set pen opaque.

Parameters
flagdefault = true = opaque = solid, false = wire frame

◆ stringLengthToFitX()

uint8_t hV_Screen_Buffer::stringLengthToFitX ( String text,
uint16_t pixels )
virtual

Number of characters to fit a size, x-axis.

Parameters
textstring to evaluate
pixelsnumber of pixels to fit in
Returns
number of characters to be displayed inside the pixels
More: Fonts

◆ stringSizeX()

uint16_t hV_Screen_Buffer::stringSizeX ( String text)
virtual

String size, x-axis.

Parameters
textstring to evaluate
Returns
horizontal size of the string for current font, in pixels
More: Fonts

◆ triangle()

void hV_Screen_Buffer::triangle ( uint16_t x1,
uint16_t y1,
uint16_t x2,
uint16_t y2,
uint16_t x3,
uint16_t y3,
uint16_t colour )
virtual

Draw triangle, rectangle coordinates.

Parameters
x1first point coordinate, x-axis
y1first point coordinate, y-axis
x2second point coordinate, x-axis
y2second point coordinate, y-axis
x3third point coordinate, x-axis
y3third point coordinate, y-axis
colour16-bit colour
Note
If two points are equal, draw a line


More: Coordinate, Colour

◆ WhoAmI()

virtual String hV_Screen_Buffer::WhoAmI ( )
pure virtual

Request information about the screen.

Returns
string with hardware version

Implemented in Screen_EPD_EXT3_Fast.


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