Class: OpenCV::Cv::Flann::SearchParams

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

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



5855
5856
5857
5858
5859
5860
5861
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5855

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



5852
5853
5854
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5852

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



5847
5848
5849
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5847

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


5816
5817
5818
5819
5820
5821
5822
5823
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5816

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(SearchParamsStruct)
        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.



5835
5836
5837
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5835

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



5826
5827
5828
5829
5830
5831
5832
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5826

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



5841
5842
5843
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5841

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)


5866
5867
5868
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5866

def __owner__?
    @__obj_ptr__[:bowner]
end