Class: OpenCV::PtrDescriptorExtractor

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Defined in:
lib/ruby/ropencv/ropencv_types.rb

Instance Attribute Summary collapse

Sepcializing collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ PtrDescriptorExtractor

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 PtrDescriptorExtractor.



17823
17824
17825
17826
17827
17828
17829
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17823

def initialize(ptr)
    @__obj_ptr__ = if ptr.is_a? PtrDescriptorExtractorStruct
                       ptr
                   else
                       PtrDescriptorExtractorStruct.new(FFI::AutoPointer.new(ptr,PtrDescriptorExtractorStruct.method(:release)))
                   end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



17839
17840
17841
17842
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17839

def method_missing(m,*args)
    raise "Ptr #<Rbind::RPtr:0x007f84c21865e8> 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.



17820
17821
17822
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17820

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



17815
17816
17817
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17815

def self.from_native(ptr,context)
    rbind_from_native(ptr,context)
end

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17772

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(PtrDescriptorExtractorStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for Ptr_DescriptorExtractor::Ptr_DescriptorExtractor(const Ptr_DescriptorExtractor other)
    @@ptr_descriptor_extractor_ptr_descriptor_extractor_defaults0 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@ptr_descriptor_extractor_ptr_descriptor_extractor_defaults0[i]
        end
        begin
            return Rbind::ptr_descriptor_extractor_ptr_descriptor_extractor(*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.



17803
17804
17805
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17803

def self.rbind_from_native(ptr,context)
    PtrDescriptorExtractor.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.



17794
17795
17796
17797
17798
17799
17800
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17794

def self.rbind_to_native(obj,context)
    if obj.is_a? PtrDescriptorExtractor
        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



17809
17810
17811
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17809

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

Returns:

  • (Boolean)


17834
17835
17836
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17834

def __owner__?
    @__obj_ptr__[:bowner]
end

#addrefObject

methods wrapper for void Ptr_DescriptorExtractor::addref()



17852
17853
17854
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17852

def addref()
    Rbind::ptr_descriptor_extractor_addref( self)
end

#delete_objObject

wrapper for void Ptr_DescriptorExtractor::delete_obj()



17862
17863
17864
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17862

def delete_obj()
    Rbind::ptr_descriptor_extractor_delete_obj( self)
end

#emptyObject

wrapper for bool Ptr_DescriptorExtractor::empty()



17867
17868
17869
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17867

def empty()
    Rbind::ptr_descriptor_extractor_empty( self)
end

#objObject

wrapper for const cv::DescriptorExtractor *obj



17872
17873
17874
17875
17876
17877
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17872

def obj()
    result = Rbind::ptr_descriptor_extractor_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

#releaseObject

wrapper for void Ptr_DescriptorExtractor::release()



17857
17858
17859
# File 'lib/ruby/ropencv/ropencv_types.rb', line 17857

def release()
    Rbind::ptr_descriptor_extractor_release( self)
end