#qrcode #rmqr

qrqrpar

A QR code generator supporting rMQR

2 releases

0.1.2 Mar 5, 2024
0.1.0 Dec 9, 2023

#21 in #qr

Download history 25/week @ 2024-02-23 143/week @ 2024-03-01 21/week @ 2024-03-08 35/week @ 2024-03-15 3/week @ 2024-03-22 12/week @ 2024-03-29

80 downloads per month

BSD-3-Clause

190KB
4K SLoC

qrqrpar

qrqrpar

A QR code generator supporting rMQR

Online Demo Site

You can try out libraries with the WASM version online. Online Demo Site

Example

Normal Usage

use qrqrpar::{QrCode, QrStyle};

fn main() {
    // Encode some data into bits.
    let code = QrCode::rmqr("Hello, rmqr!").unwrap();

    // Define style
    let style = QrStyle::default();

    // Render the bits into an image and save it.
    code.save_png("rmqr.png", &style).unwrap();
}

Generates this image:

rmqr

With Options

use qrqrpar::{EcLevel, QrCode, QrShape, QrStyle, RmqrStrategy};

fn main() {
    // Encode some data into bits with the desired ECC level and strategy.
    let code = QrCode::rmqr_with_options(
        "驫驫驫驫驫驫驫驫驫驫驫驫驫驫",
        EcLevel::H,
        RmqrStrategy::Width,
    )
    .unwrap();

    // Specify the desired output size and style.
    let style = QrStyle::new("#0000cc", "#ffffcc", QrShape::Round, 720, 2.0);

    // Render the bits into an image and save it.
    code.save_svg("rmqr_round.svg", &style).unwrap();
}

Generates this image:

rmqr_round

Normal QR Code

use qrqrpar::{QrCode, QrStyle};

fn main() {
    let code = QrCode::new("Normal QR code").unwrap();

    // Specify the desired output color.
    let style = QrStyle {
        background_color: String::from("rgba(0,0,0,0)"),
        ..Default::default()
    };

    // Render the bits into an image and save it.
    code.save_png("normal_qr.png", &style).unwrap();
}

Generates this image:

Derived from

Original library: qrcode-rust

License: Apache-2.0 or MIT

This library is a derived work based on qrcode-rust. It is licensed under Apache-2.0 or MIT License. Please refer to the original library's license for more information.

License

Licensed under BSD-3-Clause License. See LICENSE for more information.

Dependencies

~5.5MB
~110K SLoC