QRCodeManager
QR code generation and rendering#include <QRCodeManager.h>
Public Member Functions | |
| void | init (LGFX_Sprite *sprite) |
| void | create (const char *content) |
| void | create (const char *content, uint8_t version, uint8_t ecc=0) |
| void | setOffset (int x, int y) |
| void | setPixelSize (int pixelSize) |
| uint8_t | getSize () const |
| int | getPixelSize () const |
| bool | isValid () const |
Static Public Member Functions | |
| static String | generateWiFiQR (const String &ssid, const String &password, const String &security="WPA") |
| static String | generateURLQR (const String &url) |
| static String | generateTextQR (const String &text) |
Detailed Description
QR Code Generator and Renderer
Generates QR codes and renders them to display sprites or graphics contexts. Supports configurable positioning, scaling, and error correction levels.
Member Function Documentation
◆ create() [1/2]
| void CloudMouse::Utils::QRCodeManager::create | ( | const char * | content | ) |
Generate and render QR code from text content
- Parameters
| content | Text content to encode (URL, WiFi credentials, etc.) |
◆ create() [2/2]
| void CloudMouse::Utils::QRCodeManager::create | ( | const char * | content, |
| uint8_t | version, | ||
| uint8_t | ecc = 0 |
||
| ) |
Generate QR code with custom error correction level
- Parameters
| content | Text content to encode |
| version | QR code version (1-40, higher = more data capacity) |
| ecc | Error correction level (0=Low, 1=Medium, 2=Quartile, 3=High) |
◆ generateTextQR()
|
static |
◆ generateURLQR()
|
static |
◆ generateWiFiQR()
|
static |
◆ getPixelSize()
| int CloudMouse::Utils::QRCodeManager::getPixelSize | ( | ) | const |
Get rendered QR code dimensions in pixels
- Returns
- Size of rendered QR code in pixels
◆ getSize()
| uint8_t CloudMouse::Utils::QRCodeManager::getSize | ( | ) | const |
Get QR code dimensions
- Returns
- Size of QR code in modules (width/height are equal)
◆ init()
| void CloudMouse::Utils::QRCodeManager::init | ( | LGFX_Sprite * | sprite | ) |
Initialize QR code manager with display sprite
- Parameters
| sprite | Pointer to display sprite for rendering |
◆ isValid()
| bool CloudMouse::Utils::QRCodeManager::isValid | ( | ) | const |
Check if QR code generation was successful
- Returns
- true if QR code is valid and ready for rendering
◆ setOffset()
| void CloudMouse::Utils::QRCodeManager::setOffset | ( | int | x, |
| int | y | ||
| ) |
Set rendering position offset
- Parameters
| x | X coordinate offset from sprite origin |
| y | Y coordinate offset from sprite origin |
◆ setPixelSize()
| void CloudMouse::Utils::QRCodeManager::setPixelSize | ( | int | pixelSize | ) |
Set pixel size for QR code modules
- Parameters
| pixelSize | Size of each QR code module in pixels |