Class: OpenCV::VectorChar
- Inherits:
-
Object
- Object
- OpenCV::VectorChar
- 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 char vector_char::operator[](size_t size).
-
#__owner__? ⇒ Boolean
private
returns true if the underlying pointer is owner of the real object.
-
#at(size) ⇒ Object
wrapper for char vector_char::at(size_t size).
-
#back ⇒ Object
wrapper for char vector_char::back().
-
#capacity ⇒ Object
wrapper for size_t vector_char::capacity().
-
#data ⇒ Object
wrapper for void * vector_char::data().
- #each(&block) ⇒ Object
-
#empty ⇒ Object
wrapper for bool vector_char::empty().
-
#front ⇒ Object
wrapper for char vector_char::front().
-
#initialize(ptr) ⇒ VectorChar
constructor
private
A new instance of VectorChar.
-
#pop_back ⇒ Object
wrapper for void vector_char::pop_back().
-
#push_back(other) ⇒ Object
wrapper for void vector_char::push_back(char other).
-
#reserve(size) ⇒ Object
wrapper for void vector_char::reserve(size_t size).
-
#resize(size, val = Char) ⇒ Object
methods wrapper for void vector_char::resize(size_t size, char val=char).
-
#size ⇒ Object
wrapper for size_t vector_char::size().
-
#swap(other) ⇒ Object
wrapper for void vector_char::swap(vector_char other).
Constructor Details
#initialize(ptr) ⇒ VectorChar
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 VectorChar.
22381 22382 22383 22384 22385 22386 22387 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22381 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? VectorCharStruct ptr else VectorCharStruct.new(FFI::AutoPointer.new(ptr,VectorCharStruct.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.
22378 22379 22380 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22378 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
22373 22374 22375 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22373 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
22317 22318 22319 22320 22321 22322 22323 22324 22325 22326 22327 22328 22329 22330 22331 22332 22333 22334 22335 22336 22337 22338 22339 22340 22341 22342 22343 22344 22345 22346 22347 22348 22349 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22317 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(VectorCharStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for vector_char::vector_char() @@vector_char_vector_char_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) args.size.upto(-1) do |i| args[i] = @@vector_char_vector_char_defaults0[i] end begin return Rbind::vector_char_vector_char(*args) rescue TypeError => e @error = e end end # wrapper for vector_char::vector_char(const vector_char other) @@vector_char_vector_char2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@vector_char_vector_char2_defaults1[i] end begin return Rbind::vector_char_vector_char2(*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.
22361 22362 22363 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22361 def self.rbind_from_native(ptr,context) VectorChar.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.
22352 22353 22354 22355 22356 22357 22358 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22352 def self.rbind_to_native(obj,context) if obj.is_a? VectorChar 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
22367 22368 22369 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22367 def self.to_native(obj,context) rbind_to_native(obj,context) end |
Instance Method Details
#<<(val) ⇒ Object
22408 22409 22410 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22408 def <<(val) push_back(val) end |
#[](size) ⇒ Object
wrapper for char vector_char::operator[](size_t size)
22453 22454 22455 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22453 def [](size) Rbind::vector_char_operator_array( self, size) 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
22392 22393 22394 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22392 def __owner__? @__obj_ptr__[:bowner] end |
#at(size) ⇒ Object
wrapper for char vector_char::at(size_t size)
22458 22459 22460 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22458 def at(size) Rbind::vector_char_at( self, size) end |
#back ⇒ Object
wrapper for char vector_char::back()
22468 22469 22470 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22468 def back() Rbind::vector_char_back( self) end |
#capacity ⇒ Object
wrapper for size_t vector_char::capacity()
22438 22439 22440 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22438 def capacity() Rbind::vector_char_capacity( self) end |
#data ⇒ Object
wrapper for void * vector_char::data()
22473 22474 22475 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22473 def data() Rbind::vector_char_data( self) end |
#each(&block) ⇒ Object
22398 22399 22400 22401 22402 22403 22404 22405 22406 22407 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22398 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_char::empty()
22443 22444 22445 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22443 def empty() Rbind::vector_char_empty( self) end |
#front ⇒ Object
wrapper for char vector_char::front()
22463 22464 22465 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22463 def front() Rbind::vector_char_front( self) end |
#pop_back ⇒ Object
wrapper for void vector_char::pop_back()
22483 22484 22485 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22483 def pop_back() Rbind::vector_char_pop_back( self) end |
#push_back(other) ⇒ Object
wrapper for void vector_char::push_back(char other)
22478 22479 22480 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22478 def push_back(other) Rbind::vector_char_push_back( self, other) end |
#reserve(size) ⇒ Object
wrapper for void vector_char::reserve(size_t size)
22448 22449 22450 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22448 def reserve(size) Rbind::vector_char_reserve( self, size) end |
#resize(size, val = Char) ⇒ Object
methods wrapper for void vector_char::resize(size_t size, char val=char)
22428 22429 22430 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22428 def resize(size, val = Char) Rbind::vector_char_resize( self, size, val) end |
#size ⇒ Object
wrapper for size_t vector_char::size()
22433 22434 22435 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22433 def size() Rbind::vector_char_size( self) end |
#swap(other) ⇒ Object
wrapper for void vector_char::swap(vector_char other)
22488 22489 22490 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22488 def swap(other) Rbind::vector_char_swap( self, other) end |