Class: OpenCV::PtrFeatureDetector
- Inherits:
-
Object
- Object
- OpenCV::PtrFeatureDetector
- 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_FeatureDetector::addref().
-
#delete_obj ⇒ Object
wrapper for void Ptr_FeatureDetector::delete_obj().
-
#empty ⇒ Object
wrapper for bool Ptr_FeatureDetector::empty().
-
#initialize(ptr) ⇒ PtrFeatureDetector
constructor
private
A new instance of PtrFeatureDetector.
-
#obj ⇒ Object
wrapper for const cv::FeatureDetector *obj.
-
#release ⇒ Object
wrapper for void Ptr_FeatureDetector::release().
Constructor Details
#initialize(ptr) ⇒ PtrFeatureDetector
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 PtrFeatureDetector.
17690 17691 17692 17693 17694 17695 17696 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17690 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? PtrFeatureDetectorStruct ptr else PtrFeatureDetectorStruct.new(FFI::AutoPointer.new(ptr,PtrFeatureDetectorStruct.method(:release))) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
17706 17707 17708 17709 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17706 def method_missing(m,*args) raise "Ptr #<Rbind::RPtr:0x007f84c21e7e60> 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.
17687 17688 17689 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17687 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
17682 17683 17684 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17682 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
17639 17640 17641 17642 17643 17644 17645 17646 17647 17648 17649 17650 17651 17652 17653 17654 17655 17656 17657 17658 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17639 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(PtrFeatureDetectorStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for Ptr_FeatureDetector::Ptr_FeatureDetector(const Ptr_FeatureDetector other) @@ptr_feature_detector_ptr_feature_detector_defaults0 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@ptr_feature_detector_ptr_feature_detector_defaults0[i] end begin return Rbind::ptr_feature_detector_ptr_feature_detector(*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.
17670 17671 17672 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17670 def self.rbind_from_native(ptr,context) PtrFeatureDetector.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.
17661 17662 17663 17664 17665 17666 17667 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17661 def self.rbind_to_native(obj,context) if obj.is_a? PtrFeatureDetector 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
17676 17677 17678 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17676 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
17701 17702 17703 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17701 def __owner__? @__obj_ptr__[:bowner] end |
#addref ⇒ Object
methods wrapper for void Ptr_FeatureDetector::addref()
17719 17720 17721 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17719 def addref() Rbind::ptr_feature_detector_addref( self) end |
#delete_obj ⇒ Object
wrapper for void Ptr_FeatureDetector::delete_obj()
17729 17730 17731 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17729 def delete_obj() Rbind::ptr_feature_detector_delete_obj( self) end |
#empty ⇒ Object
wrapper for bool Ptr_FeatureDetector::empty()
17734 17735 17736 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17734 def empty() Rbind::ptr_feature_detector_empty( self) end |
#obj ⇒ Object
wrapper for const cv::FeatureDetector *obj
17739 17740 17741 17742 17743 17744 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17739 def obj() result = Rbind::ptr_feature_detector_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_FeatureDetector::release()
17724 17725 17726 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17724 def release() Rbind::ptr_feature_detector_release( self) end |