// wj_qr.h -- thin wrapper around the vendored qrcodegen library: build a QR
// code for the join URL and rasterize it into an RGBA buffer that the menu
// code can hand to AnimTexture (src/common/textures/animtexture.h) to show
// as an in-game graphic, with no image-file decoder involved.
#pragma once
#include <string>
#include <vector>
#include <cstdint>
struct WJQRImage
{
int width = 0; // pixels, always square
std::vector<uint8_t> rgba; // width*width*4 bytes, top-to-bottom, row-major
};
// Encodes `text` (expected to be a short http://... URL) as a QR code and
// rasterizes it at `moduleScale` pixels per module (>=1) plus a standard
// 4-module quiet-zone border, as opaque black-on-white RGBA. Returns a
// zero-width image if the text is too long to fit in a QR code.
WJQRImage WJ_MakeQRCode(const std::string &text, int moduleScale = 8);