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
33821 33822 33823 33824 33825 33826 33827 33828 33829 33830 33831 33832 33833 33834 33835 33836 33837 33838 33839 33840 33841 33842 33843 33844 33845 33846 33847 33848 33849 33850 33851 33852 33853 33854 33855 |
# File 'lib/ropencv/ropencv_types.rb', line 33821 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_float2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_float_vector_float2_defaults1[i] end begin return Rbind::std_vector_float_vector_float2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
Instance Method Details
#<<(val) ⇒ Object
34062 34063 34064 34065 |
# File 'lib/ropencv/ropencv_types.rb', line 34062 def <<(val) push_back(val) self end |
#[](idx) ⇒ Float
33978 33979 33980 33981 33982 |
# File 'lib/ropencv/ropencv_types.rb', line 33978 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
33987 33988 33989 33990 33991 |
# File 'lib/ropencv/ropencv_types.rb', line 33987 def at(size) validate_index(size) __validate_pointer__ Rbind::std_vector_float_at( self, size) end |
#back ⇒ Float
method wrapper for float std::vector
34002 34003 34004 34005 |
# File 'lib/ropencv/ropencv_types.rb', line 34002 def back() __validate_pointer__ Rbind::std_vector_float_back( self) end |
#capacity ⇒ Size_T
method wrapper for size_t std::vector
33955 33956 33957 33958 |
# File 'lib/ropencv/ropencv_types.rb', line 33955 def capacity() __validate_pointer__ Rbind::std_vector_float_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vector
33948 33949 33950 33951 |
# File 'lib/ropencv/ropencv_types.rb', line 33948 def clear() __validate_pointer__ Rbind::std_vector_float_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vector
34009 34010 34011 34012 |
# File 'lib/ropencv/ropencv_types.rb', line 34009 def data() __validate_pointer__ Rbind::std_vector_float_data( self) end |
#delete_if(&block) ⇒ Object
34066 34067 34068 34069 34070 34071 34072 34073 |
# File 'lib/ropencv/ropencv_types.rb', line 34066 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
34052 34053 34054 34055 34056 34057 34058 34059 34060 34061 |
# File 'lib/ropencv/ropencv_types.rb', line 34052 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
33962 33963 33964 33965 |
# File 'lib/ropencv/ropencv_types.rb', line 33962 def empty() __validate_pointer__ Rbind::std_vector_float_empty( self) end |
#front ⇒ Float
method wrapper for float std::vector
33995 33996 33997 33998 |
# File 'lib/ropencv/ropencv_types.rb', line 33995 def front() __validate_pointer__ Rbind::std_vector_float_front( self) end |
#get_element ⇒ Float
34041 34042 34043 34044 34045 |
# File 'lib/ropencv/ropencv_types.rb', line 34041 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
34024 34025 34026 34027 |
# File 'lib/ropencv/ropencv_types.rb', line 34024 def pop_back() __validate_pointer__ Rbind::std_vector_float_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vector
34017 34018 34019 34020 |
# File 'lib/ropencv/ropencv_types.rb', line 34017 def push_back(other) __validate_pointer__ Rbind::std_vector_float_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vector
33970 33971 33972 33973 |
# File 'lib/ropencv/ropencv_types.rb', line 33970 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
33934 33935 33936 33937 |
# File 'lib/ropencv/ropencv_types.rb', line 33934 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
33941 33942 33943 33944 |
# File 'lib/ropencv/ropencv_types.rb', line 33941 def size() __validate_pointer__ Rbind::std_vector_float_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vector
34032 34033 34034 34035 |
# File 'lib/ropencv/ropencv_types.rb', line 34032 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
33921 33922 33923 |
# File 'lib/ropencv/ropencv_types.rb', line 33921 def to_s "#<std::vector<float> >" end |
#validate_index(idx) ⇒ Object
34047 34048 34049 34050 34051 |
# File 'lib/ropencv/ropencv_types.rb', line 34047 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |