Qr

object Qr

Friendly one-call facade over the QR engine.

For full control (other symbologies, custom binarizers, multi-format reading) drop down to Encoder, QRCodeReader and the MultiFormat* classes directly.

Functions

Link copied to clipboard
fun decode(source: LuminanceSource, tryHarder: Boolean = true): Result

Decodes a single QR code from a LuminanceSource (e.g. RGBLuminanceSource for a still image, PlanarYUVLuminanceSource for a camera frame), using the hybrid binarizer.

Link copied to clipboard
fun encode(contents: String, ecLevel: ErrorCorrectionLevel = ErrorCorrectionLevel.M, characterSet: String? = null, version: Int? = null): BitMatrix

Encodes contents into a tight QR BitMatrix: one cell per module, no quiet zone, no scaling. Add margins and scale at render time with toSvg() / toPng() (see io.github.yuroyami.kiteqr.render).