SANE bindings
Go to file
Denis Knauf 95b1f713b3 version bump to 0.1.2 2014-12-23 23:25:19 +01:00
lib version bump to 0.1.2 2014-12-23 23:25:19 +01:00
.gitignore initial import 2011-05-31 18:26:57 +02:00
Gemfile initial import 2011-05-31 18:26:57 +02:00
README.rdoc added simple readme 2011-06-01 14:51:57 +02:00
Rakefile initial import 2011-05-31 18:26:57 +02:00
sane-ffi.gemspec 1.8 compatibility (blah) 2011-06-01 14:20:30 +02:00

README.rdoc

= SANE FFI

Scanner Access Now Easier in Ruby using FFI. This gem provides
bindings to SANE library using Ruby FFI. You can easily access to the
device state (i.e. buttons), setup device parameters, scan images,
etc.

== Usage

  >> require "sane"
  => true
  >> Sane.open { |sane| puts sane.devices.inspect }
  [#<Sane::Device:"genesys:libusb:002:032">]
  => nil
  >> Sane.open { |sane| puts sane.devices.first.name }
  genesys:libusb:002:032
  => nil
  >> Sane.open { |sane| puts sane.devices.first.vendor }
  Canon
  => nil
  >> Sane.open { |sane| puts sane.devices.first.model }
  LiDE 100
  => nil
  >> Sane.open { |sane| puts sane.devices.first.type }
  flatbed scanner
  => nil
  >> Sane.open { |sane| sane.devices.first.open { |device| puts device.describe(:copy) } }
  {:name=>"copy", :title=>"Copy button", :desc=>"Copy button", :type=>:bool, :unit=>:none, :size=>4, :cap=>70}
  => nil
  >> Sane.open { |sane| sane.devices.first.open { |device| puts device[:copy] } }
  false
  => nil

== Copyright

Copyright (c) 2011 Jakub Kuźma