Class: OpenCV::Cvflann::FlannDistanceT

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

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



15347
15348
15349
15350
15351
15352
15353
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15347

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



15344
15345
15346
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15344

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



15339
15340
15341
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15339

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


15308
15309
15310
15311
15312
15313
15314
15315
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15308

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



15327
15328
15329
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15327

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



15318
15319
15320
15321
15322
15323
15324
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15318

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



15333
15334
15335
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15333

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)


15358
15359
15360
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15358

def __owner__?
    @__obj_ptr__[:bowner]
end