Class: OpenCV::PtrFlannIndexParams

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) ⇒ PtrFlannIndexParams

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



18861
18862
18863
18864
18865
18866
18867
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18861

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



18877
18878
18879
18880
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18877

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



18858
18859
18860
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18858

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



18853
18854
18855
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18853

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18810

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



18841
18842
18843
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18841

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



18832
18833
18834
18835
18836
18837
18838
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18832

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



18847
18848
18849
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18847

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)


18872
18873
18874
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18872

def __owner__?
    @__obj_ptr__[:bowner]
end

#addrefObject

methods wrapper for void Ptr_flann_IndexParams::addref()



18890
18891
18892
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18890

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

#delete_objObject

wrapper for void Ptr_flann_IndexParams::delete_obj()



18900
18901
18902
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18900

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

#emptyObject

wrapper for bool Ptr_flann_IndexParams::empty()



18905
18906
18907
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18905

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

#objObject

wrapper for const cv::flann::IndexParams *obj



18910
18911
18912
18913
18914
18915
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18910

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



18895
18896
18897
# File 'lib/ruby/ropencv/ropencv_types.rb', line 18895

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