Class: OpenCV::Std::Vector::Uint32_T
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Uint32_T
- 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) ⇒ Fixnum
- #at(size) ⇒ Fixnum
- #back ⇒ Fixnum
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Fixnum
- #get_element ⇒ Fixnum
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Uint32_T()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Uint32_T into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
87789 87790 87791 87792 87793 87794 87795 87796 87797 87798 87799 87800 87801 87802 87803 87804 87805 87806 87807 87808 87809 87810 87811 87812 87813 87814 87815 87816 87817 87818 87819 87820 87821 87822 87823 |
# File 'lib/ropencv/ropencv_types.rb', line 87789 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Uint32_TStruct) 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<uint32_t>::vector<uint32_t>() @@std_vector_uint32t_vector_uint32t_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_uint32t_vector_uint32t_defaults0[i] end begin return Rbind::std_vector_uint32t_vector_uint32t(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<uint32_t>::vector<uint32_t>(std::vector<uint32_t> other) @@std_vector_uint32t_vector_uint32t_2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_uint32t_vector_uint32t_2_defaults1[i] end begin return Rbind::std_vector_uint32t_vector_uint32t_2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
Instance Method Details
#<<(val) ⇒ Object
88030 88031 88032 88033 |
# File 'lib/ropencv/ropencv_types.rb', line 88030 def <<(val) push_back(val) self end |
#[](idx) ⇒ Fixnum
87946 87947 87948 87949 87950 |
# File 'lib/ropencv/ropencv_types.rb', line 87946 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_uint32t_operator_array( self, size) end |
#at(size) ⇒ Fixnum
method wrapper for uint32_t std::vector
87955 87956 87957 87958 87959 |
# File 'lib/ropencv/ropencv_types.rb', line 87955 def at(size) validate_index(size) __validate_pointer__ Rbind::std_vector_uint32t_at( self, size) end |
#back ⇒ Fixnum
method wrapper for uint32_t std::vector
87970 87971 87972 87973 |
# File 'lib/ropencv/ropencv_types.rb', line 87970 def back() __validate_pointer__ Rbind::std_vector_uint32t_back( self) end |
#capacity ⇒ Size_T
method wrapper for size_t std::vector
87923 87924 87925 87926 |
# File 'lib/ropencv/ropencv_types.rb', line 87923 def capacity() __validate_pointer__ Rbind::std_vector_uint32t_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vector
87916 87917 87918 87919 |
# File 'lib/ropencv/ropencv_types.rb', line 87916 def clear() __validate_pointer__ Rbind::std_vector_uint32t_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vector
87977 87978 87979 87980 |
# File 'lib/ropencv/ropencv_types.rb', line 87977 def data() __validate_pointer__ Rbind::std_vector_uint32t_data( self) end |
#delete_if(&block) ⇒ Object
88034 88035 88036 88037 88038 88039 88040 88041 |
# File 'lib/ropencv/ropencv_types.rb', line 88034 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
88020 88021 88022 88023 88024 88025 88026 88027 88028 88029 |
# File 'lib/ropencv/ropencv_types.rb', line 88020 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
87930 87931 87932 87933 |
# File 'lib/ropencv/ropencv_types.rb', line 87930 def empty() __validate_pointer__ Rbind::std_vector_uint32t_empty( self) end |
#front ⇒ Fixnum
method wrapper for uint32_t std::vector
87963 87964 87965 87966 |
# File 'lib/ropencv/ropencv_types.rb', line 87963 def front() __validate_pointer__ Rbind::std_vector_uint32t_front( self) end |
#get_element ⇒ Fixnum
88009 88010 88011 88012 88013 |
# File 'lib/ropencv/ropencv_types.rb', line 88009 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_uint32t_operator_array( self, size) end |
#pop_back ⇒ Void
method wrapper for void std::vector
87992 87993 87994 87995 |
# File 'lib/ropencv/ropencv_types.rb', line 87992 def pop_back() __validate_pointer__ Rbind::std_vector_uint32t_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vector
87985 87986 87987 87988 |
# File 'lib/ropencv/ropencv_types.rb', line 87985 def push_back(other) __validate_pointer__ Rbind::std_vector_uint32t_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vector
87938 87939 87940 87941 |
# File 'lib/ropencv/ropencv_types.rb', line 87938 def reserve(size) __validate_pointer__ Rbind::std_vector_uint32t_reserve( self, size) end |
#resize(size, val = Uint32_T()) ⇒ Void
method wrapper for void std::vector
methods
87902 87903 87904 87905 |
# File 'lib/ropencv/ropencv_types.rb', line 87902 def resize(size, val = Uint32_T()) __validate_pointer__ Rbind::std_vector_uint32t_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vector
87909 87910 87911 87912 |
# File 'lib/ropencv/ropencv_types.rb', line 87909 def size() __validate_pointer__ Rbind::std_vector_uint32t_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vector
88000 88001 88002 88003 |
# File 'lib/ropencv/ropencv_types.rb', line 88000 def swap(other) __validate_pointer__ Rbind::std_vector_uint32t_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Uint32_T into a string by crawling through all its attributes
87889 87890 87891 |
# File 'lib/ropencv/ropencv_types.rb', line 87889 def to_s "#<std::vector<uint32_t> >" end |
#validate_index(idx) ⇒ Object
88015 88016 88017 88018 88019 |
# File 'lib/ropencv/ropencv_types.rb', line 88015 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |