Class: OpenCV::Std::Vector::Cv_DMatch

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Includes:
Enumerable
Defined in:
lib/ropencv/ropencv_types.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.vectorObject .vectorObject

Overloads:

Raises:

  • (ArgumentError)


84320
84321
84322
84323
84324
84325
84326
84327
84328
84329
84330
84331
84332
84333
84334
84335
84336
84337
84338
84339
84340
84341
84342
84343
84344
84345
84346
84347
84348
84349
84350
84351
84352
84353
84354
# File 'lib/ropencv/ropencv_types.rb', line 84320

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Cv_DMatchStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # overloaded method wrapper for std::vector<cv::DMatch>::vector<cv::DMatch>()
    @@std_vector_cv_d_match_vector_cv_d_match_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        targs = args.clone
        targs.size.upto(-1) do |i|
            targs[i] = @@std_vector_cv_d_match_vector_cv_d_match_defaults0[i]
        end
        begin
                return Rbind::std_vector_cv_d_match_vector_cv_d_match(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for std::vector<cv::DMatch>::vector<cv::DMatch>(std::vector<cv::DMatch> other)
    @@std_vector_cv_d_match_vector_cv_d_match__2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@std_vector_cv_d_match_vector_cv_d_match__2_defaults1[i]
        end
        begin
                return Rbind::std_vector_cv_d_match_vector_cv_d_match__2(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end

.nullObject

returns a null pointer to the object



84312
84313
84314
# File 'lib/ropencv/ropencv_types.rb', line 84312

def self.null
    new(Vector::Cv_DMatchStruct.new)
end

Instance Method Details

#<<(val) ⇒ Object



84581
84582
84583
84584
# File 'lib/ropencv/ropencv_types.rb', line 84581

def <<(val)
    push_back(val)
    self
end

#[](idx) ⇒ Cv::DMatch

Note:

method wrapper for cv::DMatch std::vectorcv::DMatch::operator

Parameters:

  • size (Size_T)

Returns:



84477
84478
84479
84480
84481
84482
84483
84484
84485
84486
# File 'lib/ropencv/ropencv_types.rb', line 84477

def [](size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_cv_d_match_operator_array( self, size)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#at(size) ⇒ Cv::DMatch

Note:

method wrapper for cv::DMatch std::vectorcv::DMatch::at(size_t size)

Parameters:

  • size (Size_T)

Returns:



84491
84492
84493
84494
84495
84496
84497
84498
84499
84500
# File 'lib/ropencv/ropencv_types.rb', line 84491

def at(size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_cv_d_match_at( self, size)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#backCv::DMatch

Note:

method wrapper for cv::DMatch std::vectorcv::DMatch::back()

Returns:



84516
84517
84518
84519
84520
84521
84522
84523
84524
# File 'lib/ropencv/ropencv_types.rb', line 84516

def back()
    __validate_pointer__
    result = Rbind::std_vector_cv_d_match_back( self)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#capacitySize_T

Note:

method wrapper for size_t std::vectorcv::DMatch::capacity()

Returns:

  • (Size_T)


84454
84455
84456
84457
# File 'lib/ropencv/ropencv_types.rb', line 84454

def capacity()
    __validate_pointer__
    Rbind::std_vector_cv_d_match_capacity( self)
end

#clearVoid

Note:

method wrapper for void std::vectorcv::DMatch::clear()

Returns:

  • (Void)


84447
84448
84449
84450
# File 'lib/ropencv/ropencv_types.rb', line 84447

def clear()
    __validate_pointer__
    Rbind::std_vector_cv_d_match_clear( self)
end

#dataVoid

Note:

method wrapper for void* std::vectorcv::DMatch::data()

Returns:

  • (Void)


84528
84529
84530
84531
# File 'lib/ropencv/ropencv_types.rb', line 84528

def data()
    __validate_pointer__
    Rbind::std_vector_cv_d_match_data( self)
end

#delete_if(&block) ⇒ Object



84585
84586
84587
84588
84589
84590
84591
84592
# File 'lib/ropencv/ropencv_types.rb', line 84585

def delete_if(&block)
    v = self.class.new
    each do |i|
         v << i if !yield(i)
    end
    v.swap(self)
    self
end

#each(&block) ⇒ Object



84571
84572
84573
84574
84575
84576
84577
84578
84579
84580
# File 'lib/ropencv/ropencv_types.rb', line 84571

def each(&block)
    if block
         s = size
         0.upto(s-1) do |i|
             yield self[i]
         end
    else
        Enumerator.new(self)
    end
end

#emptyBool

Note:

method wrapper for bool std::vectorcv::DMatch::empty()

Returns:

  • (Bool)


84461
84462
84463
84464
# File 'lib/ropencv/ropencv_types.rb', line 84461

def empty()
    __validate_pointer__
    Rbind::std_vector_cv_d_match_empty( self)
end

#frontCv::DMatch

Note:

method wrapper for cv::DMatch std::vectorcv::DMatch::front()

Returns:



84504
84505
84506
84507
84508
84509
84510
84511
84512
# File 'lib/ropencv/ropencv_types.rb', line 84504

def front()
    __validate_pointer__
    result = Rbind::std_vector_cv_d_match_front( self)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#get_elementCv::DMatch

Note:

method wrapper for cv::DMatch std::vectorcv::DMatch::operator

Parameters:

  • size (Size_T)

Returns:



84560
84561
84562
84563
84564
84565
84566
84567
84568
84569
# File 'lib/ropencv/ropencv_types.rb', line 84560

def [](size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_cv_d_match_operator_array( self, size)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#pop_backVoid

Note:

method wrapper for void std::vectorcv::DMatch::pop_back()

Returns:

  • (Void)


84543
84544
84545
84546
# File 'lib/ropencv/ropencv_types.rb', line 84543

def pop_back()
    __validate_pointer__
    Rbind::std_vector_cv_d_match_pop_back( self)
end

#push_back(other) ⇒ Void

Note:

method wrapper for void std::vectorcv::DMatch::push_back(cv::DMatch other)

Parameters:

Returns:

  • (Void)


84536
84537
84538
84539
# File 'lib/ropencv/ropencv_types.rb', line 84536

def push_back(other)
    __validate_pointer__
    Rbind::std_vector_cv_d_match_push_back( self, other)
end

#reserve(size) ⇒ Void

Note:

method wrapper for void std::vectorcv::DMatch::reserve(size_t size)

Parameters:

  • size (Size_T)

Returns:

  • (Void)


84469
84470
84471
84472
# File 'lib/ropencv/ropencv_types.rb', line 84469

def reserve(size)
    __validate_pointer__
    Rbind::std_vector_cv_d_match_reserve( self, size)
end

#resize(size, val = Cv::DMatch.new()) ⇒ Void

Note:

method wrapper for void std::vectorcv::DMatch::resize(size_t size, cv::DMatch val = cv::DMatch())

methods

Parameters:

  • size (Size_T)
  • val (Cv::DMatch) (defaults to: Cv::DMatch.new())

Returns:

  • (Void)


84433
84434
84435
84436
# File 'lib/ropencv/ropencv_types.rb', line 84433

def resize(size, val = Cv::DMatch.new())
    __validate_pointer__
    Rbind::std_vector_cv_d_match_resize( self, size, val)
end

#sizeSize_T

Note:

method wrapper for size_t std::vectorcv::DMatch::size()

Returns:

  • (Size_T)


84440
84441
84442
84443
# File 'lib/ropencv/ropencv_types.rb', line 84440

def size()
    __validate_pointer__
    Rbind::std_vector_cv_d_match_size( self)
end

#swap(other) ⇒ Void

Note:

method wrapper for void std::vectorcv::DMatch::swap(std::vectorcv::DMatch other)

Parameters:

Returns:

  • (Void)


84551
84552
84553
84554
# File 'lib/ropencv/ropencv_types.rb', line 84551

def swap(other)
    __validate_pointer__
    Rbind::std_vector_cv_d_match_swap( self, other)
end

#to_sObject

converts Vector::Cv_DMatch into a string by crawling through all its attributes



84420
84421
84422
# File 'lib/ropencv/ropencv_types.rb', line 84420

def to_s
    "#<std::vector<cv::DMatch> >"
end

#validate_index(idx) ⇒ Object



84566
84567
84568
84569
84570
# File 'lib/ropencv/ropencv_types.rb', line 84566

def validate_index(idx)
    if idx < 0 || idx >= size
        raise RangeError,"#{idx} is out of range [0..#{size-1}]"
    end
end