LCDGFX LCD display driver  1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
NanoCanvas< W, H, BPP > Class Template Reference

Template for user-defined canvas object. More...

#include <canvas.h>

Inheritance diagram for NanoCanvas< W, H, BPP >:
Collaboration diagram for NanoCanvas< W, H, BPP >:

Additional Inherited Members

- Public Types inherited from NanoCanvasOps< BPP >
typedef NanoCanvasOps< BPP > T
 Base type for canvas class specific operations.
 
- Public Member Functions inherited from NanoCanvasOps< BPP >
 NanoCanvasOps ()
 Creates new empty canvas object. More...
 
 NanoCanvasOps (lcdint_t w, lcdint_t h, uint8_t *bytes)
 Creates new canvas object. More...
 
void begin (lcdint_t w, lcdint_t h, uint8_t *bytes)
 Initializes canvas object. More...
 
void setOffset (lcdint_t ox, lcdint_t oy)
 Sets offset. More...
 
const NanoPoint offsetEnd () const
 Returns right-bottom point of the canvas in offset terms. More...
 
const NanoRect rect () const
 Returns rectangle area, covered by canvas in offset terms. More...
 
void putPixel (lcdint_t x, lcdint_t y)
 Draws pixel on specified position. More...
 
void putPixel (const NanoPoint &p)
 Draws pixel on specified position. More...
 
void drawVLine (lcdint_t x1, lcdint_t y1, lcdint_t y2)
 Draws vertical line from (x1,y1) to (x1,y2). More...
 
void drawHLine (lcdint_t x1, lcdint_t y1, lcdint_t x2)
 Draws horizontal line from (x1,y1) to (x2,y1). More...
 
void drawLine (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
 Draws a line between two points using Bresenham's algorithm. More...
 
void drawLine (const NanoRect &rect)
 Draws line. More...
 
void drawRect (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
 Draws rectangle outline. More...
 
void drawRect (const NanoRect &rect)
 Draws rectangle outline using NanoRect structure. More...
 
void fillRect (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
 Fills a rectangular area with the current color. More...
 
void fillRect (const NanoRect &rect)
 Fills a rectangular area with the current color. More...
 
void drawCircle (lcdint_t x, lcdint_t y, lcdint_t r, uint8_t options=0x0F) __attribute__((noinline))
 Draws circle outline. More...
 
void drawBitmap1 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
 Draws monochrome bitmap in color buffer using color, specified via setColor() method Draws monochrome bitmap in color buffer using color, specified via setColor() method. More...
 
void drawBitmap8 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
 Draws 8-bit color bitmap in color buffer. More...
 
void drawBitmap16 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
 Draws 16-bit color bitmap in color buffer. More...
 
void clear () __attribute__((noinline))
 Clears canvas.
 
size_t write (uint8_t c)
 Writes single character to canvas. More...
 
uint8_t printChar (uint8_t c)
 Draws single character to canvas. More...
 
void printFixed (lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style=STYLE_NORMAL) __attribute__((noinline))
 Print text at specified position to canvas. More...
 
void printFixedPgm (lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style=STYLE_NORMAL)
 Print text at specified position to canvas. More...
 
void setMode (uint8_t modeFlags)
 Sets canvas drawing mode Sets canvas drawing mode. More...
 
void setColor (uint16_t color)
 Sets color for monochrome operations. More...
 
uint16_t getColor ()
 Returns currently set foreground color. More...
 
void invertColors ()
 Swaps foreground and background colors. More...
 
void setBackground (uint16_t color)
 Sets background color. More...
 
void setFont (NanoFont &font)
 Sets new font to use with print functions. More...
 
NanoFontgetFont ()
 Returns reference to NanoFont object currently in use. More...
 
void setFontSpacing (uint8_t spacing)
 Sets font spacing for currently active font. More...
 
void setFixedFont (const uint8_t *progmemFont)
 Sets new font to use with print functions. More...
 
void setFreeFont (const uint8_t *progmemFont, const uint8_t *secondaryFont=nullptr)
 Sets new font to use with print functions. More...
 
uint8_t * getData ()
 Return pointer to canvas pixels data.
 
lcduint_t width ()
 Returns canvas width in pixels.
 
lcduint_t height ()
 Returns canvas height in pixels.
 
void rotateCW (T &out)
 Rotates the canvas clock-wise.
 
- Public Attributes inherited from NanoCanvasOps< BPP >
NanoPoint offset
 Fixed offset for all operation of NanoCanvasOps in pixels.
 
- Static Public Attributes inherited from NanoCanvasOps< BPP >
static const uint8_t BITS_PER_PIXEL = BPP
 number of bits per single pixel in buffer
 
- Protected Attributes inherited from NanoCanvasOps< BPP >
lcduint_t m_w
 width of NanoCanvas area in pixels
 
lcduint_t m_h
 height of NanoCanvas area in pixels
 
lcdint_t m_cursorX
 current X cursor position for text output
 
lcdint_t m_cursorY
 current Y cursor position for text output
 
uint8_t m_textMode
 Flags for current NanoCanvas mode.
 
EFontStyle m_fontStyle
 currently active font style
 
uint8_t * m_buf
 Canvas data.
 
uint16_t m_color
 current color
 
uint16_t m_bgColor
 current background color
 
NanoFontm_font = nullptr
 current set font to use with NanoCanvas
 

Detailed Description

template<lcduint_t W, lcduint_t H, uint8_t BPP>
class NanoCanvas< W, H, BPP >

Template for user-defined canvas object.

template parameters are: width, height and bits per pixels. If object is defined locally, the pixels buffer is located in stack

Definition at line 475 of file canvas.h.


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