Git Product home page Git Product logo

raztec's Introduction

Raztec

Still work in progress

Aztec barcode reader and writer written in Rust. The objective is that no third-party library should be used and code generation should be fast and accurate.

Quick start

The Aztec code generator comes as a Builder:

use raztec::writer::AztecCodeBuilder;
let code = AztecCodeBuilder::new().error_correction(23)
    .append("Hello").append(", ").append("World!").build().unwrap();

Please note that the build function returns a Result as the Aztec Code generation may fail.

This gives you an AztecCode struct that have the Index IndexMut and Display traits. You can get the current side size with code.size(). You can convert the AztecCode struct into a pixel array using to_image, to_rgb8 and to_mono8.

This library also supports the generation and scanning of Aztec Runes. An Aztec Rune is a compact Aztec Code containing only one byte of information. Here is an example of generating a rune with the byte value 38:

use raztec::writer::AztecCodeBuilder;
let rune = AztecCodeBuilder::build_rune(38);

There is currently no builtin Aztec code reader (Coming soon).

Generated using raztec

Example Aztec Code

Documentation

The library's code is fully documented, to see the documentation use: cargo doc --open

Issues

If you enconter any issues or bugs while generating or scanning Aztec Codes, please open an issue so I can look into it.

TODO

  • Implement an Aztec code reader
  • Improve speed of big Aztec Code generation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.