Class: OpenCV::Cvflann::FlannAlgorithmT

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

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



15258
15259
15260
15261
15262
15263
15264
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15258

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



15255
15256
15257
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15255

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



15250
15251
15252
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15250

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


15219
15220
15221
15222
15223
15224
15225
15226
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15219

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



15238
15239
15240
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15238

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



15229
15230
15231
15232
15233
15234
15235
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15229

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



15244
15245
15246
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15244

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)


15269
15270
15271
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15269

def __owner__?
    @__obj_ptr__[:bowner]
end