Class: OpenCV::CvStatModel
- Inherits:
-
Object
- Object
- OpenCV::CvStatModel
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ruby/ropencv/ropencv_types.rb
Instance Attribute Summary collapse
- #__obj_ptr__ ⇒ Object readonly private
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.
-
#initialize(ptr) ⇒ CvStatModel
constructor
private
A new instance of CvStatModel.
-
#load(filename, name = 0) ⇒ Object
wrapper for void CvStatModel::load(c_string filename, c_string name=0).
-
#save(filename, name = 0) ⇒ Object
methods wrapper for void CvStatModel::save(c_string filename, c_string name=0).
Constructor Details
#initialize(ptr) ⇒ CvStatModel
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 CvStatModel.
19543 19544 19545 19546 19547 19548 19549 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19543 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? CvStatModelStruct ptr else CvStatModelStruct.new(FFI::AutoPointer.new(ptr,CvStatModelStruct.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.
19540 19541 19542 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19540 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
19535 19536 19537 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19535 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
19504 19505 19506 19507 19508 19509 19510 19511 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19504 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(CvStatModelStruct) 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.
19523 19524 19525 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19523 def self.rbind_from_native(ptr,context) CvStatModel.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.
19514 19515 19516 19517 19518 19519 19520 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19514 def self.rbind_to_native(obj,context) if obj.is_a? CvStatModel 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
19529 19530 19531 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19529 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
19554 19555 19556 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19554 def __owner__? @__obj_ptr__[:bowner] end |
#load(filename, name = 0) ⇒ Object
wrapper for void CvStatModel::load(c_string filename, c_string name=0)
19573 19574 19575 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19573 def load(filename, name = 0) Rbind::cv_stat_model_load( self, filename, name) end |
#save(filename, name = 0) ⇒ Object
methods wrapper for void CvStatModel::save(c_string filename, c_string name=0)
19568 19569 19570 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 19568 def save(filename, name = 0) Rbind::cv_stat_model_save( self, filename, name) end |