Class: OpenCV::Cv::Point3f
- Inherits:
-
Object
- Object
- OpenCV::Cv::Point3f
- 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
-
#+(pt) ⇒ Object
wrapper for void cv::Point3f::operator+(const cv::Point3f pt).
-
#__owner__? ⇒ Boolean
private
returns true if the underlying pointer is owner of the real object.
-
#cross(pt) ⇒ Object
wrapper for cv::Point3f cv::Point3f::cross(const cv::Point3f pt).
-
#ddot(pt) ⇒ Object
wrapper for double cv::Point3f::ddot(const cv::Point3f pt).
-
#dot(pt) ⇒ Object
wrapper for float cv::Point3f::dot(const cv::Point3f pt).
-
#initialize(ptr) ⇒ Point3f
constructor
private
A new instance of Point3f.
-
#x ⇒ Object
methods wrapper for float x.
-
#x=(value) ⇒ Object
wrapper for float x.
-
#y ⇒ Object
wrapper for float y.
-
#y=(value) ⇒ Object
wrapper for float y.
-
#z ⇒ Object
wrapper for float z.
-
#z=(value) ⇒ Object
wrapper for float z.
Constructor Details
#initialize(ptr) ⇒ Point3f
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 Point3f.
3779 3780 3781 3782 3783 3784 3785 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3779 def initialize(ptr) @__obj_ptr__ = if ptr.is_a? Point3fStruct ptr else Point3fStruct.new(FFI::AutoPointer.new(ptr,Point3fStruct.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.
3776 3777 3778 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3776 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
3771 3772 3773 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3771 def self.from_native(ptr,context) rbind_from_native(ptr,context) end |
.new(*args) ⇒ Object
3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3715 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Point3fStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # wrapper for cv::Point3f::Point3f(float x, float y, float z) @@cv_point_3f_point_3f_defaults0 ||= [nil, nil, nil] if(args.size >= 3 && args.size <= 3) args.size.upto(2) do |i| args[i] = @@cv_point_3f_point_3f_defaults0[i] end begin return Rbind::cv_point_3f_point_3f(*args) rescue TypeError => e @error = e end end # wrapper for cv::Point3f::Point3f(const cv::Point3f pt) @@cv_point_3f_point_3f2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) args.size.upto(0) do |i| args[i] = @@cv_point_3f_point_3f2_defaults1[i] end begin return Rbind::cv_point_3f_point_3f2(*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.
3759 3760 3761 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3759 def self.rbind_from_native(ptr,context) Point3f.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.
3750 3751 3752 3753 3754 3755 3756 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3750 def self.rbind_to_native(obj,context) if obj.is_a? Point3f 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
3765 3766 3767 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3765 def self.to_native(obj,context) rbind_to_native(obj,context) end |
Instance Method Details
#+(pt) ⇒ Object
wrapper for void cv::Point3f::operator+(const cv::Point3f pt)
3852 3853 3854 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3852 def +(pt) Rbind::cv_point_3f_operator_plus( self, pt) end |
#__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
3790 3791 3792 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3790 def __owner__? @__obj_ptr__[:bowner] end |
#cross(pt) ⇒ Object
wrapper for cv::Point3f cv::Point3f::cross(const cv::Point3f pt)
3844 3845 3846 3847 3848 3849 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3844 def cross(pt) result = Rbind::cv_point_3f_cross( self, pt) # 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 |
#ddot(pt) ⇒ Object
wrapper for double cv::Point3f::ddot(const cv::Point3f pt)
3839 3840 3841 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3839 def ddot(pt) Rbind::cv_point_3f_ddot( self, pt) end |
#dot(pt) ⇒ Object
wrapper for float cv::Point3f::dot(const cv::Point3f pt)
3834 3835 3836 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3834 def dot(pt) Rbind::cv_point_3f_dot( self, pt) end |
#x ⇒ Object
methods wrapper for float x
3804 3805 3806 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3804 def x() Rbind::cv_point_3f_getx( self) end |
#x=(value) ⇒ Object
wrapper for float x
3809 3810 3811 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3809 def x=(value) Rbind::cv_point_3f_setx( self, value) end |
#y ⇒ Object
wrapper for float y
3814 3815 3816 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3814 def y() Rbind::cv_point_3f_gety( self) end |
#y=(value) ⇒ Object
wrapper for float y
3819 3820 3821 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3819 def y=(value) Rbind::cv_point_3f_sety( self, value) end |
#z ⇒ Object
wrapper for float z
3824 3825 3826 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3824 def z() Rbind::cv_point_3f_getz( self) end |
#z=(value) ⇒ Object
wrapper for float z
3829 3830 3831 |
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3829 def z=(value) Rbind::cv_point_3f_setz( self, value) end |