File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed
processing_app/library/video/capture Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change 66def setup
77 sketch_title 'Black & White Capture'
88 @my_shader = load_shader ( data_path ( 'bwfrag.glsl' ) )
9- start_capture ( width , height )
9+ start_capture
1010end
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
1515end
1616
@@ -21,10 +21,10 @@ def draw
2121end
2222
2323# using snake case to match java reflect method
24- def captureEvent ( c )
25- c . read
24+ def captureEvent ( cam )
25+ cam . read
2626end
2727
2828def settings
29- size ( 960 , 544 , P2D )
29+ size ( 480 , 360 , P2D )
3030end
Original file line number Diff line number Diff line change 77def 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 ] )
1712end
1813
1914def start_capture ( cam_string )
@@ -36,5 +31,5 @@ def captureEvent(c)
3631end
3732
3833def settings
39- size 1280 , 720 , P2D
34+ size 960 , 720 , P2D
4035end
You can’t perform that action at this time.
0 commit comments