rubysketch 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +25 -0
- data/VERSION +1 -1
- data/examples/camera.rb +1 -1
- data/examples/delay_camera.rb +33 -0
- data/lib/rubysketch/processing.rb +15 -9
- data/test/helper.rb +0 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a3690207d8b2a8c6bfe3b556e9e1267e3508bcd757952fc738ce2594844a6a5
|
4
|
+
data.tar.gz: '0112280fc01e89633adff2ebbccc012ceab1bdcd9271dc9d6f14d8c9969ca586'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad81197d43586840b8f6828dd3f267a131017796d988bb958969b4fcc3cae7bcf41eca4123ce9f38039dab69195859cd3bb96a8afe1eda650a3abacd92a6944
|
7
|
+
data.tar.gz: de7e3c7bb04cdf8ac3f90893277e20b671073ebe03197c9a31987cdb5324e7e0ce07659064bce787115713c95471bdacec4323a29ce0a2bf22ad8d2b7cff6937
|
data/Rakefile
CHANGED
@@ -23,3 +23,28 @@ generate_documents
|
|
23
23
|
build_ruby_gem
|
24
24
|
|
25
25
|
task :default => :test
|
26
|
+
|
27
|
+
|
28
|
+
namespace :version do
|
29
|
+
|
30
|
+
namespace :bump do
|
31
|
+
|
32
|
+
task :major do
|
33
|
+
update_and_tag_version 0
|
34
|
+
end
|
35
|
+
|
36
|
+
task :minor do
|
37
|
+
update_and_tag_version 1
|
38
|
+
end
|
39
|
+
|
40
|
+
task :patch do
|
41
|
+
update_and_tag_version 2
|
42
|
+
end
|
43
|
+
|
44
|
+
task :build do
|
45
|
+
update_and_tag_version 3
|
46
|
+
end
|
47
|
+
|
48
|
+
end# bump
|
49
|
+
|
50
|
+
end# version
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.9
|
data/examples/camera.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
%w[xot rays reflex rubysketch]
|
2
|
+
.map {|s| File.expand_path "../../#{s}/lib", __dir__}
|
3
|
+
.each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
|
4
|
+
|
5
|
+
require 'rubysketch-processing'
|
6
|
+
|
7
|
+
|
8
|
+
w, h = width, height
|
9
|
+
|
10
|
+
cam = Capture.new w, h, Capture.list.last
|
11
|
+
cam.start
|
12
|
+
|
13
|
+
images = 60.times.map {
|
14
|
+
Graphics.new w, h
|
15
|
+
}
|
16
|
+
|
17
|
+
draw do
|
18
|
+
if frameCount % 2 == 0
|
19
|
+
images.unshift images.pop
|
20
|
+
images.first.tap do |image|
|
21
|
+
image.beginDraw {
|
22
|
+
image.image cam, 0, 0
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
background 0
|
28
|
+
segment_h= h / images.size
|
29
|
+
images.each.with_index do |image, i|
|
30
|
+
y = i * segment_h
|
31
|
+
copy image, 0, y, w, segment_h, 0, y, w, segment_h
|
32
|
+
end
|
33
|
+
end
|
@@ -767,11 +767,11 @@ module RubySketch
|
|
767
767
|
|
768
768
|
# Start capturing.
|
769
769
|
#
|
770
|
-
# @return [
|
770
|
+
# @return [nil] nil
|
771
771
|
#
|
772
772
|
def start ()
|
773
773
|
raise "Failed to start capture" unless @camera.start
|
774
|
-
|
774
|
+
nil
|
775
775
|
end
|
776
776
|
|
777
777
|
# Stop capturing.
|
@@ -940,13 +940,15 @@ module RubySketch
|
|
940
940
|
stroke 0
|
941
941
|
end
|
942
942
|
|
943
|
-
|
943
|
+
# @private
|
944
|
+
def beginDraw__ ()
|
944
945
|
@matrixStack__.clear
|
945
946
|
@styleStack__.clear
|
946
947
|
@drawing__ = true
|
947
948
|
end
|
948
949
|
|
949
|
-
|
950
|
+
# @private
|
951
|
+
def endDraw__ ()
|
950
952
|
@drawing__ = false
|
951
953
|
end
|
952
954
|
|
@@ -1716,17 +1718,21 @@ module RubySketch
|
|
1716
1718
|
|
1717
1719
|
# Start drawing.
|
1718
1720
|
#
|
1719
|
-
def beginDraw ()
|
1721
|
+
def beginDraw (&block)
|
1720
1722
|
@painter__.__send__ :begin_paint
|
1721
|
-
|
1723
|
+
beginDraw__
|
1722
1724
|
push
|
1725
|
+
if block
|
1726
|
+
block.call
|
1727
|
+
endDraw
|
1728
|
+
end
|
1723
1729
|
end
|
1724
1730
|
|
1725
1731
|
# End drawing.
|
1726
1732
|
#
|
1727
1733
|
def endDraw ()
|
1728
1734
|
pop
|
1729
|
-
|
1735
|
+
endDraw__
|
1730
1736
|
@painter__.__send__ :end_paint
|
1731
1737
|
end
|
1732
1738
|
|
@@ -1765,8 +1771,8 @@ module RubySketch
|
|
1765
1771
|
@mousePressed__ = false
|
1766
1772
|
@touches__ = []
|
1767
1773
|
|
1768
|
-
@window__.before_draw = proc {
|
1769
|
-
@window__.after_draw = proc {
|
1774
|
+
@window__.before_draw = proc {beginDraw__}
|
1775
|
+
@window__.after_draw = proc {endDraw__}
|
1770
1776
|
|
1771
1777
|
drawFrame = -> {
|
1772
1778
|
@image__ = @window__.canvas
|
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysketch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reflexion
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- examples/breakout.rb
|
44
44
|
- examples/camera.rb
|
45
45
|
- examples/clock.rb
|
46
|
+
- examples/delay_camera.rb
|
46
47
|
- examples/glsl.rb
|
47
48
|
- examples/hello.rb
|
48
49
|
- examples/image.rb
|