Skip to content

Commit a914ff1

Browse files
committed
Update to work with latest processinf video beta release
1 parent 722ae9d commit a914ff1

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

processing_app/library/video/capture/black_white_capture.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
def setup
77
sketch_title 'Black & White Capture'
88
@my_shader = load_shader(data_path('bwfrag.glsl'))
9-
start_capture(width, height)
9+
start_capture
1010
end
1111

12-
def start_capture(w, h)
13-
@cam = Java::ProcessingVideo::Capture.new(self, w, h)
12+
def start_capture
13+
@cam = Java::ProcessingVideo::Capture.new(self, "UVC Camera (046d:0825)")
1414
cam.start
1515
end
1616

@@ -21,10 +21,10 @@ def draw
2121
end
2222

2323
# using snake case to match java reflect method
24-
def captureEvent(c)
25-
c.read
24+
def captureEvent(cam)
25+
cam.read
2626
end
2727

2828
def settings
29-
size(960, 544, P2D)
29+
size(480, 360, P2D)
3030
end

processing_app/library/video/capture/test_capture.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
def setup
88
sketch_title 'Test Capture'
99
cameras = Capture.list
10-
fail 'There are no cameras available for capture.' if cameras.length.zero?
11-
p 'Matching cameras available:'
12-
size_pattern = Regexp.new(format('%dx%d', width, height))
13-
select = cameras.grep size_pattern # filter available cameras
14-
select.uniq.map { |cam| p cam.strip }
15-
fail 'There are no matching cameras.' if select.length.zero?
16-
start_capture(select[0])
10+
fail 'There are no matching cameras.' if cameras.length.zero?
11+
start_capture(cameras[0])
1712
end
1813

1914
def start_capture(cam_string)
@@ -36,5 +31,5 @@ def captureEvent(c)
3631
end
3732

3833
def settings
39-
size 1280, 720, P2D
34+
size 960, 720, P2D
4035
end

0 commit comments

Comments
 (0)