Class: OpenCV::PtrFaceRecognizer

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

Instance Attribute Summary collapse

Sepcializing collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ PtrFaceRecognizer

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



22235
22236
22237
22238
22239
22240
22241
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22235

def initialize(ptr)
    @__obj_ptr__ = if ptr.is_a? PtrFaceRecognizerStruct
                       ptr
                   else
                       PtrFaceRecognizerStruct.new(FFI::AutoPointer.new(ptr,PtrFaceRecognizerStruct.method(:release)))
                   end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



22251
22252
22253
22254
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22251

def method_missing(m,*args)
    raise "Ptr #<Rbind::RPtr:0x007f84c228d6f8> is empty. Cannot call #{m} on it!" if empty
    obj.method(m).call(*args)
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.



22232
22233
22234
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22232

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



22227
22228
22229
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22227

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

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22184

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(PtrFaceRecognizerStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for Ptr_FaceRecognizer::Ptr_FaceRecognizer(const Ptr_FaceRecognizer other)
    @@ptr_face_recognizer_ptr_face_recognizer_defaults0 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@ptr_face_recognizer_ptr_face_recognizer_defaults0[i]
        end
        begin
            return Rbind::ptr_face_recognizer_ptr_face_recognizer(*args)
        rescue TypeError => e
            @error = e
        end
    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.



22215
22216
22217
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22215

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



22206
22207
22208
22209
22210
22211
22212
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22206

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



22221
22222
22223
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22221

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)


22246
22247
22248
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22246

def __owner__?
    @__obj_ptr__[:bowner]
end

#addrefObject

methods wrapper for void Ptr_FaceRecognizer::addref()



22264
22265
22266
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22264

def addref()
    Rbind::ptr_face_recognizer_addref( self)
end

#delete_objObject

wrapper for void Ptr_FaceRecognizer::delete_obj()



22274
22275
22276
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22274

def delete_obj()
    Rbind::ptr_face_recognizer_delete_obj( self)
end

#emptyObject

wrapper for bool Ptr_FaceRecognizer::empty()



22279
22280
22281
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22279

def empty()
    Rbind::ptr_face_recognizer_empty( self)
end

#objObject

wrapper for const cv::FaceRecognizer *obj



22284
22285
22286
22287
22288
22289
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22284

def obj()
    result = Rbind::ptr_face_recognizer_get_obj( 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

#releaseObject

wrapper for void Ptr_FaceRecognizer::release()



22269
22270
22271
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22269

def release()
    Rbind::ptr_face_recognizer_release( self)
end