Class: OpenCV::VectorDMatch
- Inherits:
-
Object
- Object
- OpenCV::VectorDMatch
- 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 cv::DMatch vector_DMatch::operator[](size_t size).
-
#__owner__? ⇒ Boolean
private
returns true if the underlying pointer is owner of the real object.
-
#at(size) ⇒ Object
wrapper for cv::DMatch vector_DMatch::at(size_t size).
-
#back ⇒ Object
wrapper for cv::DMatch vector_DMatch::back().
-
#capacity ⇒ Object
wrapper for size_t vector_DMatch::capacity().
-
#data ⇒ Object
wrapper for void * vector_DMatch::data().
- #each(&block) ⇒ Object
-
#empty ⇒ Object
wrapper for bool vector_DMatch::empty().
-
#front ⇒ Object
wrapper for cv::DMatch vector_DMatch::front().
-
#initialize(ptr) ⇒ VectorDMatch
constructor
private
A new instance of VectorDMatch.
-
#pop_back ⇒ Object
wrapper for void vector_DMatch::pop_back().
-
#push_back(other) ⇒ Object
wrapper for void vector_DMatch::push_back(const cv::DMatch other).
-
#reserve(size) ⇒ Object
wrapper for void vector_DMatch::reserve(size_t size).
-
#resize(size, val = cv::DMatch) ⇒ Object
methods wrapper for void vector_DMatch::resize(size_t size, const cv::DMatch val=cv::DMatch).
-
#size ⇒ Object
wrapper for size_t vector_DMatch::size().
-
#swap(other) ⇒ Object
wrapper for void vector_DMatch::swap(vector_DMatch other).
Constructor Details
#initialize(ptr) ⇒ VectorDMatch
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 VectorDMatch.
18315 18316 18317 18318 18319 18320 18321 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18315 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? VectorDMatchStruct ptr else VectorDMatchStruct.new(FFI::AutoPointer.new(ptr,VectorDMatchStruct.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.
18312 18313 18314 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18312 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
18307 18308 18309 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18307 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
18251 18252 18253 18254 18255 18256 18257 18258 18259 18260 18261 18262 18263 18264 18265 18266 18267 18268 18269 18270 18271 18272 18273 18274 18275 18276 18277 18278 18279 18280 18281 18282 18283 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18251 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(VectorDMatchStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for vector_DMatch::vector_DMatch() @@vector_d_match_vector_d_match_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) args.size.upto(-1) do |i| args[i] = @@vector_d_match_vector_d_match_defaults0[i] end begin return Rbind::vector_d_match_vector_d_match(*args) rescue TypeError => e @error = e end end # wrapper for vector_DMatch::vector_DMatch(const vector_DMatch other) @@vector_d_match_vector_d_match2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@vector_d_match_vector_d_match2_defaults1[i] end begin return Rbind::vector_d_match_vector_d_match2(*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.
18295 18296 18297 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18295 def self.rbind_from_native(ptr,context) VectorDMatch.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.
18286 18287 18288 18289 18290 18291 18292 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18286 def self.rbind_to_native(obj,context) if obj.is_a? VectorDMatch 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
18301 18302 18303 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18301 def self.to_native(obj,context) rbind_to_native(obj,context) end |
Instance Method Details
#<<(val) ⇒ Object
18342 18343 18344 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18342 def <<(val) push_back(val) end |
#[](size) ⇒ Object
wrapper for cv::DMatch vector_DMatch::operator[](size_t size)
18387 18388 18389 18390 18391 18392 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18387 def [](size) result = Rbind::vector_d_match_operator_array( self, size) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result 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
18326 18327 18328 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18326 def __owner__? @__obj_ptr__[:bowner] end |
#at(size) ⇒ Object
wrapper for cv::DMatch vector_DMatch::at(size_t size)
18395 18396 18397 18398 18399 18400 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18395 def at(size) result = Rbind::vector_d_match_at( self, size) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result end |
#back ⇒ Object
wrapper for cv::DMatch vector_DMatch::back()
18411 18412 18413 18414 18415 18416 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18411 def back() result = Rbind::vector_d_match_back( self) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result end |
#capacity ⇒ Object
wrapper for size_t vector_DMatch::capacity()
18372 18373 18374 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18372 def capacity() Rbind::vector_d_match_capacity( self) end |
#data ⇒ Object
wrapper for void * vector_DMatch::data()
18419 18420 18421 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18419 def data() Rbind::vector_d_match_data( self) end |
#each(&block) ⇒ Object
18332 18333 18334 18335 18336 18337 18338 18339 18340 18341 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18332 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_DMatch::empty()
18377 18378 18379 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18377 def empty() Rbind::vector_d_match_empty( self) end |
#front ⇒ Object
wrapper for cv::DMatch vector_DMatch::front()
18403 18404 18405 18406 18407 18408 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18403 def front() result = Rbind::vector_d_match_front( self) # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__? result end |
#pop_back ⇒ Object
wrapper for void vector_DMatch::pop_back()
18429 18430 18431 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18429 def pop_back() Rbind::vector_d_match_pop_back( self) end |
#push_back(other) ⇒ Object
wrapper for void vector_DMatch::push_back(const cv::DMatch other)
18424 18425 18426 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18424 def push_back(other) Rbind::vector_d_match_push_back( self, other) end |
#reserve(size) ⇒ Object
wrapper for void vector_DMatch::reserve(size_t size)
18382 18383 18384 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18382 def reserve(size) Rbind::vector_d_match_reserve( self, size) end |
#resize(size, val = cv::DMatch) ⇒ Object
methods wrapper for void vector_DMatch::resize(size_t size, const cv::DMatch val=cv::DMatch)
18362 18363 18364 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18362 def resize(size, val = cv::DMatch) Rbind::vector_d_match_resize( self, size, val) end |
#size ⇒ Object
wrapper for size_t vector_DMatch::size()
18367 18368 18369 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18367 def size() Rbind::vector_d_match_size( self) end |
#swap(other) ⇒ Object
wrapper for void vector_DMatch::swap(vector_DMatch other)
18434 18435 18436 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18434 def swap(other) Rbind::vector_d_match_swap( self, other) end |