Giter Site home page Giter Site logo

ruby-dmtx's Introduction

This is a gem enabled version with some additional features of the ruby wrapper for libdmtx that can be found at: https://github.com/dmtx/dmtx-wrappers

The original README file is renamed as libdmtx-README.

Installation

gem install Rdmtx

Dependencies

  • libdmtx
  • rmagick

Example

require 'rmagick'
require 'Rdmtx'
rdmtx = Rdmtx.new
i = rdmtx.encode("Hello you !!", 5, 5)
i.write("output.png")

See test.rb for a decode example.

API

Create new Rdmtx object

rdmtx.new

Encoding

rdmtx.encode(String, MarginSize, ModuleSize, SizeRequest)

Creates and returns an rmagick image object by encoding String with (optional arguments) margin MarginSize, module ModuleSize, and request a particular size of the output SizeRequest.

  • MarginSize is the margin in number of pixels
  • ModuleSize is the size of one module in number of pixels
  • SizeRequest has to be one of pre-defined constants like: DmtxSymbolSquareAuto, DmtxSymbol10x10, etc.. See ext/rdmtx/Rdmtx.c for a full listing of the possible values.

Decoding

rdmtx.decode(Image, Timeout)

Decodes the rmagick image object Image within Timeout.

ruby-dmtx's People

Contributors

srijan avatar phyzalis avatar

Watchers

James Cloos avatar

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.