Class: OpenCV::Cv::Flann::IndexParams

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ IndexParams

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



5766
5767
5768
5769
5770
5771
5772
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5766

def initialize(ptr)
    @__obj_ptr__ = if ptr.is_a? IndexParamsStruct
                       ptr
                   else
                       IndexParamsStruct.new(FFI::AutoPointer.new(ptr,IndexParamsStruct.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.



5763
5764
5765
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5763

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



5758
5759
5760
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5758

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


5727
5728
5729
5730
5731
5732
5733
5734
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5727

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(IndexParamsStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    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.



5746
5747
5748
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5746

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



5737
5738
5739
5740
5741
5742
5743
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5737

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



5752
5753
5754
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5752

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)


5777
5778
5779
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5777

def __owner__?
    @__obj_ptr__[:bowner]
end