Class: OpenCV::CvTermCriteria

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

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



14984
14985
14986
14987
14988
14989
14990
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14984

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



14981
14982
14983
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14981

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



14976
14977
14978
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14976

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


14945
14946
14947
14948
14949
14950
14951
14952
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14945

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



14964
14965
14966
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14964

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



14955
14956
14957
14958
14959
14960
14961
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14955

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



14970
14971
14972
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14970

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)


14995
14996
14997
# File 'lib/ruby/ropencv/ropencv_types.rb', line 14995

def __owner__?
    @__obj_ptr__[:bowner]
end