Module: Quirc

Defined in:
lib/quirc.rb,
lib/quirc/version.rb,
lib/quirc/image_processor.rb,
lib/quirc/ext/string_camelize.rb,
lib/quirc/image_processor/vips.rb,
lib/quirc/image_processor/mini_magick.rb,
ext/quirc/quirc.c

Defined Under Namespace

Modules: Ext Classes: Data, ImageProcessor, Recognizer

Constant Summary collapse

VERSION =
"0.1.1"
LIB_VERSION =
LIB_VERSION

Class Method Summary collapse

Class Method Details

.recognize(path, width: nil, height: nil, image_processor: :vips, **options) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/quirc.rb', line 12

def recognize(path, width: nil, height: nil, image_processor: :vips, **options)
  processor = lookup_image_processor(image_processor, path)

  processor.to_grayscale(width: width, height: height, **options) do |image_data, width, height|
    Recognizer.new.recognize(image_data, width, height)
  end
end