Class: OpenCV::PtrDescriptorMatcher
- Inherits:
-
Object
- Object
- OpenCV::PtrDescriptorMatcher
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ruby/ropencv/ropencv_types.rb
Instance Attribute Summary collapse
- #__obj_ptr__ ⇒ Object readonly private
Sepcializing collapse
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
-
#__owner__? ⇒ Boolean
private
returns true if the underlying pointer is owner of the real object.
-
#addref ⇒ Object
methods wrapper for void Ptr_DescriptorMatcher::addref().
-
#delete_obj ⇒ Object
wrapper for void Ptr_DescriptorMatcher::delete_obj().
-
#empty ⇒ Object
wrapper for bool Ptr_DescriptorMatcher::empty().
-
#initialize(ptr) ⇒ PtrDescriptorMatcher
constructor
private
A new instance of PtrDescriptorMatcher.
-
#obj ⇒ Object
wrapper for const cv::DescriptorMatcher *obj.
-
#release ⇒ Object
wrapper for void Ptr_DescriptorMatcher::release().
Constructor Details
#initialize(ptr) ⇒ PtrDescriptorMatcher
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 PtrDescriptorMatcher.
18728 18729 18730 18731 18732 18733 18734 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18728 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? PtrDescriptorMatcherStruct ptr else PtrDescriptorMatcherStruct.new(FFI::AutoPointer.new(ptr,PtrDescriptorMatcherStruct.method(:release))) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
18744 18745 18746 18747 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18744 def method_missing(m,*args) raise "Ptr #<Rbind::RPtr:0x007f84c21e9b20> is empty. Cannot call #{m} on it!" if empty obj.method(m).call(*args) 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.
18725 18726 18727 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18725 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
18720 18721 18722 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18720 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
18677 18678 18679 18680 18681 18682 18683 18684 18685 18686 18687 18688 18689 18690 18691 18692 18693 18694 18695 18696 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18677 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(PtrDescriptorMatcherStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for Ptr_DescriptorMatcher::Ptr_DescriptorMatcher(const Ptr_DescriptorMatcher other) @@ptr_descriptor_matcher_ptr_descriptor_matcher_defaults0 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@ptr_descriptor_matcher_ptr_descriptor_matcher_defaults0[i] end begin return Rbind::ptr_descriptor_matcher_ptr_descriptor_matcher(*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.
18708 18709 18710 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18708 def self.rbind_from_native(ptr,context) PtrDescriptorMatcher.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.
18699 18700 18701 18702 18703 18704 18705 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18699 def self.rbind_to_native(obj,context) if obj.is_a? PtrDescriptorMatcher 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
18714 18715 18716 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18714 def self.to_native(obj,context) rbind_to_native(obj,context) end |
Instance Method Details
#__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
18739 18740 18741 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18739 def __owner__? @__obj_ptr__[:bowner] end |
#addref ⇒ Object
methods wrapper for void Ptr_DescriptorMatcher::addref()
18757 18758 18759 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18757 def addref() Rbind::ptr_descriptor_matcher_addref( self) end |
#delete_obj ⇒ Object
wrapper for void Ptr_DescriptorMatcher::delete_obj()
18767 18768 18769 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18767 def delete_obj() Rbind::ptr_descriptor_matcher_delete_obj( self) end |
#empty ⇒ Object
wrapper for bool Ptr_DescriptorMatcher::empty()
18772 18773 18774 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18772 def empty() Rbind::ptr_descriptor_matcher_empty( self) end |
#obj ⇒ Object
wrapper for const cv::DescriptorMatcher *obj
18777 18778 18779 18780 18781 18782 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18777 def obj() result = Rbind::ptr_descriptor_matcher_get_obj( 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 |
#release ⇒ Object
wrapper for void Ptr_DescriptorMatcher::release()
18762 18763 18764 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18762 def release() Rbind::ptr_descriptor_matcher_release( self) end |