Class: OpenCV::Cv::DMatch

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

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



11470
11471
11472
11473
11474
11475
11476
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11470

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



11467
11468
11469
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11467

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



11462
11463
11464
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11462

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11393

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(DMatchStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::DMatch::DMatch()
    @@cv_d_match_d_match_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        args.size.upto(-1) do |i|
            args[i] = @@cv_d_match_d_match_defaults0[i]
        end
        begin
            return Rbind::cv_d_match_d_match(*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::DMatch::DMatch(int _queryIdx, int _trainIdx, float _distance)
    @@cv_d_match_d_match2_defaults1 ||= [nil, nil, nil]
    if(args.size >= 3 && args.size <= 3)
        args.size.upto(2) do |i|
            args[i] = @@cv_d_match_d_match2_defaults1[i]
        end
        begin
            return Rbind::cv_d_match_d_match2(*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::DMatch::DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance)
    @@cv_d_match_d_match3_defaults2 ||= [nil, nil, nil, nil]
    if(args.size >= 4 && args.size <= 4)
        args.size.upto(3) do |i|
            args[i] = @@cv_d_match_d_match3_defaults2[i]
        end
        begin
            return Rbind::cv_d_match_d_match3(*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.



11450
11451
11452
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11450

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



11441
11442
11443
11444
11445
11446
11447
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11441

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



11456
11457
11458
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11456

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)


11481
11482
11483
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11481

def __owner__?
    @__obj_ptr__[:bowner]
end

#distanceObject

wrapper for float distance



11525
11526
11527
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11525

def distance()
    Rbind::cv_d_match_get_distance( self)
end

#distance=(value) ⇒ Object

wrapper for float distance



11530
11531
11532
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11530

def distance=(value)
    Rbind::cv_d_match_set_distance( self, value)
end

#img_idxObject

wrapper for int imgIdx



11515
11516
11517
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11515

def img_idx()
    Rbind::cv_d_match_get_img_idx( self)
end

#img_idx=(value) ⇒ Object

wrapper for int imgIdx



11520
11521
11522
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11520

def img_idx=(value)
    Rbind::cv_d_match_set_img_idx( self, value)
end

#query_idxObject

methods wrapper for int queryIdx



11495
11496
11497
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11495

def query_idx()
    Rbind::cv_d_match_get_query_idx( self)
end

#query_idx=(value) ⇒ Object

wrapper for int queryIdx



11500
11501
11502
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11500

def query_idx=(value)
    Rbind::cv_d_match_set_query_idx( self, value)
end

#train_idxObject

wrapper for int trainIdx



11505
11506
11507
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11505

def train_idx()
    Rbind::cv_d_match_get_train_idx( self)
end

#train_idx=(value) ⇒ Object

wrapper for int trainIdx



11510
11511
11512
# File 'lib/ruby/ropencv/ropencv_types.rb', line 11510

def train_idx=(value)
    Rbind::cv_d_match_set_train_idx( self, value)
end