-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruby_manor_1.rb
More file actions
40 lines (29 loc) · 767 Bytes
/
ruby_manor_1.rb
File metadata and controls
40 lines (29 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Ruby Manor 1
class RubyManor1 < Processing::App
load_library :video
# We need the video classes to be included here.
include_package "processing.video"
attr_accessor :capture
def setup
frame_rate 30
smooth
size(800, 600)
@sample_rate = 10
# You can get a list of cameras
# by doing Capture.list
#
#
# or you can use your default
# webcam by leaving it out of
# the parameters ..
#
# camera = "Sony Eye Toy (2)"
# @capture = Capture.new(self, width, height, camera, 30)
@capture = Capture.new(self, width, height, 30)
end
def draw
capture.read if capture.available
image capture, 0, 0
end
end
RubyManor1.new :title => "Ruby Manor 1"