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
canvas_types.h File Reference

Basic structures of canvas gfx library. More...

#include "canvas/UserSettings.h"
#include <stdint.h>
#include <stddef.h>
Include dependency graph for canvas_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SFontHeaderRecord
 Structure describes font format in memory. More...
 
struct  SFixedFontInfo
 Structure is used for internal font presentation. More...
 
struct  SCharInfo
 Structure describes single char information. More...
 
struct  SAppMenu
 Describes menu object. More...
 

Macros

#define SSD1306_MORE_CHARS_REQUIRED   0xffff
 Flag means that more chars are required to decode utf-8.
 
#define RGB_COLOR8(r, g, b)   ((r & 0xE0) | ((g >> 3) & 0x1C) | (b >> 6))
 Macro to generate 8-bit color.
 
#define GRAY_COLOR4(gray)   (((gray >> 4) & 0x0F) | (gray & 0xF0))
 Macro to generate 4-bit monochrome color from gray component.
 
#define RGB_COLOR4(r, g, b)   ((r >> 2) + (g >> 1) + (b >> 2))
 Macro to generate 4-bit monochrome color from RGB.
 
#define RGB8_TO_GRAY4(rgb)   ((rgb >> 6) + ((rgb >> 2) & 0x07) + (rgb & 0x03))
 Macro to convert 8-bit RGB to 4-bit monochrome format.
 
#define RGB_COLOR16(r, g, b)   (((r << 8) & 0xF800) | ((g << 3) & 0x07E0) | (b >> 3))
 Macro to generate 16-bit RGB color.
 
#define RGB8_TO_RGB16(c)   ((((uint16_t)c & 0b11100000) << 8) | (((uint16_t)c & 0b00011100) << 6) | (((uint16_t)c & 0b00000011) << 3))
 Macro to convert 3-3-2 color to 5-6-5 color.
 
#define RGB16_TO_RGB8(c)   (((uint16_t)(c >> 8) & 0b11100000) | ((uint16_t)(c >> 6) & 0b00011100) | ((uint16_t)(c >> 3) & 0b00000011))
 Macro to convert 5-6-5 color to 3-3-2 color.
 

Typedefs

typedef int8_t lcdint_t
 internal int type, used by the library. More...
 
typedef uint8_t lcduint_t
 internal int type, used by the library. More...
 

Enumerations

enum  EFontStyle { STYLE_NORMAL, STYLE_BOLD, STYLE_ITALIC }
 Supported font styles.
 
enum  { CANVAS_MODE_BASIC = 0x00, CANVAS_TEXT_WRAP = 0x01, CANVAS_MODE_TRANSPARENT = 0x02, CANVAS_TEXT_WRAP_LOCAL = 0x04 }
 
enum  EFontSize { FONT_SIZE_NORMAL = 0, FONT_SIZE_2X = 1, FONT_SIZE_4X = 2, FONT_SIZE_8X = 3 }
 Supported scale font values.
 

Detailed Description

Basic structures of canvas gfx library.

Definition in file canvas_types.h.

Typedef Documentation

◆ lcdint_t

typedef int8_t lcdint_t

internal int type, used by the library.

Important for uC with low SRAM

Definition at line 77 of file canvas_types.h.

◆ lcduint_t

typedef uint8_t lcduint_t

internal int type, used by the library.

Important for uC with low SRAM

Definition at line 79 of file canvas_types.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CANVAS_TEXT_WRAP 

If the flag is specified, text cursor is moved to new line when end of screen is reached.

CANVAS_MODE_TRANSPARENT 

This flag make bitmaps transparent (Black color)

CANVAS_TEXT_WRAP_LOCAL 

If the flag is specified, text cursor is moved to new line when end of canvas is reached.

Definition at line 95 of file canvas_types.h.