Class: OpenCV::Std::Vector::Cv_KeyPoint

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)


35715
35716
35717
35718
35719
35720
35721
35722
35723
35724
35725
35726
35727
35728
35729
35730
35731
35732
35733
35734
35735
35736
35737
35738
35739
35740
35741
35742
35743
35744
35745
35746
35747
35748
35749
# File 'lib/ropencv/ropencv_types.rb', line 35715

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Cv_KeyPointStruct)
        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::KeyPoint>::vector<cv::KeyPoint>()
    @@std_vector_cv_key_point_vector_cv_key_point_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        targs = args.clone
        targs.size.upto(-1) do |i|
            targs[i] = @@std_vector_cv_key_point_vector_cv_key_point_defaults0[i]
        end
        begin
                return Rbind::std_vector_cv_key_point_vector_cv_key_point(*targs)
        rescue TypeError => e
            @error = e
        end
    end

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



35707
35708
35709
# File 'lib/ropencv/ropencv_types.rb', line 35707

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

Instance Method Details

#<<(val) ⇒ Object



35976
35977
35978
35979
# File 'lib/ropencv/ropencv_types.rb', line 35976

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

#[](idx) ⇒ Cv::KeyPoint

Note:

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

Parameters:

  • size (Size_T)

Returns:



35872
35873
35874
35875
35876
35877
35878
35879
35880
35881
# File 'lib/ropencv/ropencv_types.rb', line 35872

def [](size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_cv_key_point_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::KeyPoint

Note:

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

Parameters:

  • size (Size_T)

Returns:



35886
35887
35888
35889
35890
35891
35892
35893
35894
35895
# File 'lib/ropencv/ropencv_types.rb', line 35886

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

Note:

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

Returns:



35911
35912
35913
35914
35915
35916
35917
35918
35919
# File 'lib/ropencv/ropencv_types.rb', line 35911

def back()
    __validate_pointer__
    result = Rbind::std_vector_cv_key_point_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::KeyPoint::capacity()

Returns:

  • (Size_T)


35849
35850
35851
35852
# File 'lib/ropencv/ropencv_types.rb', line 35849

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

#clearVoid

Note:

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

Returns:

  • (Void)


35842
35843
35844
35845
# File 'lib/ropencv/ropencv_types.rb', line 35842

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

#dataVoid

Note:

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

Returns:

  • (Void)


35923
35924
35925
35926
# File 'lib/ropencv/ropencv_types.rb', line 35923

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

#delete_if(&block) ⇒ Object



35980
35981
35982
35983
35984
35985
35986
35987
# File 'lib/ropencv/ropencv_types.rb', line 35980

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



35966
35967
35968
35969
35970
35971
35972
35973
35974
35975
# File 'lib/ropencv/ropencv_types.rb', line 35966

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::KeyPoint::empty()

Returns:

  • (Bool)


35856
35857
35858
35859
# File 'lib/ropencv/ropencv_types.rb', line 35856

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

#frontCv::KeyPoint

Note:

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

Returns:



35899
35900
35901
35902
35903
35904
35905
35906
35907
# File 'lib/ropencv/ropencv_types.rb', line 35899

def front()
    __validate_pointer__
    result = Rbind::std_vector_cv_key_point_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::KeyPoint

Note:

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

Parameters:

  • size (Size_T)

Returns:



35955
35956
35957
35958
35959
35960
35961
35962
35963
35964
# File 'lib/ropencv/ropencv_types.rb', line 35955

def [](size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_cv_key_point_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::KeyPoint::pop_back()

Returns:

  • (Void)


35938
35939
35940
35941
# File 'lib/ropencv/ropencv_types.rb', line 35938

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

#push_back(other) ⇒ Void

Note:

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

Parameters:

Returns:

  • (Void)


35931
35932
35933
35934
# File 'lib/ropencv/ropencv_types.rb', line 35931

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

#reserve(size) ⇒ Void

Note:

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

Parameters:

  • size (Size_T)

Returns:

  • (Void)


35864
35865
35866
35867
# File 'lib/ropencv/ropencv_types.rb', line 35864

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

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

Note:

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

methods

Parameters:

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

Returns:

  • (Void)


35828
35829
35830
35831
# File 'lib/ropencv/ropencv_types.rb', line 35828

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

#sizeSize_T

Note:

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

Returns:

  • (Size_T)


35835
35836
35837
35838
# File 'lib/ropencv/ropencv_types.rb', line 35835

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

#swap(other) ⇒ Void

Note:

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

Parameters:

Returns:

  • (Void)


35946
35947
35948
35949
# File 'lib/ropencv/ropencv_types.rb', line 35946

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

#to_sObject

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



35815
35816
35817
# File 'lib/ropencv/ropencv_types.rb', line 35815

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

#validate_index(idx) ⇒ Object



35961
35962
35963
35964
35965
# File 'lib/ropencv/ropencv_types.rb', line 35961

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