C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
canvas.h File Reference
#include "pico/stdlib.h"
#include <stdio.h>
#include <map>
Include dependency graph for canvas.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  struct_ConfigGraphicWidget
 data structure used to configure graphic framebuffer More...
 
struct  struct_ConfigTextWidget
 the data structure used to configure textual widget More...
 
class  Canvas
 The canvas is a virtual memory in which the widget draws. More...
 
class  CanvasVLSB
 A special version of canvas for monochrome widget (and device) with 8pixel/byte arranged vertically. More...
 
class  CanvasRGB
 A special version of canvas for color widget (and device) with 1 pixel/byte according to 565 RGB color coding. More...
 
class  CanvasTrueRGB
 A special version of canvas for color widget (and device) with true RGB_COLOR_INDEX_8b color coding(i.e. 16bit) per pixel. More...
 
class  CanvasHMSB
 A special version of canvas for monochrome widget with 8pixel/byte arranged horizontally. Usefull for monochrome widget (e.g.text) even for color RGB_COLOR_INDEX_8b display device. More...
 

Macros

#define FONT_WIDTH_INDEX   0
 index of the font width value in the <...>_font.h file
 
#define FONT_HEIGHT_INDEX   1
 index of the font height value in the <...>_font.h file
 
#define BYTE_SIZE   8
 the symbolic value of a byte
 

Enumerations

enum class  ColorIndex
 define the code value for color
 
enum class  CanvasFormat {
  MONO_VLSB , MONO_HLSB , MONO_HMSB , RGB_COLOR_INDEX_8b ,
  RGB565_16b
}
 the format of the canvas More...
 

Variables

std::map< ColorIndex, uint16_t > color565_palette
 the map color for RGB_COLOR_INDEX_8b canvas
 

Detailed Description

Author
xiansnn (xians.nosp@m.nn@h.nosp@m.otmai.nosp@m.l.co.nosp@m.m)
Version
0.1
Date
2025-04-07

Enumeration Type Documentation

◆ CanvasFormat

enum class CanvasFormat
strong

the format of the canvas

Enumerator
MONO_VLSB 

monochrome canvas, pixel arranged vertically, LSB is top pixel.

Note
example: SSD1306
MONO_HLSB 

monochrome canvas, pixel arranged horizontally, LSB is left pixel

Note
example: SH1106
MONO_HMSB 

monochrome canvas, pixel arranged horizontally, MSB is left pixel

Note
example: ST7735 in 1-bit mode
RGB_COLOR_INDEX_8b 

color canvas, 8-bit/pixel coded according to ColorIndex in color565_palette. Converted to RGB565 just before being sent to display device.

Note
example: ST7735 in 16-bit mode
RGB565_16b 

color canvas, 16bits/pixel arranged 5b-red,6b-green,5b-blue stored in buffer. This is to allow the use of 16bit DMA.

Note
example: ST7735 in 16-bit mode with transfer from canvas done by DMA. In this case the canvas buffer format Canvas::RGB565_16b is directly compatible with the ST7735 16-bit mode.