Class: OpenCV::Cv::FileNode
- Inherits:
-
Object
- Object
- OpenCV::Cv::FileNode
show all
- Extended by:
- FFI::DataConverter
- Includes:
- Enumerable
- Defined in:
- lib/ropencv/ropencv_ruby.rb,
lib/ropencv/ropencv_types.rb
- NONE =
0
- INT =
1
- REAL =
2
- FLOAT =
Cv::REAL
- STR =
3
- STRING =
3
- SEQ =
4
- MAP =
5
- TYPE_MASK =
7
- FLOW =
8
- UNIFORM =
8
- EMPTY =
16
- NAMED =
32
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
339
340
341
342
343
344
345
|
# File 'lib/ropencv/ropencv_ruby.rb', line 339
def method_missing(m,*args)
if args.empty? && map?
self[m.to_s]
else
super
end
end
|
Class Method Details
.new(*args) ⇒ Object
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
|
# File 'lib/ropencv/ropencv_types.rb', line 20255
def self.new(*args)
if args.first.is_a?(FFI::Pointer) || args.first.is_a?(FileNodeStruct)
raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
return super(args.first)
end
@@cv_file_node_file_node_defaults0 ||= []
if(args.size >= 0 && args.size <= 0)
targs = args.clone
targs.size.upto(-1) do |i|
targs[i] = @@cv_file_node_file_node_defaults0[i]
end
begin
return Rbind::cv_file_node_file_node(*targs)
rescue TypeError => e
@error = e
end
end
raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end
|
.null ⇒ Object
returns a null pointer to the object
20251
20252
20253
|
# File 'lib/ropencv/ropencv_types.rb', line 20251
def self.null
new(FileNodeStruct.new)
end
|
Instance Method Details
Note:
method wrapper for const cv::FileNode cv::FileNode::operator
20468
20469
20470
20471
20472
20473
20474
20475
20476
|
# File 'lib/ropencv/ropencv_types.rb', line 20468
def at(i)
__validate_pointer__
result = Rbind::cv_file_node_at( self, i)
if result.respond_to?(:__owner__?) && !result.__owner__?
result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self)
end
result
end
|
Note:
method wrapper for const cv::FileNodeIterator cv::FileNode::begin()
20429
20430
20431
20432
20433
20434
20435
20436
20437
|
# File 'lib/ropencv/ropencv_types.rb', line 20429
def begin()
__validate_pointer__
result = Rbind::cv_file_node_begin( self)
if result.respond_to?(:__owner__?) && !result.__owner__?
result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self)
end
result
end
|
#each(&block) ⇒ Object
243
244
245
246
247
248
249
250
251
252
253
|
# File 'lib/ropencv/ropencv_ruby.rb', line 243
def each(&block)
if block_given?
iter = self.begin()
while(iter != self.end())
yield(iter.to_node)
iter.plusplus_operator
end
else
to_enum(:each)
end
end
|
#empty ⇒ Bool
Note:
method wrapper for bool cv::FileNode::empty()
20499
20500
20501
20502
|
# File 'lib/ropencv/ropencv_types.rb', line 20499
def empty()
__validate_pointer__
Rbind::cv_file_node_empty( self)
end
|
#empty? ⇒ Object
236
|
# File 'lib/ropencv/ropencv_ruby.rb', line 236
alias :empty? :empty
|
Note:
method wrapper for const cv::FileNodeIterator cv::FileNode::end()
20441
20442
20443
20444
20445
20446
20447
20448
20449
|
# File 'lib/ropencv/ropencv_types.rb', line 20441
def end()
__validate_pointer__
result = Rbind::cv_file_node_end( self)
if result.respond_to?(:__owner__?) && !result.__owner__?
result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self)
end
result
end
|
#get_node(nodename) ⇒ Cv::FileNode
Also known as:
getNode
Note:
method wrapper for const cv::FileNode cv::FileNode::operator
20454
20455
20456
20457
20458
20459
20460
20461
20462
|
# File 'lib/ropencv/ropencv_types.rb', line 20454
def get_node(nodename)
__validate_pointer__
result = Rbind::cv_file_node_get_node( self, nodename)
if result.respond_to?(:__owner__?) && !result.__owner__?
result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self)
end
result
end
|
#is_int ⇒ Bool
Also known as:
isInt
Note:
method wrapper for bool cv::FileNode::isInt()
20530
20531
20532
20533
|
# File 'lib/ropencv/ropencv_types.rb', line 20530
def is_int()
__validate_pointer__
Rbind::cv_file_node_is_int( self)
end
|
#is_map ⇒ Bool
Also known as:
isMap
Note:
method wrapper for bool cv::FileNode::isMap()
20522
20523
20524
20525
|
# File 'lib/ropencv/ropencv_types.rb', line 20522
def is_map()
__validate_pointer__
Rbind::cv_file_node_is_map( self)
end
|
#is_named ⇒ Bool
Also known as:
isNamed
Note:
method wrapper for bool cv::FileNode::isNamed()
20554
20555
20556
20557
|
# File 'lib/ropencv/ropencv_types.rb', line 20554
def is_named()
__validate_pointer__
Rbind::cv_file_node_is_named( self)
end
|
#is_none ⇒ Bool
Also known as:
isNone
Note:
method wrapper for bool cv::FileNode::isNone()
20506
20507
20508
20509
|
# File 'lib/ropencv/ropencv_types.rb', line 20506
def is_none()
__validate_pointer__
Rbind::cv_file_node_is_none( self)
end
|
#is_real ⇒ Bool
Also known as:
isReal
Note:
method wrapper for bool cv::FileNode::isReal()
20538
20539
20540
20541
|
# File 'lib/ropencv/ropencv_types.rb', line 20538
def is_real()
__validate_pointer__
Rbind::cv_file_node_is_real( self)
end
|
#is_seq ⇒ Bool
Also known as:
isSeq
Note:
method wrapper for bool cv::FileNode::isSeq()
20514
20515
20516
20517
|
# File 'lib/ropencv/ropencv_types.rb', line 20514
def is_seq()
__validate_pointer__
Rbind::cv_file_node_is_seq( self)
end
|
#is_string ⇒ Bool
Also known as:
isString
Note:
method wrapper for bool cv::FileNode::isString()
20546
20547
20548
20549
|
# File 'lib/ropencv/ropencv_types.rb', line 20546
def is_string()
__validate_pointer__
Rbind::cv_file_node_is_string( self)
end
|
Note:
method wrapper for const std::vectorstd::string cv::FileNode::keys()
20480
20481
20482
20483
20484
20485
20486
20487
20488
|
# File 'lib/ropencv/ropencv_types.rb', line 20480
def keys()
__validate_pointer__
result = Rbind::cv_file_node_keys( self)
if result.respond_to?(:__owner__?) && !result.__owner__?
result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self)
end
result
end
|
Note:
method wrapper for const cv::Mat cv::FileNode::mat()
20608
20609
20610
20611
20612
20613
20614
20615
20616
|
# File 'lib/ropencv/ropencv_types.rb', line 20608
def mat()
__validate_pointer__
result = Rbind::cv_file_node_mat( self)
if result.respond_to?(:__owner__?) && !result.__owner__?
result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self)
end
result
end
|
Note:
method wrapper for const std::string cv::FileNode::name()
20562
20563
20564
20565
20566
20567
20568
20569
20570
|
# File 'lib/ropencv/ropencv_types.rb', line 20562
def name()
__validate_pointer__
result = Rbind::cv_file_node_name( self)
if result.respond_to?(:__owner__?) && !result.__owner__?
result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self)
end
result
end
|
#raw_size ⇒ Size_T
Also known as:
rawSize
Note:
method wrapper for size_t cv::FileNode::rawSize()
20581
20582
20583
20584
|
# File 'lib/ropencv/ropencv_types.rb', line 20581
def raw_size()
__validate_pointer__
Rbind::cv_file_node_raw_size( self)
end
|
#read_double(val) ⇒ Void
Note:
method wrapper for void cv::FileNode::operator>>(double& val)
20382
20383
20384
20385
|
# File 'lib/ropencv/ropencv_types.rb', line 20382
def read_double(val)
__validate_pointer__
Rbind::cv_file_node_read_double( self, val)
end
|
#read_float(val) ⇒ Void
Note:
method wrapper for void cv::FileNode::operator>>(float& val)
20374
20375
20376
20377
|
# File 'lib/ropencv/ropencv_types.rb', line 20374
def read_float(val)
__validate_pointer__
Rbind::cv_file_node_read_float( self, val)
end
|
#read_int(val) ⇒ Void
Note:
method wrapper for void cv::FileNode::operator>>(int& val)
methods
20366
20367
20368
20369
|
# File 'lib/ropencv/ropencv_types.rb', line 20366
def read_int(val)
__validate_pointer__
Rbind::cv_file_node_read_int( self, val)
end
|
#read_mat(val) ⇒ Void
Note:
method wrapper for void cv::FileNode::operator>>(cv::Mat& val)
20398
20399
20400
20401
|
# File 'lib/ropencv/ropencv_types.rb', line 20398
def read_mat(val)
__validate_pointer__
Rbind::cv_file_node_read_mat( self, val)
end
|
#read_string(val) ⇒ Void
Note:
method wrapper for void cv::FileNode::operator>>(std::string& val)
20390
20391
20392
20393
|
# File 'lib/ropencv/ropencv_types.rb', line 20390
def read_string(val)
__validate_pointer__
Rbind::cv_file_node_read_string( self, val)
end
|
#read_vector_keypoint(val) ⇒ Void
Note:
method wrapper for void cv::FileNode::operator>>(std::vectorcv::KeyPoint& val)
20422
20423
20424
20425
|
# File 'lib/ropencv/ropencv_types.rb', line 20422
def read_vector_keypoint(val)
__validate_pointer__
Rbind::cv_file_node_read_vector_keypoint( self, val)
end
|
#read_vector_mat(val) ⇒ Void
Note:
method wrapper for void cv::FileNode::operator>>(std::vectorcv::Mat& val)
20406
20407
20408
20409
|
# File 'lib/ropencv/ropencv_types.rb', line 20406
def read_vector_mat(val)
__validate_pointer__
Rbind::cv_file_node_read_vector_mat( self, val)
end
|
#read_vector_string(val) ⇒ Void
Note:
method wrapper for void cv::FileNode::operator>>(std::vectorstd::string& val)
20414
20415
20416
20417
|
# File 'lib/ropencv/ropencv_types.rb', line 20414
def read_vector_string(val)
__validate_pointer__
Rbind::cv_file_node_read_vector_string( self, val)
end
|
#real ⇒ Double
Note:
method wrapper for double cv::FileNode::real()
20589
20590
20591
20592
|
# File 'lib/ropencv/ropencv_types.rb', line 20589
def real()
__validate_pointer__
Rbind::cv_file_node_real( self)
end
|
#size ⇒ Size_T
Note:
method wrapper for size_t cv::FileNode::size()
20574
20575
20576
20577
|
# File 'lib/ropencv/ropencv_types.rb', line 20574
def size()
__validate_pointer__
Rbind::cv_file_node_size( self)
end
|
Note:
method wrapper for const std::string cv::FileNode::string()
20596
20597
20598
20599
20600
20601
20602
20603
20604
|
# File 'lib/ropencv/ropencv_types.rb', line 20596
def string()
__validate_pointer__
result = Rbind::cv_file_node_string( self)
if result.respond_to?(:__owner__?) && !result.__owner__?
result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self)
end
result
end
|
#to_array_of_double ⇒ Object
265
266
267
268
|
# File 'lib/ropencv/ropencv_ruby.rb', line 265
def to_array_of_double
raise RuntimeError, "FileNode is not the root node of a sequence" unless seq?
map(&:to_double)
end
|
#to_array_of_float ⇒ Object
260
261
262
263
|
# File 'lib/ropencv/ropencv_ruby.rb', line 260
def to_array_of_float
raise RuntimeError, "FileNode is not the root node of a sequence" unless seq?
map(&:to_float)
end
|
#to_array_of_int ⇒ Object
255
256
257
258
|
# File 'lib/ropencv/ropencv_ruby.rb', line 255
def to_array_of_int
raise RuntimeError, "FileNode is not the root node of a sequence" unless seq?
map(&:to_int)
end
|
#to_array_of_string ⇒ Object
270
271
272
273
|
# File 'lib/ropencv/ropencv_ruby.rb', line 270
def to_array_of_string
raise RuntimeError, "FileNode is not the root node of a sequence" unless seq?
map(&:to_string)
end
|
#to_double ⇒ Object
307
308
309
310
311
312
313
|
# File 'lib/ropencv/ropencv_ruby.rb', line 307
def to_double
raise RuntimeError, "FileNode is empty" if empty?
raise RuntimeError, "FileNode is not storing a double" unless isReal
p = FFI::MemoryPointer.new(:uchar,8)
read_double(p)
p.get_float64 0
end
|
#to_float ⇒ Object
299
300
301
302
303
304
305
|
# File 'lib/ropencv/ropencv_ruby.rb', line 299
def to_float
raise RuntimeError, "FileNode is empty" if empty?
raise RuntimeError, "FileNode is not storing a float" unless isReal
p = FFI::MemoryPointer.new(:float,1)
read_float(p)
p.get_float32 0
end
|
#to_int ⇒ Object
315
316
317
318
319
320
321
|
# File 'lib/ropencv/ropencv_ruby.rb', line 315
def to_int
raise RuntimeError, "FileNode is empty" if empty?
raise RuntimeError, "FileNode is not storing an int" unless isInt
p = FFI::MemoryPointer.new(:int,1)
read_int(p)
p.get_int32 0
end
|
#to_mat ⇒ Object
275
276
277
278
279
280
281
|
# File 'lib/ropencv/ropencv_ruby.rb', line 275
def to_mat
raise RuntimeError, "FileNode is empty" if empty?
raise RuntimeError, "FileNode is not storing a Mat" unless isMap
val = Cv::Mat.new
read_mat(val)
val
end
|
#to_s ⇒ Object
converts FileNode into a string by crawling through all its attributes
20341
20342
20343
|
# File 'lib/ropencv/ropencv_types.rb', line 20341
def to_s
"#<cv::FileNode >"
end
|
#to_string ⇒ Object
323
324
325
326
327
328
329
|
# File 'lib/ropencv/ropencv_ruby.rb', line 323
def to_string
raise RuntimeError, "FileNode is empty" if empty?
raise RuntimeError, "FileNode is not storing a string" unless isString
str = Cv::String.new
read_string(str)
str
end
|
#to_vector_keypoint ⇒ Object
331
332
333
334
335
336
337
|
# File 'lib/ropencv/ropencv_ruby.rb', line 331
def to_vector_keypoint
raise RuntimeError, "FileNode is empty" if empty?
raise RuntimeError, "FileNode is not storing a string" unless isSeq
val = Std::Vector.new(Cv::KeyPoint)
read_vector_keypoint(val)
val
end
|
#to_vector_mat ⇒ Object
283
284
285
286
287
288
289
|
# File 'lib/ropencv/ropencv_ruby.rb', line 283
def to_vector_mat
raise RuntimeError, "FileNode is empty" if empty?
raise RuntimeError, "FileNode is not storing a vector" unless isSeq
val = Std::Vector.new(Cv::Mat)
read_vector_mat(val)
val
end
|
#to_vector_string ⇒ Object
291
292
293
294
295
296
297
|
# File 'lib/ropencv/ropencv_ruby.rb', line 291
def to_vector_string
raise RuntimeError, "FileNode is empty" if empty?
raise RuntimeError, "FileNode is not storing a vector" unless isSeq
val = Std::Vector.new(Cv::String)
read_vector_string(val)
val
end
|
#type ⇒ Fixnum
Note:
method wrapper for int cv::FileNode::type()
20492
20493
20494
20495
|
# File 'lib/ropencv/ropencv_types.rb', line 20492
def type()
__validate_pointer__
Rbind::cv_file_node_type( self)
end
|