- add conf.gem line to
build_config.rb
MRuby::Build.new do |conf|
# ... (snip) ...
conf.gem :github => 'kjunichi/mruby-webcam'
end
cam = Webcam.new
cam.set_size 300, 300
cam.capture {|img|
# img : JPEG format(default)
puts img.length
}
# SPC : capture
# ESC : exit
cam.start
cam = Webcam.new
cam.set_size 300, 300
cam.each {|img|
# img : JPEG format(default)
puts img.length
}
cam = Webcam.new
cam.set_fmt "ppm"
cam.capture {|img|
# img : PPM format(P6)
puts img
}
# SPC : capture
# ESC : exit
cam.start
under the MIT License:
- see LICENSE file