Sha256: 43b792a2c731ce31862debef8409bb3463caa7ebeafdce9bda21873faf946a57

Contents?: true

Size: 1.2 KB

Versions: 5

Compression:

Stored size: 1.2 KB

Contents

module ZXing; end
module ZXing::FFI; end

class ZXing::FFI::Common::GreyscaleLuminanceSource < ZXing::FFI::LuminanceSource
  def initialize image, left = nil, top = nil, width = nil, height = nil
    data = image.gray
    data_width = image.width
    data_height = image.height
    left == nil && left = 0
    top == nil && top = 0
    width == nil && width = image.width
    height == nil && height = image.height
    super ZXing::FFI::Library.GreyscaleLuminanceSource_new(
                                                           data,
                                                           data_width,
                                                           data_height,
                                                           left,
                                                           top,
                                                           width,
                                                           height)
  end
  def image
    Magick::Image.constitute(width,
                             height, 
                             "I",
                             matrix.get_array_of_char(0, width*height).map{|v|
                               v << 8
                             })
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
zxing_cpp_mac_big_sur-0.1.1 lib/zxing/ffi/common/greyscale_luminance_source.rb
zxing_cpp_no_cmake-0.1.2 lib/zxing/ffi/common/greyscale_luminance_source.rb
zxing_cpp_no_cmake-0.1.1 lib/zxing/ffi/common/greyscale_luminance_source.rb
zxing_cpp-0.1.1 lib/zxing/ffi/common/greyscale_luminance_source.rb
zxing_cpp-0.1.0 lib/zxing/ffi/common/greyscale_luminance_source.rb