Class: OpenCV::Cv::Ptr::Cv_Algorithm

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

Specializing collapse

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



15295
15296
15297
15298
# File 'lib/ropencv/ropencv_types.rb', line 15295

def method_missing(m,*args)
    raise "Ptr cv::Ptr is empty. Cannot call #{m} on it!" if empty
    obj.method(m).call(*args)
end

Class Method Details

.new(*args) ⇒ Object

Parameters:

Raises:

  • (ArgumentError)


15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
# File 'lib/ropencv/ropencv_types.rb', line 15156

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Ptr::Cv_AlgorithmStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # overloaded method wrapper for cv::Ptr<cv::Algorithm>::Ptr<cv::Algorithm>(cv::Ptr<cv::Algorithm> other)
    @@cv_ptr_cv_algorithm_ptr_cv_algorithm_defaults0 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@cv_ptr_cv_algorithm_ptr_cv_algorithm_defaults0[i]
        end
        begin
                return Rbind::cv_ptr_cv_algorithm_ptr_cv_algorithm(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end

.nullObject

returns a null pointer to the object



15151
15152
15153
# File 'lib/ropencv/ropencv_types.rb', line 15151

def self.null
    new(Ptr::Cv_AlgorithmStruct.new)
end

Instance Method Details

#addrefVoid

Note:

method wrapper for void cv::Ptrcv::Algorithm::addref()

methods

Returns:

  • (Void)


15253
15254
15255
15256
# File 'lib/ropencv/ropencv_types.rb', line 15253

def addref()
    __validate_pointer__
    Rbind::cv_ptr_cv_algorithm_addref( self)
end

#delete_objVoid

Note:

method wrapper for void cv::Ptrcv::Algorithm::delete_obj()

Returns:

  • (Void)


15267
15268
15269
15270
# File 'lib/ropencv/ropencv_types.rb', line 15267

def delete_obj()
    __validate_pointer__
    Rbind::cv_ptr_cv_algorithm_delete_obj( self)
end

#emptyBool

Note:

method wrapper for bool cv::Ptrcv::Algorithm::empty()

Returns:

  • (Bool)


15274
15275
15276
15277
# File 'lib/ropencv/ropencv_types.rb', line 15274

def empty()
    __validate_pointer__
    Rbind::cv_ptr_cv_algorithm_empty( self)
end

#objCv::Algorithm Also known as: get_obj

Note:

method wrapper for cv::Algorithm* obj

Returns:



15281
15282
15283
15284
15285
15286
15287
15288
15289
# File 'lib/ropencv/ropencv_types.rb', line 15281

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

#releaseVoid

Note:

method wrapper for void cv::Ptrcv::Algorithm::release()

Returns:

  • (Void)


15260
15261
15262
15263
# File 'lib/ropencv/ropencv_types.rb', line 15260

def release()
    __validate_pointer__
    Rbind::cv_ptr_cv_algorithm_release( self)
end

#to_sObject

converts Ptr::Cv_Algorithm into a string by crawling through all its attributes



15242
15243
15244
# File 'lib/ropencv/ropencv_types.rb', line 15242

def to_s
    "#<cv::Ptr<cv::Algorithm> obj=#{self.obj}>"
end