Class: OpenCV::VectorVec4f
- Inherits:
-
Object
- Object
- OpenCV::VectorVec4f
- 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::Vec4f vector_Vec4f::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::Vec4f vector_Vec4f::at(size_t size).
-
#back ⇒ Object
wrapper for cv::Vec4f vector_Vec4f::back().
-
#capacity ⇒ Object
wrapper for size_t vector_Vec4f::capacity().
-
#data ⇒ Object
wrapper for void * vector_Vec4f::data().
- #each(&block) ⇒ Object
-
#empty ⇒ Object
wrapper for bool vector_Vec4f::empty().
-
#front ⇒ Object
wrapper for cv::Vec4f vector_Vec4f::front().
-
#initialize(ptr) ⇒ VectorVec4f
constructor
private
A new instance of VectorVec4f.
-
#pop_back ⇒ Object
wrapper for void vector_Vec4f::pop_back().
-
#push_back(other) ⇒ Object
wrapper for void vector_Vec4f::push_back(const cv::Vec4f other).
-
#reserve(size) ⇒ Object
wrapper for void vector_Vec4f::reserve(size_t size).
-
#resize(size, val = cv::Vec4f) ⇒ Object
methods wrapper for void vector_Vec4f::resize(size_t size, const cv::Vec4f val=cv::Vec4f).
-
#size ⇒ Object
wrapper for size_t vector_Vec4f::size().
-
#swap(other) ⇒ Object
wrapper for void vector_Vec4f::swap(vector_Vec4f other).
Constructor Details
#initialize(ptr) ⇒ VectorVec4f
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 VectorVec4f.
16851 16852 16853 16854 16855 16856 16857 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16851 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? VectorVec4fStruct ptr else VectorVec4fStruct.new(FFI::AutoPointer.new(ptr,VectorVec4fStruct.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.
16848 16849 16850 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16848 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
16843 16844 16845 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16843 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16787 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(VectorVec4fStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for vector_Vec4f::vector_Vec4f() @@vector_vec_4f_vector_vec_4f_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) args.size.upto(-1) do |i| args[i] = @@vector_vec_4f_vector_vec_4f_defaults0[i] end begin return Rbind::vector_vec_4f_vector_vec_4f(*args) rescue TypeError => e @error = e end end # wrapper for vector_Vec4f::vector_Vec4f(const vector_Vec4f other) @@vector_vec_4f_vector_vec_4f2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@vector_vec_4f_vector_vec_4f2_defaults1[i] end begin return Rbind::vector_vec_4f_vector_vec_4f2(*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.
16831 16832 16833 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16831 def self.rbind_from_native(ptr,context) VectorVec4f.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.
16822 16823 16824 16825 16826 16827 16828 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16822 def self.rbind_to_native(obj,context) if obj.is_a? VectorVec4f 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
16837 16838 16839 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16837 def self.to_native(obj,context) rbind_to_native(obj,context) end |
Instance Method Details
#<<(val) ⇒ Object
16878 16879 16880 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16878 def <<(val) push_back(val) end |
#[](size) ⇒ Object
wrapper for cv::Vec4f vector_Vec4f::operator[](size_t size)
16923 16924 16925 16926 16927 16928 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16923 def [](size) result = Rbind::vector_vec_4f_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
16862 16863 16864 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16862 def __owner__? @__obj_ptr__[:bowner] end |
#at(size) ⇒ Object
wrapper for cv::Vec4f vector_Vec4f::at(size_t size)
16931 16932 16933 16934 16935 16936 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16931 def at(size) result = Rbind::vector_vec_4f_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::Vec4f vector_Vec4f::back()
16947 16948 16949 16950 16951 16952 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16947 def back() result = Rbind::vector_vec_4f_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_Vec4f::capacity()
16908 16909 16910 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16908 def capacity() Rbind::vector_vec_4f_capacity( self) end |
#data ⇒ Object
wrapper for void * vector_Vec4f::data()
16955 16956 16957 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16955 def data() Rbind::vector_vec_4f_data( self) end |
#each(&block) ⇒ Object
16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16868 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_Vec4f::empty()
16913 16914 16915 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16913 def empty() Rbind::vector_vec_4f_empty( self) end |
#front ⇒ Object
wrapper for cv::Vec4f vector_Vec4f::front()
16939 16940 16941 16942 16943 16944 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16939 def front() result = Rbind::vector_vec_4f_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_Vec4f::pop_back()
16965 16966 16967 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16965 def pop_back() Rbind::vector_vec_4f_pop_back( self) end |
#push_back(other) ⇒ Object
wrapper for void vector_Vec4f::push_back(const cv::Vec4f other)
16960 16961 16962 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16960 def push_back(other) Rbind::vector_vec_4f_push_back( self, other) end |
#reserve(size) ⇒ Object
wrapper for void vector_Vec4f::reserve(size_t size)
16918 16919 16920 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16918 def reserve(size) Rbind::vector_vec_4f_reserve( self, size) end |
#resize(size, val = cv::Vec4f) ⇒ Object
methods wrapper for void vector_Vec4f::resize(size_t size, const cv::Vec4f val=cv::Vec4f)
16898 16899 16900 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16898 def resize(size, val = cv::Vec4f) Rbind::vector_vec_4f_resize( self, size, val) end |
#size ⇒ Object
wrapper for size_t vector_Vec4f::size()
16903 16904 16905 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16903 def size() Rbind::vector_vec_4f_size( self) end |
#swap(other) ⇒ Object
wrapper for void vector_Vec4f::swap(vector_Vec4f other)
16970 16971 16972 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 16970 def swap(other) Rbind::vector_vec_4f_swap( self, other) end |