Class: OpenCV::VectorPoint2f
- Inherits:
-
Object
- Object
- OpenCV::VectorPoint2f
- Extended by:
- FFI::DataConverter
- Includes:
- Enumerable
- Defined in:
- lib/ruby/ropencv/ropencv_types.rb
Instance Attribute Summary collapse
- #__obj_ptr__ ⇒ Object readonly private
Class Method Summary collapse
-
.from_native(ptr, context) ⇒ Object
private
can be overwritten by the user.
- .new(*args) ⇒ Object
- .rbind_from_native(ptr, context) ⇒ Object private
- .rbind_to_native(obj, context) ⇒ Object private
-
.to_native(obj, context) ⇒ Object
private
can be overwritten by the user.
Instance Method Summary collapse
- #<<(val) ⇒ Object
-
#[](size) ⇒ Object
wrapper for cv::Point2f vector_Point2f::operator[](size_t size).
-
#__owner__? ⇒ Boolean
private
returns true if the underlying pointer is owner of the real object.
-
#at(size) ⇒ Object
wrapper for cv::Point2f vector_Point2f::at(size_t size).
-
#back ⇒ Object
wrapper for cv::Point2f vector_Point2f::back().
-
#capacity ⇒ Object
wrapper for size_t vector_Point2f::capacity().
-
#data ⇒ Object
wrapper for void * vector_Point2f::data().
- #each(&block) ⇒ Object
-
#empty ⇒ Object
wrapper for bool vector_Point2f::empty().
-
#front ⇒ Object
wrapper for cv::Point2f vector_Point2f::front().
-
#initialize(ptr) ⇒ VectorPoint2f
constructor
private
A new instance of VectorPoint2f.
-
#pop_back ⇒ Object
wrapper for void vector_Point2f::pop_back().
-
#push_back(other) ⇒ Object
wrapper for void vector_Point2f::push_back(const cv::Point2f other).
-
#reserve(size) ⇒ Object
wrapper for void vector_Point2f::reserve(size_t size).
-
#resize(size, val = cv::Point2f) ⇒ Object
methods wrapper for void vector_Point2f::resize(size_t size, const cv::Point2f val=cv::Point2f).
-
#size ⇒ Object
wrapper for size_t vector_Point2f::size().
-
#swap(other) ⇒ Object
wrapper for void vector_Point2f::swap(vector_Point2f other).
Constructor Details
#initialize(ptr) ⇒ VectorPoint2f
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of VectorPoint2f.
16638 16639 16640 16641 16642 16643 16644 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16638 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? VectorPoint2fStruct ptr else VectorPoint2fStruct.new(FFI::AutoPointer.new(ptr,VectorPoint2fStruct.method(:release))) end end |
Instance Attribute Details
#__obj_ptr__ ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16635 16636 16637 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16635 def __obj_ptr__ @__obj_ptr__ end |
Class Method Details
.from_native(ptr, context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
can be overwritten by the user
16630 16631 16632 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16630 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16574 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(VectorPoint2fStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for vector_Point2f::vector_Point2f() @@vector_point_2f_vector_point_2f_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) args.size.upto(-1) do |i| args[i] = @@vector_point_2f_vector_point_2f_defaults0[i] end begin return Rbind::vector_point_2f_vector_point_2f(*args) rescue TypeError => e @error = e end end # wrapper for vector_Point2f::vector_Point2f(const vector_Point2f other) @@vector_point_2f_vector_point_2f2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@vector_point_2f_vector_point_2f2_defaults1[i] end begin return Rbind::vector_point_2f_vector_point_2f2(*args) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.rbind_from_native(ptr, context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16618 16619 16620 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16618 def self.rbind_from_native(ptr,context) VectorPoint2f.new(ptr) end |
.rbind_to_native(obj, context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16609 16610 16611 16612 16613 16614 16615 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16609 def self.rbind_to_native(obj,context) if obj.is_a? VectorPoint2f obj.__obj_ptr__ else raise TypeError, "expected kind of #{name}, was #{obj.class}" end end |
.to_native(obj, context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
can be overwritten by the user
16624 16625 16626 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16624 def self.to_native(obj,context) rbind_to_native(obj,context) end |
Instance Method Details
#<<(val) ⇒ Object
16665 16666 16667 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16665 def <<(val) push_back(val) end |
#[](size) ⇒ Object
wrapper for cv::Point2f vector_Point2f::operator[](size_t size)
16710 16711 16712 16713 16714 16715 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16710 def [](size) result = Rbind::vector_point_2f_operator_array( self, size) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result end |
#__owner__? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
returns true if the underlying pointer is owner of the real object
16649 16650 16651 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16649 def __owner__? @__obj_ptr__[:bowner] end |
#at(size) ⇒ Object
wrapper for cv::Point2f vector_Point2f::at(size_t size)
16718 16719 16720 16721 16722 16723 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16718 def at(size) result = Rbind::vector_point_2f_at( self, size) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result end |
#back ⇒ Object
wrapper for cv::Point2f vector_Point2f::back()
16734 16735 16736 16737 16738 16739 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16734 def back() result = Rbind::vector_point_2f_back( self) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result end |
#capacity ⇒ Object
wrapper for size_t vector_Point2f::capacity()
16695 16696 16697 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16695 def capacity() Rbind::vector_point_2f_capacity( self) end |
#data ⇒ Object
wrapper for void * vector_Point2f::data()
16742 16743 16744 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16742 def data() Rbind::vector_point_2f_data( self) end |
#each(&block) ⇒ Object
16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16655 def each(&block) if block s = size 0.upto(s-1) do |i| yield self[i] end else Enumerator.new(self) end end |
#empty ⇒ Object
wrapper for bool vector_Point2f::empty()
16700 16701 16702 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16700 def empty() Rbind::vector_point_2f_empty( self) end |
#front ⇒ Object
wrapper for cv::Point2f vector_Point2f::front()
16726 16727 16728 16729 16730 16731 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16726 def front() result = Rbind::vector_point_2f_front( self) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result end |
#pop_back ⇒ Object
wrapper for void vector_Point2f::pop_back()
16752 16753 16754 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16752 def pop_back() Rbind::vector_point_2f_pop_back( self) end |
#push_back(other) ⇒ Object
wrapper for void vector_Point2f::push_back(const cv::Point2f other)
16747 16748 16749 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16747 def push_back(other) Rbind::vector_point_2f_push_back( self, other) end |
#reserve(size) ⇒ Object
wrapper for void vector_Point2f::reserve(size_t size)
16705 16706 16707 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16705 def reserve(size) Rbind::vector_point_2f_reserve( self, size) end |
#resize(size, val = cv::Point2f) ⇒ Object
methods wrapper for void vector_Point2f::resize(size_t size, const cv::Point2f val=cv::Point2f)
16685 16686 16687 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16685 def resize(size, val = cv::Point2f) Rbind::vector_point_2f_resize( self, size, val) end |
#size ⇒ Object
wrapper for size_t vector_Point2f::size()
16690 16691 16692 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16690 def size() Rbind::vector_point_2f_size( self) end |
#swap(other) ⇒ Object
wrapper for void vector_Point2f::swap(vector_Point2f other)
16757 16758 16759 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16757 def swap(other) Rbind::vector_point_2f_swap( self, other) end |