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
38845 38846 38847 38848 38849 38850 38851 38852 38853 38854 38855 38856 38857 38858 38859 38860 38861 38862 38863 38864 38865 38866 38867 38868 38869 38870 38871 38872 38873 38874 38875 38876 38877 38878 38879 |
# File 'lib/ropencv/ropencv_types.rb', line 38845 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_4i2_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_4i2_defaults1[i] end begin return Rbind::std_vector_cv_vec_4i_vector_cv_vec_4i2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
Instance Method Details
#<<(val) ⇒ Object
39106 39107 39108 39109 |
# File 'lib/ropencv/ropencv_types.rb', line 39106 def <<(val) push_back(val) self end |
#[](idx) ⇒ Cv::Vec4i
method wrapper for cv::Vec4i std::vectorcv::Vec4i::operator
39002 39003 39004 39005 39006 39007 39008 39009 39010 39011 |
# File 'lib/ropencv/ropencv_types.rb', line 39002 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)
39016 39017 39018 39019 39020 39021 39022 39023 39024 39025 |
# File 'lib/ropencv/ropencv_types.rb', line 39016 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()
39041 39042 39043 39044 39045 39046 39047 39048 39049 |
# File 'lib/ropencv/ropencv_types.rb', line 39041 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()
38979 38980 38981 38982 |
# File 'lib/ropencv/ropencv_types.rb', line 38979 def capacity() __validate_pointer__ Rbind::std_vector_cv_vec_4i_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vectorcv::Vec4i::clear()
38972 38973 38974 38975 |
# File 'lib/ropencv/ropencv_types.rb', line 38972 def clear() __validate_pointer__ Rbind::std_vector_cv_vec_4i_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vectorcv::Vec4i::data()
39053 39054 39055 39056 |
# File 'lib/ropencv/ropencv_types.rb', line 39053 def data() __validate_pointer__ Rbind::std_vector_cv_vec_4i_data( self) end |
#delete_if(&block) ⇒ Object
39110 39111 39112 39113 39114 39115 39116 39117 |
# File 'lib/ropencv/ropencv_types.rb', line 39110 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
39096 39097 39098 39099 39100 39101 39102 39103 39104 39105 |
# File 'lib/ropencv/ropencv_types.rb', line 39096 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()
38986 38987 38988 38989 |
# File 'lib/ropencv/ropencv_types.rb', line 38986 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()
39029 39030 39031 39032 39033 39034 39035 39036 39037 |
# File 'lib/ropencv/ropencv_types.rb', line 39029 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
39085 39086 39087 39088 39089 39090 39091 39092 39093 39094 |
# File 'lib/ropencv/ropencv_types.rb', line 39085 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()
39068 39069 39070 39071 |
# File 'lib/ropencv/ropencv_types.rb', line 39068 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)
39061 39062 39063 39064 |
# File 'lib/ropencv/ropencv_types.rb', line 39061 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)
38994 38995 38996 38997 |
# File 'lib/ropencv/ropencv_types.rb', line 38994 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
38958 38959 38960 38961 |
# File 'lib/ropencv/ropencv_types.rb', line 38958 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()
38965 38966 38967 38968 |
# File 'lib/ropencv/ropencv_types.rb', line 38965 def size() __validate_pointer__ Rbind::std_vector_cv_vec_4i_size( self) end |
#swap(other) ⇒ Void
39076 39077 39078 39079 |
# File 'lib/ropencv/ropencv_types.rb', line 39076 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
38945 38946 38947 |
# File 'lib/ropencv/ropencv_types.rb', line 38945 def to_s "#<std::vector<cv::Vec4i> >" end |
#validate_index(idx) ⇒ Object
39091 39092 39093 39094 39095 |
# File 'lib/ropencv/ropencv_types.rb', line 39091 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |