Class: OpenCV::Std::Vector::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)


36672
36673
36674
36675
36676
36677
36678
36679
36680
36681
36682
36683
36684
36685
36686
36687
36688
36689
36690
36691
36692
36693
36694
36695
36696
36697
36698
36699
36700
36701
36702
36703
36704
36705
36706
# File 'lib/ropencv/ropencv_types.rb', line 36672

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Std_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<std::vector<cv::DMatch>>::vector<std::vector<cv::DMatch>>()
    @@std_vector_std_vector_cv_d_match_vector_std_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_std_vector_cv_d_match_vector_std_vector_cv_d_match_defaults0[i]
        end
        begin
                return Rbind::std_vector_std_vector_cv_d_match_vector_std_vector_cv_d_match(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for std::vector<std::vector<cv::DMatch>>::vector<std::vector<cv::DMatch>>(std::vector<std::vector<cv::DMatch>> other)
    @@std_vector_std_vector_cv_d_match_vector_std_vector_cv_d_match2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@std_vector_std_vector_cv_d_match_vector_std_vector_cv_d_match2_defaults1[i]
        end
        begin
                return Rbind::std_vector_std_vector_cv_d_match_vector_std_vector_cv_d_match2(*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



36664
36665
36666
# File 'lib/ropencv/ropencv_types.rb', line 36664

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

Instance Method Details

#<<(val) ⇒ Object



36933
36934
36935
36936
# File 'lib/ropencv/ropencv_types.rb', line 36933

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

#[](idx) ⇒ Std::Vector::Cv_DMatch

Note:

method wrapper for std::vectorcv::DMatch std::vectorstd::vector<cv::DMatch>::operator

Parameters:

  • size (Size_T)

Returns:



36829
36830
36831
36832
36833
36834
36835
36836
36837
36838
# File 'lib/ropencv/ropencv_types.rb', line 36829

def [](size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_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) ⇒ Std::Vector::Cv_DMatch

Note:

method wrapper for std::vectorcv::DMatch std::vectorstd::vector<cv::DMatch>::at(size_t size)

Parameters:

  • size (Size_T)

Returns:



36843
36844
36845
36846
36847
36848
36849
36850
36851
36852
# File 'lib/ropencv/ropencv_types.rb', line 36843

def at(size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_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

#backStd::Vector::Cv_DMatch

Note:

method wrapper for std::vectorcv::DMatch std::vectorstd::vector<cv::DMatch>::back()



36868
36869
36870
36871
36872
36873
36874
36875
36876
# File 'lib/ropencv/ropencv_types.rb', line 36868

def back()
    __validate_pointer__
    result = Rbind::std_vector_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::vectorstd::vector<cv::DMatch>::capacity()

Returns:

  • (Size_T)


36806
36807
36808
36809
# File 'lib/ropencv/ropencv_types.rb', line 36806

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

#clearVoid

Note:

method wrapper for void std::vectorstd::vector<cv::DMatch>::clear()

Returns:

  • (Void)


36799
36800
36801
36802
# File 'lib/ropencv/ropencv_types.rb', line 36799

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

#dataVoid

Note:

method wrapper for void* std::vectorstd::vector<cv::DMatch>::data()

Returns:

  • (Void)


36880
36881
36882
36883
# File 'lib/ropencv/ropencv_types.rb', line 36880

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

#delete_if(&block) ⇒ Object



36937
36938
36939
36940
36941
36942
36943
36944
# File 'lib/ropencv/ropencv_types.rb', line 36937

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



36923
36924
36925
36926
36927
36928
36929
36930
36931
36932
# File 'lib/ropencv/ropencv_types.rb', line 36923

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::vectorstd::vector<cv::DMatch>::empty()

Returns:

  • (Bool)


36813
36814
36815
36816
# File 'lib/ropencv/ropencv_types.rb', line 36813

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

#frontStd::Vector::Cv_DMatch

Note:

method wrapper for std::vectorcv::DMatch std::vectorstd::vector<cv::DMatch>::front()



36856
36857
36858
36859
36860
36861
36862
36863
36864
# File 'lib/ropencv/ropencv_types.rb', line 36856

def front()
    __validate_pointer__
    result = Rbind::std_vector_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_elementStd::Vector::Cv_DMatch

Note:

method wrapper for std::vectorcv::DMatch std::vectorstd::vector<cv::DMatch>::operator

Parameters:

  • size (Size_T)

Returns:



36912
36913
36914
36915
36916
36917
36918
36919
36920
36921
# File 'lib/ropencv/ropencv_types.rb', line 36912

def [](size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_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::vectorstd::vector<cv::DMatch>::pop_back()

Returns:

  • (Void)


36895
36896
36897
36898
# File 'lib/ropencv/ropencv_types.rb', line 36895

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

#push_back(other) ⇒ Void

Note:

method wrapper for void std::vectorstd::vector<cv::DMatch>::push_back(std::vectorcv::DMatch other)

Parameters:

Returns:

  • (Void)


36888
36889
36890
36891
# File 'lib/ropencv/ropencv_types.rb', line 36888

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

#reserve(size) ⇒ Void

Note:

method wrapper for void std::vectorstd::vector<cv::DMatch>::reserve(size_t size)

Parameters:

  • size (Size_T)

Returns:

  • (Void)


36821
36822
36823
36824
# File 'lib/ropencv/ropencv_types.rb', line 36821

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

#resize(size, val = Std::Vector::Cv_DMatch.new()) ⇒ Void

Note:

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

methods

Parameters:

Returns:

  • (Void)


36785
36786
36787
36788
# File 'lib/ropencv/ropencv_types.rb', line 36785

def resize(size, val = Std::Vector::Cv_DMatch.new())
    __validate_pointer__
    Rbind::std_vector_std_vector_cv_d_match_resize( self, size, val)
end

#sizeSize_T

Note:

method wrapper for size_t std::vectorstd::vector<cv::DMatch>::size()

Returns:

  • (Size_T)


36792
36793
36794
36795
# File 'lib/ropencv/ropencv_types.rb', line 36792

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

#swap(other) ⇒ Void

Note:

method wrapper for void std::vectorstd::vector<cv::DMatch>::swap(std::vectorstd::vector<cv::DMatch> other)

Parameters:

Returns:

  • (Void)


36903
36904
36905
36906
# File 'lib/ropencv/ropencv_types.rb', line 36903

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

#to_sObject

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



36772
36773
36774
# File 'lib/ropencv/ropencv_types.rb', line 36772

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

#validate_index(idx) ⇒ Object



36918
36919
36920
36921
36922
# File 'lib/ropencv/ropencv_types.rb', line 36918

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