Class: OpenCV::VectorKeyPoint
- Inherits:
-
Object
- Object
- OpenCV::VectorKeyPoint
- 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::KeyPoint vector_KeyPoint::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::KeyPoint vector_KeyPoint::at(size_t size).
-
#back ⇒ Object
wrapper for cv::KeyPoint vector_KeyPoint::back().
-
#capacity ⇒ Object
wrapper for size_t vector_KeyPoint::capacity().
-
#data ⇒ Object
wrapper for void * vector_KeyPoint::data().
- #each(&block) ⇒ Object
-
#empty ⇒ Object
wrapper for bool vector_KeyPoint::empty().
-
#front ⇒ Object
wrapper for cv::KeyPoint vector_KeyPoint::front().
-
#initialize(ptr) ⇒ VectorKeyPoint
constructor
private
A new instance of VectorKeyPoint.
-
#pop_back ⇒ Object
wrapper for void vector_KeyPoint::pop_back().
-
#push_back(other) ⇒ Object
wrapper for void vector_KeyPoint::push_back(const cv::KeyPoint other).
-
#reserve(size) ⇒ Object
wrapper for void vector_KeyPoint::reserve(size_t size).
-
#resize(size, val = cv::KeyPoint) ⇒ Object
methods wrapper for void vector_KeyPoint::resize(size_t size, const cv::KeyPoint val=cv::KeyPoint).
-
#size ⇒ Object
wrapper for size_t vector_KeyPoint::size().
-
#swap(other) ⇒ Object
wrapper for void vector_KeyPoint::swap(vector_KeyPoint other).
Constructor Details
#initialize(ptr) ⇒ VectorKeyPoint
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 VectorKeyPoint.
17490 17491 17492 17493 17494 17495 17496 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17490 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? VectorKeyPointStruct ptr else VectorKeyPointStruct.new(FFI::AutoPointer.new(ptr,VectorKeyPointStruct.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.
17487 17488 17489 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17487 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
17482 17483 17484 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17482 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
17426 17427 17428 17429 17430 17431 17432 17433 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17458 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17426 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(VectorKeyPointStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for vector_KeyPoint::vector_KeyPoint() @@vector_key_point_vector_key_point_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) args.size.upto(-1) do |i| args[i] = @@vector_key_point_vector_key_point_defaults0[i] end begin return Rbind::vector_key_point_vector_key_point(*args) rescue TypeError => e @error = e end end # wrapper for vector_KeyPoint::vector_KeyPoint(const vector_KeyPoint other) @@vector_key_point_vector_key_point2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@vector_key_point_vector_key_point2_defaults1[i] end begin return Rbind::vector_key_point_vector_key_point2(*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.
17470 17471 17472 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17470 def self.rbind_from_native(ptr,context) VectorKeyPoint.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.
17461 17462 17463 17464 17465 17466 17467 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17461 def self.rbind_to_native(obj,context) if obj.is_a? VectorKeyPoint 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
17476 17477 17478 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17476 def self.to_native(obj,context) rbind_to_native(obj,context) end |
Instance Method Details
#<<(val) ⇒ Object
17517 17518 17519 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17517 def <<(val) push_back(val) end |
#[](size) ⇒ Object
wrapper for cv::KeyPoint vector_KeyPoint::operator[](size_t size)
17562 17563 17564 17565 17566 17567 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17562 def [](size) result = Rbind::vector_key_point_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
17501 17502 17503 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17501 def __owner__? @__obj_ptr__[:bowner] end |
#at(size) ⇒ Object
wrapper for cv::KeyPoint vector_KeyPoint::at(size_t size)
17570 17571 17572 17573 17574 17575 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17570 def at(size) result = Rbind::vector_key_point_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::KeyPoint vector_KeyPoint::back()
17586 17587 17588 17589 17590 17591 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17586 def back() result = Rbind::vector_key_point_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_KeyPoint::capacity()
17547 17548 17549 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17547 def capacity() Rbind::vector_key_point_capacity( self) end |
#data ⇒ Object
wrapper for void * vector_KeyPoint::data()
17594 17595 17596 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17594 def data() Rbind::vector_key_point_data( self) end |
#each(&block) ⇒ Object
17507 17508 17509 17510 17511 17512 17513 17514 17515 17516 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17507 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_KeyPoint::empty()
17552 17553 17554 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17552 def empty() Rbind::vector_key_point_empty( self) end |
#front ⇒ Object
wrapper for cv::KeyPoint vector_KeyPoint::front()
17578 17579 17580 17581 17582 17583 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17578 def front() result = Rbind::vector_key_point_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_KeyPoint::pop_back()
17604 17605 17606 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17604 def pop_back() Rbind::vector_key_point_pop_back( self) end |
#push_back(other) ⇒ Object
wrapper for void vector_KeyPoint::push_back(const cv::KeyPoint other)
17599 17600 17601 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17599 def push_back(other) Rbind::vector_key_point_push_back( self, other) end |
#reserve(size) ⇒ Object
wrapper for void vector_KeyPoint::reserve(size_t size)
17557 17558 17559 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17557 def reserve(size) Rbind::vector_key_point_reserve( self, size) end |
#resize(size, val = cv::KeyPoint) ⇒ Object
methods wrapper for void vector_KeyPoint::resize(size_t size, const cv::KeyPoint val=cv::KeyPoint)
17537 17538 17539 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17537 def resize(size, val = cv::KeyPoint) Rbind::vector_key_point_resize( self, size, val) end |
#size ⇒ Object
wrapper for size_t vector_KeyPoint::size()
17542 17543 17544 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17542 def size() Rbind::vector_key_point_size( self) end |
#swap(other) ⇒ Object
wrapper for void vector_KeyPoint::swap(vector_KeyPoint other)
17609 17610 17611 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17609 def swap(other) Rbind::vector_key_point_swap( self, other) end |