TR-mbed 1.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Adafruit_GFX Class Referenceabstract

#include <Adafruit_GFX.h>

Inheritance diagram for Adafruit_GFX:
Adafruit_SSD1306 Adafruit_SSD1306_I2c Adafruit_SSD1306_Spi

Public Member Functions

 Adafruit_GFX (int16_t w, int16_t h)
 
virtual void drawPixel (int16_t x, int16_t y, uint16_t color)=0
 Paint one BLACK or WHITE pixel in the display buffer.
 
virtual void invertDisplay (bool i)
 
virtual int _putc (int value)
 
virtual int _getc ()
 
void drawChar (int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size)
 Draw a text character at a specified pixel location.
 
size_t writeChar (uint8_t)
 Draw a text character at the text cursor location.
 
int16_t width (void)
 Get the width of the display in pixels.
 
int16_t height (void)
 Get the height of the display in pixels.
 
void setTextCursor (int16_t x, int16_t y)
 Set the text cursor location, based on the size of the text.
 
void setTextColor (uint16_t c)
 Set the text foreground and background colors to be the same.
 
void setTextColor (uint16_t c, uint16_t b)
 Set the text foreground and background colors independantly.
 
void setTextWrap (bool w)
 Set text wraping mode true or false.
 
void setRotation (uint8_t r)
 Set the display rotation, 1, 2, 3, or 4.
 
uint8_t getRotation (void)
 Get the current rotation.
 

Protected Attributes

int16_t _rawWidth
 
int16_t _rawHeight
 
int16_t _width
 
int16_t _height
 
int16_t cursor_x
 
int16_t cursor_y
 
uint16_t textcolor
 
uint16_t textbgcolor
 
uint8_t textsize
 
uint8_t rotation
 
bool wrap
 

Detailed Description

This is a Text and Graphics element drawing class. These functions draw to the display buffer.

Display drivers should be derived from here. The Display drivers push the display buffer to the hardware based on application control.

Constructor & Destructor Documentation

◆ Adafruit_GFX()

Adafruit_GFX::Adafruit_GFX ( int16_t  w,
int16_t  h 
)
inline

Member Function Documentation

◆ _getc()

virtual int Adafruit_GFX::_getc ( )
inlinevirtual

◆ _putc()

virtual int Adafruit_GFX::_putc ( int  value)
inlinevirtual

◆ drawChar()

void Adafruit_GFX::drawChar ( int16_t  x,
int16_t  y,
unsigned char  c,
uint16_t  color,
uint16_t  bg,
uint8_t  size 
)

Draw a text character at a specified pixel location.

◆ drawPixel()

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

Paint one BLACK or WHITE pixel in the display buffer.

Implemented in Adafruit_SSD1306.

◆ getRotation()

uint8_t Adafruit_GFX::getRotation ( void  )
inline

Get the current rotation.

◆ height()

int16_t Adafruit_GFX::height ( void  )
inline

Get the height of the display in pixels.

◆ invertDisplay()

virtual void Adafruit_GFX::invertDisplay ( bool  i)
inlinevirtual

Reimplemented in Adafruit_SSD1306.

◆ setRotation()

void Adafruit_GFX::setRotation ( uint8_t  r)

Set the display rotation, 1, 2, 3, or 4.

◆ setTextColor() [1/2]

void Adafruit_GFX::setTextColor ( uint16_t  c)
inline

Set the text foreground and background colors to be the same.

◆ setTextColor() [2/2]

void Adafruit_GFX::setTextColor ( uint16_t  c,
uint16_t  b 
)
inline

Set the text foreground and background colors independantly.

◆ setTextCursor()

void Adafruit_GFX::setTextCursor ( int16_t  x,
int16_t  y 
)
inline

Set the text cursor location, based on the size of the text.

◆ setTextWrap()

void Adafruit_GFX::setTextWrap ( bool  w)
inline

Set text wraping mode true or false.

◆ width()

int16_t Adafruit_GFX::width ( void  )
inline

Get the width of the display in pixels.

◆ writeChar()

size_t Adafruit_GFX::writeChar ( uint8_t  c)

Draw a text character at the text cursor location.

Member Data Documentation

◆ _height

int16_t Adafruit_GFX::_height
protected

◆ _rawHeight

int16_t Adafruit_GFX::_rawHeight
protected

◆ _rawWidth

int16_t Adafruit_GFX::_rawWidth
protected

◆ _width

int16_t Adafruit_GFX::_width
protected

◆ cursor_x

int16_t Adafruit_GFX::cursor_x
protected

◆ cursor_y

int16_t Adafruit_GFX::cursor_y
protected

◆ rotation

uint8_t Adafruit_GFX::rotation
protected

◆ textbgcolor

uint16_t Adafruit_GFX::textbgcolor
protected

◆ textcolor

uint16_t Adafruit_GFX::textcolor
protected

◆ textsize

uint8_t Adafruit_GFX::textsize
protected

◆ wrap

bool Adafruit_GFX::wrap
protected

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