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)


36353
36354
36355
36356
36357
36358
36359
36360
36361
36362
36363
36364
36365
36366
36367
36368
36369
36370
36371
36372
36373
36374
36375
36376
36377
36378
36379
36380
36381
36382
36383
36384
36385
36386
36387
# File 'lib/ropencv/ropencv_types.rb', line 36353

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_match2_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_match2_defaults1[i]
        end
        begin
                return Rbind::std_vector_cv_d_match_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



36345
36346
36347
# File 'lib/ropencv/ropencv_types.rb', line 36345

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

Instance Method Details

#<<(val) ⇒ Object



36614
36615
36616
36617
# File 'lib/ropencv/ropencv_types.rb', line 36614

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:



36510
36511
36512
36513
36514
36515
36516
36517
36518
36519
# File 'lib/ropencv/ropencv_types.rb', line 36510

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:



36524
36525
36526
36527
36528
36529
36530
36531
36532
36533
# File 'lib/ropencv/ropencv_types.rb', line 36524

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:



36549
36550
36551
36552
36553
36554
36555
36556
36557
# File 'lib/ropencv/ropencv_types.rb', line 36549

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)


36487
36488
36489
36490
# File 'lib/ropencv/ropencv_types.rb', line 36487

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)


36480
36481
36482
36483
# File 'lib/ropencv/ropencv_types.rb', line 36480

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)


36561
36562
36563
36564
# File 'lib/ropencv/ropencv_types.rb', line 36561

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

#delete_if(&block) ⇒ Object



36618
36619
36620
36621
36622
36623
36624
36625
# File 'lib/ropencv/ropencv_types.rb', line 36618

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



36604
36605
36606
36607
36608
36609
36610
36611
36612
36613
# File 'lib/ropencv/ropencv_types.rb', line 36604

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)


36494
36495
36496
36497
# File 'lib/ropencv/ropencv_types.rb', line 36494

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:



36537
36538
36539
36540
36541
36542
36543
36544
36545
# File 'lib/ropencv/ropencv_types.rb', line 36537

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:



36593
36594
36595
36596
36597
36598
36599
36600
36601
36602
# File 'lib/ropencv/ropencv_types.rb', line 36593

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)


36576
36577
36578
36579
# File 'lib/ropencv/ropencv_types.rb', line 36576

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)


36569
36570
36571
36572
# File 'lib/ropencv/ropencv_types.rb', line 36569

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)


36502
36503
36504
36505
# File 'lib/ropencv/ropencv_types.rb', line 36502

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)


36466
36467
36468
36469
# File 'lib/ropencv/ropencv_types.rb', line 36466

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)


36473
36474
36475
36476
# File 'lib/ropencv/ropencv_types.rb', line 36473

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)


36584
36585
36586
36587
# File 'lib/ropencv/ropencv_types.rb', line 36584

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



36453
36454
36455
# File 'lib/ropencv/ropencv_types.rb', line 36453

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

#validate_index(idx) ⇒ Object



36599
36600
36601
36602
36603
# File 'lib/ropencv/ropencv_types.rb', line 36599

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