Class: OpenCV::Std::Vector::Cv_Point2f
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Cv_Point2f
- 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::Point2f
- #at(size) ⇒ Cv::Point2f
- #back ⇒ Cv::Point2f
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Cv::Point2f
- #get_element ⇒ Cv::Point2f
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Cv::Point2f.new()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Cv_Point2f into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
79276 79277 79278 79279 79280 79281 79282 79283 79284 79285 79286 79287 79288 79289 79290 79291 79292 79293 79294 79295 79296 79297 79298 79299 79300 79301 79302 79303 79304 79305 79306 79307 79308 79309 79310 |
# File 'lib/ropencv/ropencv_types.rb', line 79276 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Cv_Point2fStruct) 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::Point2f>::vector<cv::Point2f>() @@std_vector_cv_point_2f_vector_cv_point_2f_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_cv_point_2f_vector_cv_point_2f_defaults0[i] end begin return Rbind::std_vector_cv_point_2f_vector_cv_point_2f(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<cv::Point2f>::vector<cv::Point2f>(std::vector<cv::Point2f> other) @@std_vector_cv_point_2f_vector_cv_point_2f__2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_cv_point_2f_vector_cv_point_2f__2_defaults1[i] end begin return Rbind::std_vector_cv_point_2f_vector_cv_point_2f__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
79268 79269 79270 |
# File 'lib/ropencv/ropencv_types.rb', line 79268 def self.null new(Vector::Cv_Point2fStruct.new) end |
Instance Method Details
#<<(val) ⇒ Object
79537 79538 79539 79540 |
# File 'lib/ropencv/ropencv_types.rb', line 79537 def <<(val) push_back(val) self end |
#[](idx) ⇒ Cv::Point2f
method wrapper for cv::Point2f std::vectorcv::Point2f::operator
79433 79434 79435 79436 79437 79438 79439 79440 79441 79442 |
# File 'lib/ropencv/ropencv_types.rb', line 79433 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_point_2f_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::Point2f
method wrapper for cv::Point2f std::vectorcv::Point2f::at(size_t size)
79447 79448 79449 79450 79451 79452 79453 79454 79455 79456 |
# File 'lib/ropencv/ropencv_types.rb', line 79447 def at(size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_point_2f_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::Point2f
method wrapper for cv::Point2f std::vectorcv::Point2f::back()
79472 79473 79474 79475 79476 79477 79478 79479 79480 |
# File 'lib/ropencv/ropencv_types.rb', line 79472 def back() __validate_pointer__ result = Rbind::std_vector_cv_point_2f_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::Point2f::capacity()
79410 79411 79412 79413 |
# File 'lib/ropencv/ropencv_types.rb', line 79410 def capacity() __validate_pointer__ Rbind::std_vector_cv_point_2f_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vectorcv::Point2f::clear()
79403 79404 79405 79406 |
# File 'lib/ropencv/ropencv_types.rb', line 79403 def clear() __validate_pointer__ Rbind::std_vector_cv_point_2f_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vectorcv::Point2f::data()
79484 79485 79486 79487 |
# File 'lib/ropencv/ropencv_types.rb', line 79484 def data() __validate_pointer__ Rbind::std_vector_cv_point_2f_data( self) end |
#delete_if(&block) ⇒ Object
79541 79542 79543 79544 79545 79546 79547 79548 |
# File 'lib/ropencv/ropencv_types.rb', line 79541 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
79527 79528 79529 79530 79531 79532 79533 79534 79535 79536 |
# File 'lib/ropencv/ropencv_types.rb', line 79527 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::Point2f::empty()
79417 79418 79419 79420 |
# File 'lib/ropencv/ropencv_types.rb', line 79417 def empty() __validate_pointer__ Rbind::std_vector_cv_point_2f_empty( self) end |
#front ⇒ Cv::Point2f
method wrapper for cv::Point2f std::vectorcv::Point2f::front()
79460 79461 79462 79463 79464 79465 79466 79467 79468 |
# File 'lib/ropencv/ropencv_types.rb', line 79460 def front() __validate_pointer__ result = Rbind::std_vector_cv_point_2f_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::Point2f
method wrapper for cv::Point2f std::vectorcv::Point2f::operator
79516 79517 79518 79519 79520 79521 79522 79523 79524 79525 |
# File 'lib/ropencv/ropencv_types.rb', line 79516 def [](size) validate_index(size) __validate_pointer__ result = Rbind::std_vector_cv_point_2f_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::Point2f::pop_back()
79499 79500 79501 79502 |
# File 'lib/ropencv/ropencv_types.rb', line 79499 def pop_back() __validate_pointer__ Rbind::std_vector_cv_point_2f_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vectorcv::Point2f::push_back(cv::Point2f other)
79492 79493 79494 79495 |
# File 'lib/ropencv/ropencv_types.rb', line 79492 def push_back(other) __validate_pointer__ Rbind::std_vector_cv_point_2f_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vectorcv::Point2f::reserve(size_t size)
79425 79426 79427 79428 |
# File 'lib/ropencv/ropencv_types.rb', line 79425 def reserve(size) __validate_pointer__ Rbind::std_vector_cv_point_2f_reserve( self, size) end |
#resize(size, val = Cv::Point2f.new()) ⇒ Void
method wrapper for void std::vectorcv::Point2f::resize(size_t size, cv::Point2f val = cv::Point2f())
methods
79389 79390 79391 79392 |
# File 'lib/ropencv/ropencv_types.rb', line 79389 def resize(size, val = Cv::Point2f.new()) __validate_pointer__ Rbind::std_vector_cv_point_2f_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vectorcv::Point2f::size()
79396 79397 79398 79399 |
# File 'lib/ropencv/ropencv_types.rb', line 79396 def size() __validate_pointer__ Rbind::std_vector_cv_point_2f_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vectorcv::Point2f::swap(std::vectorcv::Point2f other)
79507 79508 79509 79510 |
# File 'lib/ropencv/ropencv_types.rb', line 79507 def swap(other) __validate_pointer__ Rbind::std_vector_cv_point_2f_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Cv_Point2f into a string by crawling through all its attributes
79376 79377 79378 |
# File 'lib/ropencv/ropencv_types.rb', line 79376 def to_s "#<std::vector<cv::Point2f> >" end |
#validate_index(idx) ⇒ Object
79522 79523 79524 79525 79526 |
# File 'lib/ropencv/ropencv_types.rb', line 79522 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |