Class: OpenCV::CvRTParams

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

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



20702
20703
20704
20705
20706
20707
20708
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20702

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



20699
20700
20701
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20699

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



20694
20695
20696
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20694

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


20663
20664
20665
20666
20667
20668
20669
20670
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20663

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



20682
20683
20684
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20682

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



20673
20674
20675
20676
20677
20678
20679
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20673

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



20688
20689
20690
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20688

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)


20713
20714
20715
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20713

def __owner__?
    @__obj_ptr__[:bowner]
end

#calc_var_importanceObject

methods wrapper for bool calc_var_importance



20727
20728
20729
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20727

def calc_var_importance()
    Rbind::cvrt_params_get_calc_var_importance( self)
end

#calc_var_importance=(value) ⇒ Object

wrapper for bool calc_var_importance



20732
20733
20734
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20732

def calc_var_importance=(value)
    Rbind::cvrt_params_set_calc_var_importance( self, value)
end

#nactive_varsObject

wrapper for int nactive_vars



20737
20738
20739
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20737

def nactive_vars()
    Rbind::cvrt_params_get_nactive_vars( self)
end

#nactive_vars=(value) ⇒ Object

wrapper for int nactive_vars



20742
20743
20744
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20742

def nactive_vars=(value)
    Rbind::cvrt_params_set_nactive_vars( self, value)
end

#term_critObject

wrapper for CvTermCriteria term_crit



20747
20748
20749
20750
20751
20752
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20747

def term_crit()
    result = Rbind::cvrt_params_get_term_crit( self)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#term_crit=(value) ⇒ Object

wrapper for CvTermCriteria term_crit



20755
20756
20757
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20755

def term_crit=(value)
    Rbind::cvrt_params_set_term_crit( self, value)
end