rubysketch 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +6 -0
- data/VERSION +1 -1
- data/examples/camera.rb +1 -1
- data/lib/rubysketch/processing.rb +38 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5824abb04b555aa085934c3eefb32dc0cf5a79c6bc48945d5706a260c46269d
|
4
|
+
data.tar.gz: 35d88e63413027b4c8c574b860c2dd9e443cb29f140e9820ec73bacaaf800f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34eaeef4a6992cfa326e16bd58b07e27b4757876129d03d246b717d334620d87d6a412f61757545bd4db561f83f38d8dd9303d255276ae0a544a4731759d853c
|
7
|
+
data.tar.gz: f0f4d8498f19da6a602cb4b120e91cdaebb718e66d4980433cb2386e0ed45e47aeefd25adb2c03974a93fefe2f862783325cd8c1cf923174f8467825172d647b
|
data/ChangeLog.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.8
|
data/examples/camera.rb
CHANGED
@@ -737,13 +737,32 @@ module RubySketch
|
|
737
737
|
# @return [Array] device name list
|
738
738
|
#
|
739
739
|
def self.list ()
|
740
|
-
|
740
|
+
Rays::Camera.device_names
|
741
741
|
end
|
742
742
|
|
743
743
|
# Initialize camera object.
|
744
744
|
#
|
745
|
-
|
746
|
-
|
745
|
+
# @overload Capture.new()
|
746
|
+
# @overload Capture.new(cameraName)
|
747
|
+
# @overload Capture.new(requestWidth, requestHeight)
|
748
|
+
# @overload Capture.new(requestWidth, requestHeight, cameraName)
|
749
|
+
#
|
750
|
+
# @param requestWidth [Integer] captured image width
|
751
|
+
# @param requestHeight [Integer] captured image height
|
752
|
+
# @param cameraName [String] camera device name
|
753
|
+
#
|
754
|
+
def initialize (*args)
|
755
|
+
width, height, name =
|
756
|
+
if args.empty?
|
757
|
+
[-1, -1, nil]
|
758
|
+
elsif args[0].kind_of?(String)
|
759
|
+
[-1, -1, args[0]]
|
760
|
+
elsif args[0].kind_of?(Numeric) && args[1].kind_of?(Numeric)
|
761
|
+
[args[0], args[1], args[2]]
|
762
|
+
else
|
763
|
+
raise ArgumentError
|
764
|
+
end
|
765
|
+
@camera = Rays::Camera.new width, height, device_name: name
|
747
766
|
end
|
748
767
|
|
749
768
|
# Start capturing.
|
@@ -778,6 +797,22 @@ module RubySketch
|
|
778
797
|
@camera.image
|
779
798
|
end
|
780
799
|
|
800
|
+
# Returns the width of captured image
|
801
|
+
#
|
802
|
+
# @return [Numeric] the width of captured image
|
803
|
+
#
|
804
|
+
def width ()
|
805
|
+
@camera.image&.width || 0
|
806
|
+
end
|
807
|
+
|
808
|
+
# Returns the height of captured image
|
809
|
+
#
|
810
|
+
# @return [Numeric] the height of captured image
|
811
|
+
#
|
812
|
+
def height ()
|
813
|
+
@camera.image&.height || 0
|
814
|
+
end
|
815
|
+
|
781
816
|
# @private
|
782
817
|
def getInternal__ ()
|
783
818
|
@camera.image || dummyImage__
|
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.8
|
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-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reflexion
|