Class: OpenCV::CvSVMParams

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

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



20040
20041
20042
20043
20044
20045
20046
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20040

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



20037
20038
20039
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20037

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



20032
20033
20034
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20032

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


20001
20002
20003
20004
20005
20006
20007
20008
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20001

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



20020
20021
20022
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20020

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



20011
20012
20013
20014
20015
20016
20017
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20011

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



20026
20027
20028
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20026

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)


20051
20052
20053
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20051

def __owner__?
    @__obj_ptr__[:bowner]
end

#cObject

wrapper for double C



20115
20116
20117
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20115

def c()
    Rbind::cvsvm_params_get_c( self)
end

#c=(value) ⇒ Object

wrapper for double C



20120
20121
20122
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20120

def c=(value)
    Rbind::cvsvm_params_set_c( self, value)
end

#coef0Object

wrapper for double coef0



20105
20106
20107
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20105

def coef0()
    Rbind::cvsvm_params_get_coef0( self)
end

#coef0=(value) ⇒ Object

wrapper for double coef0



20110
20111
20112
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20110

def coef0=(value)
    Rbind::cvsvm_params_set_coef0( self, value)
end

#degreeObject

wrapper for double degree



20085
20086
20087
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20085

def degree()
    Rbind::cvsvm_params_get_degree( self)
end

#degree=(value) ⇒ Object

wrapper for double degree



20090
20091
20092
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20090

def degree=(value)
    Rbind::cvsvm_params_set_degree( self, value)
end

#gammaObject

wrapper for double gamma



20095
20096
20097
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20095

def gamma()
    Rbind::cvsvm_params_get_gamma( self)
end

#gamma=(value) ⇒ Object

wrapper for double gamma



20100
20101
20102
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20100

def gamma=(value)
    Rbind::cvsvm_params_set_gamma( self, value)
end

#kernel_typeObject

wrapper for int kernel_type



20075
20076
20077
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20075

def kernel_type()
    Rbind::cvsvm_params_get_kernel_type( self)
end

#kernel_type=(value) ⇒ Object

wrapper for int kernel_type



20080
20081
20082
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20080

def kernel_type=(value)
    Rbind::cvsvm_params_set_kernel_type( self, value)
end

#nuObject

wrapper for double nu



20125
20126
20127
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20125

def nu()
    Rbind::cvsvm_params_get_nu( self)
end

#nu=(value) ⇒ Object

wrapper for double nu



20130
20131
20132
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20130

def nu=(value)
    Rbind::cvsvm_params_set_nu( self, value)
end

#pObject

wrapper for double p



20135
20136
20137
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20135

def p()
    Rbind::cvsvm_params_getp( self)
end

#p=(value) ⇒ Object

wrapper for double p



20140
20141
20142
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20140

def p=(value)
    Rbind::cvsvm_params_setp( self, value)
end

#svm_typeObject

methods wrapper for int svm_type



20065
20066
20067
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20065

def svm_type()
    Rbind::cvsvm_params_get_svm_type( self)
end

#svm_type=(value) ⇒ Object

wrapper for int svm_type



20070
20071
20072
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20070

def svm_type=(value)
    Rbind::cvsvm_params_set_svm_type( self, value)
end

#term_critObject

wrapper for CvTermCriteria term_crit



20145
20146
20147
20148
20149
20150
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20145

def term_crit()
    result = Rbind::cvsvm_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



20153
20154
20155
# File 'lib/ruby/ropencv/ropencv_types.rb', line 20153

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