Class: OpenCV::Std::Vector::Uchar
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Uchar
- 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) ⇒ Uchar
- #at(size) ⇒ Uchar
- #back ⇒ Uchar
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Uchar
- #get_element ⇒ Uchar
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Uchar()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Uchar into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
83064 83065 83066 83067 83068 83069 83070 83071 83072 83073 83074 83075 83076 83077 83078 83079 83080 83081 83082 83083 83084 83085 83086 83087 83088 83089 83090 83091 83092 83093 83094 83095 83096 83097 83098 |
# File 'lib/ropencv/ropencv_types.rb', line 83064 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::UcharStruct) 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<uchar>::vector<uchar>() @@std_vector_uchar_vector_uchar_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@std_vector_uchar_vector_uchar_defaults0[i] end begin return Rbind::std_vector_uchar_vector_uchar(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for std::vector<uchar>::vector<uchar>(std::vector<uchar> other) @@std_vector_uchar_vector_uchar__2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@std_vector_uchar_vector_uchar__2_defaults1[i] end begin return Rbind::std_vector_uchar_vector_uchar__2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
83056 83057 83058 |
# File 'lib/ropencv/ropencv_types.rb', line 83056 def self.null new(Vector::UcharStruct.new) end |
Instance Method Details
#<<(val) ⇒ Object
83305 83306 83307 83308 |
# File 'lib/ropencv/ropencv_types.rb', line 83305 def <<(val) push_back(val) self end |
#[](idx) ⇒ Uchar
83221 83222 83223 83224 83225 |
# File 'lib/ropencv/ropencv_types.rb', line 83221 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_uchar_operator_array( self, size) end |
#at(size) ⇒ Uchar
method wrapper for uchar std::vector
83230 83231 83232 83233 83234 |
# File 'lib/ropencv/ropencv_types.rb', line 83230 def at(size) validate_index(size) __validate_pointer__ Rbind::std_vector_uchar_at( self, size) end |
#back ⇒ Uchar
method wrapper for uchar std::vector
83245 83246 83247 83248 |
# File 'lib/ropencv/ropencv_types.rb', line 83245 def back() __validate_pointer__ Rbind::std_vector_uchar_back( self) end |
#capacity ⇒ Size_T
method wrapper for size_t std::vector
83198 83199 83200 83201 |
# File 'lib/ropencv/ropencv_types.rb', line 83198 def capacity() __validate_pointer__ Rbind::std_vector_uchar_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vector
83191 83192 83193 83194 |
# File 'lib/ropencv/ropencv_types.rb', line 83191 def clear() __validate_pointer__ Rbind::std_vector_uchar_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vector
83252 83253 83254 83255 |
# File 'lib/ropencv/ropencv_types.rb', line 83252 def data() __validate_pointer__ Rbind::std_vector_uchar_data( self) end |
#delete_if(&block) ⇒ Object
83309 83310 83311 83312 83313 83314 83315 83316 |
# File 'lib/ropencv/ropencv_types.rb', line 83309 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
83295 83296 83297 83298 83299 83300 83301 83302 83303 83304 |
# File 'lib/ropencv/ropencv_types.rb', line 83295 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
83205 83206 83207 83208 |
# File 'lib/ropencv/ropencv_types.rb', line 83205 def empty() __validate_pointer__ Rbind::std_vector_uchar_empty( self) end |
#front ⇒ Uchar
method wrapper for uchar std::vector
83238 83239 83240 83241 |
# File 'lib/ropencv/ropencv_types.rb', line 83238 def front() __validate_pointer__ Rbind::std_vector_uchar_front( self) end |
#get_element ⇒ Uchar
83284 83285 83286 83287 83288 |
# File 'lib/ropencv/ropencv_types.rb', line 83284 def [](size) validate_index(size) __validate_pointer__ Rbind::std_vector_uchar_operator_array( self, size) end |
#pop_back ⇒ Void
method wrapper for void std::vector
83267 83268 83269 83270 |
# File 'lib/ropencv/ropencv_types.rb', line 83267 def pop_back() __validate_pointer__ Rbind::std_vector_uchar_pop_back( self) end |
#push_back(other) ⇒ Void
method wrapper for void std::vector
83260 83261 83262 83263 |
# File 'lib/ropencv/ropencv_types.rb', line 83260 def push_back(other) __validate_pointer__ Rbind::std_vector_uchar_push_back( self, other) end |
#reserve(size) ⇒ Void
method wrapper for void std::vector
83213 83214 83215 83216 |
# File 'lib/ropencv/ropencv_types.rb', line 83213 def reserve(size) __validate_pointer__ Rbind::std_vector_uchar_reserve( self, size) end |
#resize(size, val = Uchar()) ⇒ Void
method wrapper for void std::vector
methods
83177 83178 83179 83180 |
# File 'lib/ropencv/ropencv_types.rb', line 83177 def resize(size, val = Uchar()) __validate_pointer__ Rbind::std_vector_uchar_resize( self, size, val) end |
#size ⇒ Size_T
method wrapper for size_t std::vector
83184 83185 83186 83187 |
# File 'lib/ropencv/ropencv_types.rb', line 83184 def size() __validate_pointer__ Rbind::std_vector_uchar_size( self) end |
#swap(other) ⇒ Void
method wrapper for void std::vector
83275 83276 83277 83278 |
# File 'lib/ropencv/ropencv_types.rb', line 83275 def swap(other) __validate_pointer__ Rbind::std_vector_uchar_swap( self, other) end |
#to_s ⇒ Object
converts Vector::Uchar into a string by crawling through all its attributes
83164 83165 83166 |
# File 'lib/ropencv/ropencv_types.rb', line 83164 def to_s "#<std::vector<uchar> >" end |
#validate_index(idx) ⇒ Object
83290 83291 83292 83293 83294 |
# File 'lib/ropencv/ropencv_types.rb', line 83290 def validate_index(idx) if idx < 0 || idx >= size raise RangeError,"#{idx} is out of range [0..#{size-1}]" end end |