Class: OpenCV::CvSlice
- Inherits:
-
Object
- Object
- OpenCV::CvSlice
- 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) ⇒ CvSlice
constructor
private
A new instance of CvSlice.
Constructor Details
#initialize(ptr) ⇒ CvSlice
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 CvSlice.
15162 15163 15164 15165 15166 15167 15168 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15162 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? CvSliceStruct ptr else CvSliceStruct.new(FFI::AutoPointer.new(ptr,CvSliceStruct.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.
15159 15160 15161 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15159 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
15154 15155 15156 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15154 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
15123 15124 15125 15126 15127 15128 15129 15130 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15123 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(CvSliceStruct) 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.
15142 15143 15144 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15142 def self.rbind_from_native(ptr,context) CvSlice.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.
15133 15134 15135 15136 15137 15138 15139 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15133 def self.rbind_to_native(obj,context) if obj.is_a? CvSlice 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
15148 15149 15150 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15148 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
15173 15174 15175 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 15173 def __owner__? @__obj_ptr__[:bowner] end |