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)


81489
81490
81491
81492
81493
81494
81495
81496
81497
81498
81499
81500
81501
81502
81503
81504
81505
81506
81507
81508
81509
81510
81511
81512
81513
81514
81515
81516
81517
81518
81519
81520
81521
81522
81523
# File 'lib/ropencv/ropencv_types.rb', line 81489

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_point__2_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_point__2_defaults1[i]
        end
        begin
                return Rbind::std_vector_cv_key_point_vector_cv_key_point__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



81481
81482
81483
# File 'lib/ropencv/ropencv_types.rb', line 81481

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

Instance Method Details

#<<(val) ⇒ Object



81750
81751
81752
81753
# File 'lib/ropencv/ropencv_types.rb', line 81750

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:



81646
81647
81648
81649
81650
81651
81652
81653
81654
81655
# File 'lib/ropencv/ropencv_types.rb', line 81646

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:



81660
81661
81662
81663
81664
81665
81666
81667
81668
81669
# File 'lib/ropencv/ropencv_types.rb', line 81660

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:



81685
81686
81687
81688
81689
81690
81691
81692
81693
# File 'lib/ropencv/ropencv_types.rb', line 81685

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)


81623
81624
81625
81626
# File 'lib/ropencv/ropencv_types.rb', line 81623

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)


81616
81617
81618
81619
# File 'lib/ropencv/ropencv_types.rb', line 81616

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)


81697
81698
81699
81700
# File 'lib/ropencv/ropencv_types.rb', line 81697

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

#delete_if(&block) ⇒ Object



81754
81755
81756
81757
81758
81759
81760
81761
# File 'lib/ropencv/ropencv_types.rb', line 81754

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



81740
81741
81742
81743
81744
81745
81746
81747
81748
81749
# File 'lib/ropencv/ropencv_types.rb', line 81740

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)


81630
81631
81632
81633
# File 'lib/ropencv/ropencv_types.rb', line 81630

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:



81673
81674
81675
81676
81677
81678
81679
81680
81681
# File 'lib/ropencv/ropencv_types.rb', line 81673

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:



81729
81730
81731
81732
81733
81734
81735
81736
81737
81738
# File 'lib/ropencv/ropencv_types.rb', line 81729

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)


81712
81713
81714
81715
# File 'lib/ropencv/ropencv_types.rb', line 81712

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)


81705
81706
81707
81708
# File 'lib/ropencv/ropencv_types.rb', line 81705

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)


81638
81639
81640
81641
# File 'lib/ropencv/ropencv_types.rb', line 81638

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)


81602
81603
81604
81605
# File 'lib/ropencv/ropencv_types.rb', line 81602

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)


81609
81610
81611
81612
# File 'lib/ropencv/ropencv_types.rb', line 81609

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)


81720
81721
81722
81723
# File 'lib/ropencv/ropencv_types.rb', line 81720

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



81589
81590
81591
# File 'lib/ropencv/ropencv_types.rb', line 81589

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

#validate_index(idx) ⇒ Object



81735
81736
81737
81738
81739
# File 'lib/ropencv/ropencv_types.rb', line 81735

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