Class: OpenCV::PtrFaceRecognizer
- Inherits:
-
Object
- Object
- OpenCV::PtrFaceRecognizer
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ruby/ropencv/ropencv_types.rb
Instance Attribute Summary collapse
- #__obj_ptr__ ⇒ Object readonly private
Sepcializing collapse
Class Method Summary collapse
-
.from_native(ptr, context) ⇒ Object
private
can be overwritten by the user.
- .new(*args) ⇒ Object
- .rbind_from_native(ptr, context) ⇒ Object private
- .rbind_to_native(obj, context) ⇒ Object private
-
.to_native(obj, context) ⇒ Object
private
can be overwritten by the user.
Instance Method Summary collapse
-
#__owner__? ⇒ Boolean
private
returns true if the underlying pointer is owner of the real object.
-
#addref ⇒ Object
methods wrapper for void Ptr_FaceRecognizer::addref().
-
#delete_obj ⇒ Object
wrapper for void Ptr_FaceRecognizer::delete_obj().
-
#empty ⇒ Object
wrapper for bool Ptr_FaceRecognizer::empty().
-
#initialize(ptr) ⇒ PtrFaceRecognizer
constructor
private
A new instance of PtrFaceRecognizer.
-
#obj ⇒ Object
wrapper for const cv::FaceRecognizer *obj.
-
#release ⇒ Object
wrapper for void Ptr_FaceRecognizer::release().
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
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
22246 22247 22248 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 22246 def __owner__? @__obj_ptr__[:bowner] end |
#addref ⇒ Object
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_obj ⇒ Object
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 |
#empty ⇒ Object
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 |
#obj ⇒ Object
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 |
#release ⇒ Object
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 |