Class: OpenCV::Cv::Point3f

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Raises:

  • (ArgumentError)


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

Returns:

  • (Boolean)


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

#xObject

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

#yObject

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

#zObject

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