CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
QrRaster.h File Reference

QR encoding into a caller-provided 1-bpp packed raster (no display). More...

#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Namespaces

namespace  cdc
namespace  cdc::ui
 Centralized key-code constants for cdc_views.
namespace  cdc::ui::qr

Functions

void cdc::ui::qr::packModule (uint8_t *out, uint16_t stride, uint8_t scale, uint8_t quiet, int mx, int my)
 Sets the packed pixels of one black QR module.
int cdc::ui::qr::measure (const char *data, uint8_t max_version, uint8_t ecc, uint16_t *out_modules)
 Measures the module count for data without rendering.
int cdc::ui::qr::render (const char *data, uint8_t max_version, uint8_t ecc, uint8_t scale, uint8_t quiet_modules, uint8_t *out, size_t out_size, uint16_t *out_stride_bytes, uint16_t *out_height_px)
 Encodes data and packs it into a 1-bpp raster.

Variables

constexpr uint16_t cdc::ui::qr::QR_MAX_SIDE_PX = 1024
 Hard cap on the rendered side length in pixels (incl. quiet zone, scaled).

Detailed Description

QR encoding into a caller-provided 1-bpp packed raster (no display).

Shares the espressif/qrcode dependency with QRCodeView but renders into memory: packed rows, MSB-first, a set bit is black - the common bitmap layout of MonoBitmap, the surface API and the thermo_print job format.

Definition in file QrRaster.h.