Closed jurisgalang closed 11 years ago
Here's a workaround - replace the import "processing.video.Capture"
line with:
include_package "processing.video"
Not really sure why that works.
load_library :video include_package 'processing.video'
attr_reader :img, :video
def setup size 640, 480 @video = Capture.new self, width, height, 32 end
def draw video.read if video.available?
@img = create_image width, height, RGB
@video.load_pixels
img.load_pixels
video.pixels.each_with_index do |pixel, index|
img.pixels[index] = pixel
end
img.update_pixels
image(img, 0, 0) unless img.nil?
end
I don't have camera attached so above is untested, should work with my beta version of ruby-processing. I'm moving towards using 'include_package' in place of import (java_import is now preferred over import) since the processing app is wrapped in a module this should work. Note also moving toward the use of 'bare sketch'. @jurisgalang might be still interested?
@jurisgalang Have you tried the development version? Now available here (you could update your fork)
No interest after two-months closing, jurisgalang can always re-open it.
Here's a sample sketch to recreat it:
It won't display the last captured frame as expected.