rb_webcam 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rb_webcam.rb +6 -1
- data/rb_webcam.gemspec +1 -1
- data/spec/rb_webcam_spec.rb +11 -3
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/rb_webcam.rb
CHANGED
@@ -144,8 +144,13 @@ class Webcam
|
|
144
144
|
@iplimage_struct.depth
|
145
145
|
end
|
146
146
|
|
147
|
-
#
|
147
|
+
# String of image data
|
148
148
|
def data
|
149
|
+
self.data_pointer.read_string(self.data_size)
|
150
|
+
end
|
151
|
+
|
152
|
+
# FFI::Pointer to image data
|
153
|
+
def data_pointer
|
149
154
|
@iplimage_struct.image_data
|
150
155
|
end
|
151
156
|
|
data/rb_webcam.gemspec
CHANGED
data/spec/rb_webcam_spec.rb
CHANGED
@@ -30,14 +30,22 @@ describe Webcam do
|
|
30
30
|
it "color_depth should be Symbol" do
|
31
31
|
@image.color_depth.should be_instance_of Symbol
|
32
32
|
end
|
33
|
-
|
34
|
-
it "data should be instance of
|
35
|
-
@image.data.should be_instance_of
|
33
|
+
|
34
|
+
it "data should be instance of String" do
|
35
|
+
@image.data.should be_instance_of String
|
36
36
|
end
|
37
37
|
|
38
|
+
it "length of data should equal with data_size" do
|
39
|
+
@image.data.length.should == @image.data_size
|
40
|
+
end
|
41
|
+
|
38
42
|
it "data size should > 0" do
|
39
43
|
@image.data_size.should > 0
|
40
44
|
end
|
45
|
+
|
46
|
+
it "data_pointer should be instance of FFI::Pointer" do
|
47
|
+
@image.data_pointer.should be_instance_of FFI::Pointer
|
48
|
+
end
|
41
49
|
end
|
42
50
|
|
43
51
|
it "resolution mode of width should > 0" do
|