Class: OpenCV::Cv::Point2d

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.point_2dObject .point_2d(x, y) ⇒ Object .point_2d(pt) ⇒ Object

Overloads:

  • .point_2d(x, y) ⇒ Object

    Parameters:

    • x (Double)
    • y (Double)
  • .point_2d(pt) ⇒ Object

    Parameters:

Raises:

  • (ArgumentError)


9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
# File 'lib/ropencv/ropencv_types.rb', line 9438

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Point2dStruct)
        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::Point2d::Point2d()
    @@cv_point_2d_point_2d_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        targs = args.clone
        targs.size.upto(-1) do |i|
            targs[i] = @@cv_point_2d_point_2d_defaults0[i]
        end
        begin
                return Rbind::cv_point_2d_point_2d(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for cv::Point2d::Point2d(double x, double y)
    @@cv_point_2d_point_2d2_defaults1 ||= [nil, nil]
    if(args.size >= 2 && args.size <= 2)
        targs = args.clone
        targs.size.upto(1) do |i|
            targs[i] = @@cv_point_2d_point_2d2_defaults1[i]
        end
        begin
                return Rbind::cv_point_2d_point_2d2(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for cv::Point2d::Point2d(const cv::Point2d pt)
    @@cv_point_2d_point_2d3_defaults2 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@cv_point_2d_point_2d3_defaults2[i]
        end
        begin
                return Rbind::cv_point_2d_point_2d3(*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



9426
9427
9428
# File 'lib/ropencv/ropencv_types.rb', line 9426

def self.null
    new(Point2dStruct.new)
end

Instance Method Details

#!=(pt) ⇒ Bool

Note:

method wrapper for bool cv::Point2d::operator!=(const cv::Point2d pt)

Parameters:

Returns:

  • (Bool)


9679
9680
9681
9682
# File 'lib/ropencv/ropencv_types.rb', line 9679

def !=(pt)
    __validate_pointer__
    Rbind::cv_point_2d_operator_unequal( self, pt)
end

#*(val) ⇒ Cv::Point2d

Note:

method wrapper for cv::Point2d cv::Point2d::operator*(double val)

Parameters:

  • val (Double)

Returns:



9614
9615
9616
9617
# File 'lib/ropencv/ropencv_types.rb', line 9614

def *(val)
    __validate_pointer__
    Rbind::cv_point_2d_operator_mult( self, val)
end

#+(pt) ⇒ Cv::Point2d

Note:

method wrapper for cv::Point2d cv::Point2d::operator+(const cv::Point2d pt)

Parameters:

Returns:



9598
9599
9600
9601
# File 'lib/ropencv/ropencv_types.rb', line 9598

def +(pt)
    __validate_pointer__
    Rbind::cv_point_2d_operator_plus( self, pt)
end

#-(pt) ⇒ Cv::Point2d

Note:

method wrapper for cv::Point2d cv::Point2d::operator-(const cv::Point2d pt)

Parameters:

Returns:



9606
9607
9608
9609
# File 'lib/ropencv/ropencv_types.rb', line 9606

def -(pt)
    __validate_pointer__
    Rbind::cv_point_2d_operator_minus( self, pt)
end

#==(pt) ⇒ Bool

Note:

method wrapper for bool cv::Point2d::operator==(const cv::Point2d pt)

Parameters:

Returns:

  • (Bool)


9671
9672
9673
9674
# File 'lib/ropencv/ropencv_types.rb', line 9671

def ==(pt)
    __validate_pointer__
    Rbind::cv_point_2d_operator_equal( self, pt)
end

#cross(pt) ⇒ Double

Note:

method wrapper for double cv::Point2d::cross(const cv::Point2d pt)

Parameters:

Returns:

  • (Double)


9663
9664
9665
9666
# File 'lib/ropencv/ropencv_types.rb', line 9663

def cross(pt)
    __validate_pointer__
    Rbind::cv_point_2d_cross( self, pt)
end

#dot(pt) ⇒ Double #dot(pt) ⇒ Double

Note:

wrapper for overloaded method dot

Overloads:

  • #dot(pt) ⇒ Double

    Parameters:

    Returns:

    • (Double)
  • #dot(pt) ⇒ Double

    Parameters:

    Returns:

    • (Double)

Raises:

  • (ArgumentError)


9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
# File 'lib/ropencv/ropencv_types.rb', line 9627

def dot(*args)
    __validate_pointer__
    # overloaded method wrapper for double cv::Point2d::dot(const cv::Point2d pt)
    @@cv_point_2d_dot_defaults0 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@cv_point_2d_dot_defaults0[i]
        end
        begin
                return Rbind::cv_point_2d_dot(self,*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for double cv::Point2d::dot(const cv::Point2d pt)
    @@cv_point_2d_dot2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@cv_point_2d_dot2_defaults1[i]
        end
        begin
                return Rbind::cv_point_2d_dot2(self,*targs)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "No overloaded signature fits to: #{args.map(&:class)}"
end

#to_sObject

converts Point2d into a string by crawling through all its attributes



9552
9553
9554
# File 'lib/ropencv/ropencv_types.rb', line 9552

def to_s
    "#<cv::Point2d x=#{self.x} y=#{self.y}>"
end

#xDouble Also known as: get_x

Note:

method wrapper for double x

methods

Returns:

  • (Double)


9563
9564
9565
9566
# File 'lib/ropencv/ropencv_types.rb', line 9563

def x()
    __validate_pointer__
    Rbind::cv_point_2d_getx( self)
end

#x=(value) ⇒ Void Also known as: set_x

Note:

method wrapper for double x

Parameters:

  • value (Double)

Returns:

  • (Void)


9572
9573
9574
9575
# File 'lib/ropencv/ropencv_types.rb', line 9572

def x=(value)
    __validate_pointer__
    Rbind::cv_point_2d_setx( self, value)
end

#yDouble Also known as: get_y

Note:

method wrapper for double y

Returns:

  • (Double)


9580
9581
9582
9583
# File 'lib/ropencv/ropencv_types.rb', line 9580

def y()
    __validate_pointer__
    Rbind::cv_point_2d_gety( self)
end

#y=(value) ⇒ Void Also known as: set_y

Note:

method wrapper for double y

Parameters:

  • value (Double)

Returns:

  • (Void)


9589
9590
9591
9592
# File 'lib/ropencv/ropencv_types.rb', line 9589

def y=(value)
    __validate_pointer__
    Rbind::cv_point_2d_sety( self, value)
end