Class: OpenCV::Std::Vector::Std_Vector_Cv_Point
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Std_Vector_Cv_Point
- 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) ⇒ Std::Vector::Cv_Point
- #at(size) ⇒ Std::Vector::Cv_Point
- #back ⇒ Std::Vector::Cv_Point
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Std::Vector::Cv_Point
- #get_element ⇒ Std::Vector::Cv_Point
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Std::Vector::Cv_Point.new()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Std_Vector_Cv_Point into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
84001 84002 84003 84004 84005 84006 84007 84008 84009 84010 84011 84012 84013 84014 84015 84016 84017 84018 84019 84020 84021 84022 84023 84024 84025 84026 84027 84028 84029 84030 84031 84032 84033 84034 84035 |
# File 'lib/ropencv/ropencv_types.rb', line 84001 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Std_Vector_Cv_PointStruct) 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<std::vector<cv::Point>>::vector<std::vector<cv::Point>>() @@std_vector_std_vector_cv_point_vector_std_vector_cv_point_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_std_vector_cv_point_vector_std_vector_cv_point_defaults0[i] end begin return Rbind::std_vector_std_vector_cv_point_vector_std_vector_cv_point(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<std::vector<cv::Point>>::vector<std::vector<cv::Point>>(std::vector<std::vector<cv::Point>> other) @@std_vector_std_vector_cv_point_vector_std_vector_cv_point__2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_std_vector_cv_point_vector_std_vector_cv_point__2_defaults1[i] end begin return Rbind::std_vector_std_vector_cv_point_vector_std_vector_cv_point__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
83993 83994 83995 |
# File 'lib/ropencv/ropencv_types.rb', line 83993 def self.null new(Vector::Std_Vector_Cv_PointStruct.new) end |
Instance Method Details
#<<(val) ⇒ Object
84262 84263 84264 84265 |
# File 'lib/ropencv/ropencv_types.rb', line 84262 def <<(val) push_back(val) self end |
#[](idx) ⇒ Std::Vector::Cv_Point
method wrapper for std::vectorcv::Point std::vectorstd::vector<cv::Point>::operator
84158 84159 84160 84161 84162 84163 84164 84165 84166 84167 |
# File 'lib/ropencv/ropencv_types.rb', line 84158 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_std_vector_cv_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) ⇒ Std::Vector::Cv_Point
method wrapper for std::vectorcv::Point std::vectorstd::vector<cv::Point>::at(size_t size)
84172 84173 84174 84175 84176 84177 84178 84179 84180 84181 |
# File 'lib/ropencv/ropencv_types.rb', line 84172 def at(size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_std_vector_cv_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 |
#back ⇒ Std::Vector::Cv_Point
method wrapper for std::vectorcv::Point std::vectorstd::vector<cv::Point>::back()
84197 84198 84199 84200 84201 84202 84203 84204 84205 |
# File 'lib/ropencv/ropencv_types.rb', line 84197 def back() __validate_pointer__ result = Rbind::std_vector_std_vector_cv_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 |
#capacity ⇒ Size_T
method wrapper for size_t std::vectorstd::vector<cv::Point>::capacity()
84135 84136 84137 84138 |
# File 'lib/ropencv/ropencv_types.rb', line 84135 def capacity() __validate_pointer__ Rbind::std_vector_std_vector_cv_point_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vectorstd::vector<cv::Point>::clear()
84128 84129 84130 84131 |
# File 'lib/ropencv/ropencv_types.rb', line 84128 def clear() __validate_pointer__ Rbind::std_vector_std_vector_cv_point_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vectorstd::vector<cv::Point>::data()
84209 84210 84211 84212 |
# File 'lib/ropencv/ropencv_types.rb', line 84209 def data() __validate_pointer__ Rbind::std_vector_std_vector_cv_point_data( self) end |
#delete_if(&block) ⇒ Object
84266 84267 84268 84269 84270 84271 84272 84273 |
# File 'lib/ropencv/ropencv_types.rb', line 84266 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
84252 84253 84254 84255 84256 84257 84258 84259 84260 84261 |
# File 'lib/ropencv/ropencv_types.rb', line 84252 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::vectorstd::vector<cv::Point>::empty()
84142 84143 84144 84145 |
# File 'lib/ropencv/ropencv_types.rb', line 84142 def empty() __validate_pointer__ Rbind::std_vector_std_vector_cv_point_empty( self) end |
#front ⇒ Std::Vector::Cv_Point
method wrapper for std::vectorcv::Point std::vectorstd::vector<cv::Point>::front()
84185 84186 84187 84188 84189 84190 84191 84192 84193 |
# File 'lib/ropencv/ropencv_types.rb', line 84185 def front() __validate_pointer__ result = Rbind::std_vector_std_vector_cv_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_element ⇒ Std::Vector::Cv_Point
method wrapper for std::vectorcv::Point std::vectorstd::vector<cv::Point>::operator
84241 84242 84243 84244 84245 84246 84247 84248 84249 84250 |
# File 'lib/ropencv/ropencv_types.rb', line 84241 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_std_vector_cv_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_back ⇒ Void
method wrapper for void std::vectorstd::vector<cv::Point>::pop_back()
84224 84225 84226 84227 |
# File 'lib/ropencv/ropencv_types.rb', line 84224 def pop_back() __validate_pointer__ Rbind::std_vector_std_vector_cv_point_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vectorstd::vector<cv::Point>::push_back(std::vectorcv::Point other)
84217 84218 84219 84220 |
# File 'lib/ropencv/ropencv_types.rb', line 84217 def push_back(other) __validate_pointer__ Rbind::std_vector_std_vector_cv_point_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vectorstd::vector<cv::Point>::reserve(size_t size)
84150 84151 84152 84153 |
# File 'lib/ropencv/ropencv_types.rb', line 84150 def reserve(size) __validate_pointer__ Rbind::std_vector_std_vector_cv_point_reserve( self, size) end |
#resize(size, val = Std::Vector::Cv_Point.new()) ⇒ Void
method wrapper for void std::vectorstd::vector<cv::Point>::resize(size_t size, std::vectorcv::Point val = std::vectorcv::Point())
methods
84114 84115 84116 84117 |
# File 'lib/ropencv/ropencv_types.rb', line 84114 def resize(size, val = Std::Vector::Cv_Point.new()) __validate_pointer__ Rbind::std_vector_std_vector_cv_point_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vectorstd::vector<cv::Point>::size()
84121 84122 84123 84124 |
# File 'lib/ropencv/ropencv_types.rb', line 84121 def size() __validate_pointer__ Rbind::std_vector_std_vector_cv_point_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vectorstd::vector<cv::Point>::swap(std::vectorstd::vector<cv::Point> other)
84232 84233 84234 84235 |
# File 'lib/ropencv/ropencv_types.rb', line 84232 def swap(other) __validate_pointer__ Rbind::std_vector_std_vector_cv_point_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Std_Vector_Cv_Point into a string by crawling through all its attributes
84101 84102 84103 |
# File 'lib/ropencv/ropencv_types.rb', line 84101 def to_s "#<std::vector<std::vector<cv::Point>> >" end |
#validate_index(idx) ⇒ Object
84247 84248 84249 84250 84251 |
# File 'lib/ropencv/ropencv_types.rb', line 84247 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |