Class: OpenCV::Cv::TermCriteria

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

Constants collapse

COUNT =
1
MAX_ITER =
COUNT
EPS =
2

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ TermCriteria

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



5667
5668
5669
5670
5671
5672
5673
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5667

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



5664
5665
5666
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5664

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



5659
5660
5661
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5659

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


5628
5629
5630
5631
5632
5633
5634
5635
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5628

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



5647
5648
5649
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5647

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



5638
5639
5640
5641
5642
5643
5644
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5638

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



5653
5654
5655
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5653

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)


5678
5679
5680
# File 'lib/ruby/ropencv/ropencv_types.rb', line 5678

def __owner__?
    @__obj_ptr__[:bowner]
end