Class: OpenCV::Std::Vector::Float
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Float
- 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) ⇒ Float
- #at(size) ⇒ Float
- #back ⇒ Float
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Float
- #get_element ⇒ Float
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = loat()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Float into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
81808 81809 81810 81811 81812 81813 81814 81815 81816 81817 81818 81819 81820 81821 81822 81823 81824 81825 81826 81827 81828 81829 81830 81831 81832 81833 81834 81835 81836 81837 81838 81839 81840 81841 81842 |
# File 'lib/ropencv/ropencv_types.rb', line 81808 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::FloatStruct) 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<float>::vector<float>() @@std_vector_float_vector_float_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_float_vector_float_defaults0[i] end begin return Rbind::std_vector_float_vector_float(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<float>::vector<float>(std::vector<float> other) @@std_vector_float_vector_float__2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_float_vector_float__2_defaults1[i] end begin return Rbind::std_vector_float_vector_float__2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
Instance Method Details
#<<(val) ⇒ Object
82049 82050 82051 82052 |
# File 'lib/ropencv/ropencv_types.rb', line 82049 def <<(val) push_back(val) self end |
#[](idx) ⇒ Float
81965 81966 81967 81968 81969 |
# File 'lib/ropencv/ropencv_types.rb', line 81965 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_float_operator_array( self, size) end |
#at(size) ⇒ Float
method wrapper for float std::vector
81974 81975 81976 81977 81978 |
# File 'lib/ropencv/ropencv_types.rb', line 81974 def at(size) validate_index(size) __validate_pointer__ Rbind::std_vector_float_at( self, size) end |
#back ⇒ Float
method wrapper for float std::vector
81989 81990 81991 81992 |
# File 'lib/ropencv/ropencv_types.rb', line 81989 def back() __validate_pointer__ Rbind::std_vector_float_back( self) end |
#capacity ⇒ Size_T
method wrapper for size_t std::vector
81942 81943 81944 81945 |
# File 'lib/ropencv/ropencv_types.rb', line 81942 def capacity() __validate_pointer__ Rbind::std_vector_float_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vector
81935 81936 81937 81938 |
# File 'lib/ropencv/ropencv_types.rb', line 81935 def clear() __validate_pointer__ Rbind::std_vector_float_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vector
81996 81997 81998 81999 |
# File 'lib/ropencv/ropencv_types.rb', line 81996 def data() __validate_pointer__ Rbind::std_vector_float_data( self) end |
#delete_if(&block) ⇒ Object
82053 82054 82055 82056 82057 82058 82059 82060 |
# File 'lib/ropencv/ropencv_types.rb', line 82053 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
82039 82040 82041 82042 82043 82044 82045 82046 82047 82048 |
# File 'lib/ropencv/ropencv_types.rb', line 82039 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::vector
81949 81950 81951 81952 |
# File 'lib/ropencv/ropencv_types.rb', line 81949 def empty() __validate_pointer__ Rbind::std_vector_float_empty( self) end |
#front ⇒ Float
method wrapper for float std::vector
81982 81983 81984 81985 |
# File 'lib/ropencv/ropencv_types.rb', line 81982 def front() __validate_pointer__ Rbind::std_vector_float_front( self) end |
#get_element ⇒ Float
82028 82029 82030 82031 82032 |
# File 'lib/ropencv/ropencv_types.rb', line 82028 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_float_operator_array( self, size) end |
#pop_back ⇒ Void
method wrapper for void std::vector
82011 82012 82013 82014 |
# File 'lib/ropencv/ropencv_types.rb', line 82011 def pop_back() __validate_pointer__ Rbind::std_vector_float_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vector
82004 82005 82006 82007 |
# File 'lib/ropencv/ropencv_types.rb', line 82004 def push_back(other) __validate_pointer__ Rbind::std_vector_float_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vector
81957 81958 81959 81960 |
# File 'lib/ropencv/ropencv_types.rb', line 81957 def reserve(size) __validate_pointer__ Rbind::std_vector_float_reserve( self, size) end |
#resize(size, val = loat()) ⇒ Void
method wrapper for void std::vector
methods
81921 81922 81923 81924 |
# File 'lib/ropencv/ropencv_types.rb', line 81921 def resize(size, val = loat()) __validate_pointer__ Rbind::std_vector_float_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vector
81928 81929 81930 81931 |
# File 'lib/ropencv/ropencv_types.rb', line 81928 def size() __validate_pointer__ Rbind::std_vector_float_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vector
82019 82020 82021 82022 |
# File 'lib/ropencv/ropencv_types.rb', line 82019 def swap(other) __validate_pointer__ Rbind::std_vector_float_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Float into a string by crawling through all its attributes
81908 81909 81910 |
# File 'lib/ropencv/ropencv_types.rb', line 81908 def to_s "#<std::vector<float> >" end |
#validate_index(idx) ⇒ Object
82034 82035 82036 82037 82038 |
# File 'lib/ropencv/ropencv_types.rb', line 82034 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |