Class: OpenCV::Cv::Vec3f

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Includes:
Vec3x, Vecxf
Defined in:
lib/ropencv/ropencv_ruby.rb,
lib/ropencv/ropencv_types.rb

Constant Summary collapse

SIZE =
3

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Vecxf

#[], #[]=, #to_a

Class Method Details

.vec_3fObject .vec_3f(other) ⇒ Object .vec_3f(_t0, _t1, _t2) ⇒ Object

Overloads:

  • .vec_3f(other) ⇒ Object

    Parameters:

  • .vec_3f(_t0, _t1, _t2) ⇒ Object

    Parameters:

    • _t0 (Float)
    • _t1 (Float)
    • _t2 (Float)

Raises:

  • (ArgumentError)


5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
# File 'lib/ropencv/ropencv_types.rb', line 5677

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vec3fStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # overloaded method wrapper for cv::Vec3f::Vec3f()
    @@cv_vec_3f_vec_3f_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        targs = args.clone
        targs.size.upto(-1) do |i|
            targs[i] = @@cv_vec_3f_vec_3f_defaults0[i]
        end
        begin
                return Rbind::cv_vec_3f_vec_3f(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for cv::Vec3f::Vec3f(cv::Vec3f other)
    @@cv_vec_3f_vec_3f2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@cv_vec_3f_vec_3f2_defaults1[i]
        end
        begin
                return Rbind::cv_vec_3f_vec_3f2(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for cv::Vec3f::Vec3f(float t0, float t1, float t2)
    @@cv_vec_3f_vec_3f3_defaults2 ||= [nil, nil, nil]
    if(args.size >= 3 && args.size <= 3)
        targs = args.clone
        targs.size.upto(2) do |i|
            targs[i] = @@cv_vec_3f_vec_3f3_defaults2[i]
        end
        begin
                return Rbind::cv_vec_3f_vec_3f3(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end

.nullObject

returns a null pointer to the object



5664
5665
5666
# File 'lib/ropencv/ropencv_types.rb', line 5664

def self.null
    new(Vec3fStruct.new)
end

Instance Method Details

#!=(vec) ⇒ Bool

Note:

method wrapper for bool cv::Vec3f::operator!=(cv::Vec3f vec)

Parameters:

Returns:

  • (Bool)


5845
5846
5847
5848
# File 'lib/ropencv/ropencv_types.rb', line 5845

def !=(vec)
    __validate_pointer__
    Rbind::cv_vec_3f_operator_unequal( self, vec)
end

#*(vec) ⇒ Cv::Vec3f

Note:

method wrapper for cv::Vec3f cv::Vec3f::operator*(float vec)

Parameters:

  • vec (Float)

Returns:



5869
5870
5871
5872
# File 'lib/ropencv/ropencv_types.rb', line 5869

def *(vec)
    __validate_pointer__
    Rbind::cv_vec_3f_operator_mult( self, vec)
end

#+(vec) ⇒ Cv::Vec3f

Note:

method wrapper for cv::Vec3f cv::Vec3f::operator+(cv::Vec3f vec)

Parameters:

Returns:



5853
5854
5855
5856
# File 'lib/ropencv/ropencv_types.rb', line 5853

def +(vec)
    __validate_pointer__
    Rbind::cv_vec_3f_operator_plus( self, vec)
end

#-(vec) ⇒ Cv::Vec3f

Note:

method wrapper for cv::Vec3f cv::Vec3f::operator-(cv::Vec3f vec)

Parameters:

Returns:



5861
5862
5863
5864
# File 'lib/ropencv/ropencv_types.rb', line 5861

def -(vec)
    __validate_pointer__
    Rbind::cv_vec_3f_operator_minus( self, vec)
end

#/(vec) ⇒ Cv::Vec3f

Note:

method wrapper for cv::Vec3f cv::Vec3f::operator/(float vec)

Parameters:

  • vec (Float)

Returns:



5877
5878
5879
5880
# File 'lib/ropencv/ropencv_types.rb', line 5877

def /(vec)
    __validate_pointer__
    Rbind::cv_vec_3f_operator_div( self, vec)
end

#==(vec) ⇒ Bool

Note:

method wrapper for bool cv::Vec3f::operator==(cv::Vec3f vec)

Parameters:

Returns:

  • (Bool)


5837
5838
5839
5840
# File 'lib/ropencv/ropencv_types.rb', line 5837

def ==(vec)
    __validate_pointer__
    Rbind::cv_vec_3f_operator_equal( self, vec)
end

#all(alpha) ⇒ Cv::Vec3f

Note:

method wrapper for cv::Vec3f cv::Vec3f::all(float alpha)

Parameters:

  • alpha (Float)

Returns:



5811
5812
5813
5814
5815
5816
5817
5818
5819
# File 'lib/ropencv/ropencv_types.rb', line 5811

def all(alpha)
    __validate_pointer__
    result = Rbind::cv_vec_3f_all( self, alpha)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#mul(other) ⇒ Cv::Vec3f

Note:

method wrapper for cv::Vec3f cv::Vec3f::mul(cv::Vec3f other)

Parameters:

Returns:



5824
5825
5826
5827
5828
5829
5830
5831
5832
# File 'lib/ropencv/ropencv_types.rb', line 5824

def mul(other)
    __validate_pointer__
    result = Rbind::cv_vec_3f_mul( self, other)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#to_sObject

converts Vec3f into a string by crawling through all its attributes



5791
5792
5793
# File 'lib/ropencv/ropencv_types.rb', line 5791

def to_s
    "#<cv::Vec3f val=#{self.val}>"
end

#valFloat Also known as: get_val

Note:

method wrapper for float* val

methods

Returns:

  • (Float)


5802
5803
5804
5805
# File 'lib/ropencv/ropencv_types.rb', line 5802

def val()
    __validate_pointer__
    Rbind::cv_vec_3f_get_val( self)
end