Coder Social home page Coder Social logo

extension-qrcode's Introduction

QRCode

A small extension to encode and decode QR codes. It relies on buffers.

For the supported set of QRCodes to decode, see the documentation for Quirc decoded The encoder supports the traditional QR code type.

The QRCode extension itself should be supported on all platforms. However, the example app relies on getting images from the camera and that extension is currently only supports OSX, iOS and Android (and the Android support is very work-in-progress)

Example app

Push the Scan button to start scanning for qrcodes. The camera starts running and the the app scans the camera image for the first qrcode. Similarly, push the QRCode button to create a qrcode:

Lua api:

qrcode.scan(buffer, width, height, flip_x) -> string

Scans an image buffer for any qrcode.

buffer An image buffer where the first stream must be of format UINT8 * 3, and have the dimensions width*height

width The width of the image, in texels

height The height of the image, in texels

flip_x A boolean flag (1 or 0) that tells the decoder to flip the image in X first.

-> string Returns a the text from the qrcode if successful. Returns nil otherwise

qrcode.generate(text) -> buffer, size

Generates a qrcode in the form of a buffer of format: name = 'data', type = UINT8 * 1, and dimensions size * size

text The text that needs decoding. The maximum text length is dependent on the input data. Kanji is currently not supported specifically, but will be treated as bytes

-> buffer An image buffer of dimensions size * size. The stream name is data and the type+count is UINT8 * 1

-> size The size of one side of the image

Credits:

Decoder

https://github.com/dlbeer/quirc

Encoder

https://github.com/JCash/qrcode

I also use this site to create test images: https://www.the-qrcode-generator.com/

extension-qrcode's People

Contributors

mathiaswking avatar jcash avatar britzl avatar

Stargazers

Alexey Gulev avatar Griffin of Innatical avatar Kyle Howells avatar

Watchers

Sven Andersson avatar Markus Gustavsson avatar Jhonny Göransson avatar Erik Angelin avatar vlaaad avatar James Cloos avatar  avatar  avatar Alexey Gulev avatar Codestra avatar  avatar Sven Andersson avatar Sara Cederberg avatar  avatar  avatar Ragnar Dahlén avatar  avatar

extension-qrcode's Issues

Error in documentation

flip_x A boolean flag that tells the decoder to flip the image in X first.

It seems that it expects an int (were 0 is flipped?).

Does not run on Windows or OSX

Running the example/this project crashes it on start up.

I highly suspect it is because of this error in camera-extension
defold/extension-camera#3 as the first error is # 0 pc 0x2d52e5fd ServiceManagement _sigtramp+29 - the same as in that issue.

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.