Class: OpenCV::Std::Vector::Cv_Vec4i
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Cv_Vec4i
- Extended by:
- FFI::DataConverter
- Includes:
- Enumerable
- Defined in:
- lib/ropencv/ropencv_types.rb
Class Method Summary collapse
- .new(*args) ⇒ Object
-
.null ⇒ Object
returns a null pointer to the object.
Instance Method Summary collapse
- #<<(val) ⇒ Object
- #[](idx) ⇒ Cv::Vec4i
- #at(size) ⇒ Cv::Vec4i
- #back ⇒ Cv::Vec4i
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Cv::Vec4i
- #get_element ⇒ Cv::Vec4i
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Cv::Vec4i.new()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Cv_Vec4i into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
87470 87471 87472 87473 87474 87475 87476 87477 87478 87479 87480 87481 87482 87483 87484 87485 87486 87487 87488 87489 87490 87491 87492 87493 87494 87495 87496 87497 87498 87499 87500 87501 87502 87503 87504 |
# File 'lib/ropencv/ropencv_types.rb', line 87470 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Cv_Vec4iStruct) 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::Vec4i>::vector<cv::Vec4i>() @@std_vector_cv_vec_4i_vector_cv_vec_4i_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_cv_vec_4i_vector_cv_vec_4i_defaults0[i] end begin return Rbind::std_vector_cv_vec_4i_vector_cv_vec_4i(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<cv::Vec4i>::vector<cv::Vec4i>(std::vector<cv::Vec4i> other) @@std_vector_cv_vec_4i_vector_cv_vec_4i__2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_cv_vec_4i_vector_cv_vec_4i__2_defaults1[i] end begin return Rbind::std_vector_cv_vec_4i_vector_cv_vec_4i__2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
87462 87463 87464 |
# File 'lib/ropencv/ropencv_types.rb', line 87462 def self.null new(Vector::Cv_Vec4iStruct.new) end |
Instance Method Details
#<<(val) ⇒ Object
87731 87732 87733 87734 |
# File 'lib/ropencv/ropencv_types.rb', line 87731 def <<(val) push_back(val) self end |
#[](idx) ⇒ Cv::Vec4i
method wrapper for cv::Vec4i std::vectorcv::Vec4i::operator
87627 87628 87629 87630 87631 87632 87633 87634 87635 87636 |
# File 'lib/ropencv/ropencv_types.rb', line 87627 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_vec_4i_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::Vec4i
method wrapper for cv::Vec4i std::vectorcv::Vec4i::at(size_t size)
87641 87642 87643 87644 87645 87646 87647 87648 87649 87650 |
# File 'lib/ropencv/ropencv_types.rb', line 87641 def at(size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_vec_4i_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 |
#back ⇒ Cv::Vec4i
method wrapper for cv::Vec4i std::vectorcv::Vec4i::back()
87666 87667 87668 87669 87670 87671 87672 87673 87674 |
# File 'lib/ropencv/ropencv_types.rb', line 87666 def back() __validate_pointer__ result = Rbind::std_vector_cv_vec_4i_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 |
#capacity ⇒ Size_T
method wrapper for size_t std::vectorcv::Vec4i::capacity()
87604 87605 87606 87607 |
# File 'lib/ropencv/ropencv_types.rb', line 87604 def capacity() __validate_pointer__ Rbind::std_vector_cv_vec_4i_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vectorcv::Vec4i::clear()
87597 87598 87599 87600 |
# File 'lib/ropencv/ropencv_types.rb', line 87597 def clear() __validate_pointer__ Rbind::std_vector_cv_vec_4i_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vectorcv::Vec4i::data()
87678 87679 87680 87681 |
# File 'lib/ropencv/ropencv_types.rb', line 87678 def data() __validate_pointer__ Rbind::std_vector_cv_vec_4i_data( self) end |
#delete_if(&block) ⇒ Object
87735 87736 87737 87738 87739 87740 87741 87742 |
# File 'lib/ropencv/ropencv_types.rb', line 87735 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
87721 87722 87723 87724 87725 87726 87727 87728 87729 87730 |
# File 'lib/ropencv/ropencv_types.rb', line 87721 def each(&block) if block s = size 0.upto(s-1) do |i| yield self[i] end else Enumerator.new(self) end end |
#empty ⇒ Bool
method wrapper for bool std::vectorcv::Vec4i::empty()
87611 87612 87613 87614 |
# File 'lib/ropencv/ropencv_types.rb', line 87611 def empty() __validate_pointer__ Rbind::std_vector_cv_vec_4i_empty( self) end |
#front ⇒ Cv::Vec4i
method wrapper for cv::Vec4i std::vectorcv::Vec4i::front()
87654 87655 87656 87657 87658 87659 87660 87661 87662 |
# File 'lib/ropencv/ropencv_types.rb', line 87654 def front() __validate_pointer__ result = Rbind::std_vector_cv_vec_4i_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_element ⇒ Cv::Vec4i
method wrapper for cv::Vec4i std::vectorcv::Vec4i::operator
87710 87711 87712 87713 87714 87715 87716 87717 87718 87719 |
# File 'lib/ropencv/ropencv_types.rb', line 87710 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_vec_4i_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_back ⇒ Void
method wrapper for void std::vectorcv::Vec4i::pop_back()
87693 87694 87695 87696 |
# File 'lib/ropencv/ropencv_types.rb', line 87693 def pop_back() __validate_pointer__ Rbind::std_vector_cv_vec_4i_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vectorcv::Vec4i::push_back(cv::Vec4i other)
87686 87687 87688 87689 |
# File 'lib/ropencv/ropencv_types.rb', line 87686 def push_back(other) __validate_pointer__ Rbind::std_vector_cv_vec_4i_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vectorcv::Vec4i::reserve(size_t size)
87619 87620 87621 87622 |
# File 'lib/ropencv/ropencv_types.rb', line 87619 def reserve(size) __validate_pointer__ Rbind::std_vector_cv_vec_4i_reserve( self, size) end |
#resize(size, val = Cv::Vec4i.new()) ⇒ Void
method wrapper for void std::vectorcv::Vec4i::resize(size_t size, cv::Vec4i val = cv::Vec4i())
methods
87583 87584 87585 87586 |
# File 'lib/ropencv/ropencv_types.rb', line 87583 def resize(size, val = Cv::Vec4i.new()) __validate_pointer__ Rbind::std_vector_cv_vec_4i_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vectorcv::Vec4i::size()
87590 87591 87592 87593 |
# File 'lib/ropencv/ropencv_types.rb', line 87590 def size() __validate_pointer__ Rbind::std_vector_cv_vec_4i_size( self) end |
#swap(other) ⇒ Void
87701 87702 87703 87704 |
# File 'lib/ropencv/ropencv_types.rb', line 87701 def swap(other) __validate_pointer__ Rbind::std_vector_cv_vec_4i_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Cv_Vec4i into a string by crawling through all its attributes
87570 87571 87572 |
# File 'lib/ropencv/ropencv_types.rb', line 87570 def to_s "#<std::vector<cv::Vec4i> >" end |
#validate_index(idx) ⇒ Object
87716 87717 87718 87719 87720 |
# File 'lib/ropencv/ropencv_types.rb', line 87716 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |