Module: ZBar

Extended by:
FFI::Library
Defined in:
lib/zbar/lib.rb,
lib/zbar/image.rb,
lib/zbar/symbol.rb,
lib/zbar/processor.rb,
lib/zbar/library_version.rb

Defined Under Namespace

Modules: Format, JPEG Classes: Image, LibraryVersion, Processor, Symbol

Class Method Summary collapse

Class Method Details

.library_versionObject

Returns a ZBar::LibraryVersion representing the currently loaded library.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/zbar/library_version.rb', line 3

def self.library_version
  @library_version ||= begin
    major = FFI::MemoryPointer.new :uint
    minor = FFI::MemoryPointer.new :uint
    rv = zbar_version(major, minor)
    if rv == 0
      LibraryVersion.new(major.read_uint, minor.read_uint)
    else
      raise "zbar_version failed, returning #{rv}"
    end
  end
end

.verbosity=(v) ⇒ Object

Sets the verbosity of the underlying ZBar library, which writes directly to stderr.



63
64
65
# File 'lib/zbar/lib.rb', line 63

def self.verbosity=(v)
  zbar_set_verbosity(v.to_i)
end