Class: OpenCV::Cv::Vec2i

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

Constant Summary collapse

SIZE =
2

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Vecxi

#[], #[]=, #to_a

Class Method Details

.vec_2iObject .vec_2i(other) ⇒ Object .vec_2i(_t0, _t1) ⇒ Object

Overloads:

  • .vec_2i(other) ⇒ Object

    Parameters:

  • .vec_2i(_t0, _t1) ⇒ Object

    Parameters:

    • _t0 (Fixnum)
    • _t1 (Fixnum)

Raises:

  • (ArgumentError)


7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
# File 'lib/ropencv/ropencv_types.rb', line 7277

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

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

    # overloaded method wrapper for cv::Vec2i::Vec2i(int t0, int t1)
    @@cv_vec_2i_vec_2i__3_defaults2 ||= [nil, nil]
    if(args.size >= 2 && args.size <= 2)
        targs = args.clone
        targs.size.upto(1) do |i|
            targs[i] = @@cv_vec_2i_vec_2i__3_defaults2[i]
        end
        begin
                return Rbind::cv_vec_2i_vec_2i__3(*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



7265
7266
7267
# File 'lib/ropencv/ropencv_types.rb', line 7265

def self.null
    new(Vec2iStruct.new)
end

Instance Method Details

#!=(vec) ⇒ Bool

Note:

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

Parameters:

Returns:

  • (Bool)


7445
7446
7447
7448
# File 'lib/ropencv/ropencv_types.rb', line 7445

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

#*(vec) ⇒ Cv::Vec2i

Note:

method wrapper for cv::Vec2i cv::Vec2i::operator*(int vec)

Parameters:

  • vec (Fixnum)

Returns:



7469
7470
7471
7472
# File 'lib/ropencv/ropencv_types.rb', line 7469

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

#+(vec) ⇒ Cv::Vec2i

Note:

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

Parameters:

Returns:



7453
7454
7455
7456
# File 'lib/ropencv/ropencv_types.rb', line 7453

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

#-(vec) ⇒ Cv::Vec2i

Note:

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

Parameters:

Returns:



7461
7462
7463
7464
# File 'lib/ropencv/ropencv_types.rb', line 7461

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

#/(vec) ⇒ Cv::Vec2i

Note:

method wrapper for cv::Vec2i cv::Vec2i::operator/(int vec)

Parameters:

  • vec (Fixnum)

Returns:



7477
7478
7479
7480
# File 'lib/ropencv/ropencv_types.rb', line 7477

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

#==(vec) ⇒ Bool

Note:

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

Parameters:

Returns:

  • (Bool)


7437
7438
7439
7440
# File 'lib/ropencv/ropencv_types.rb', line 7437

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

#all(alpha) ⇒ Cv::Vec2i

Note:

method wrapper for cv::Vec2i cv::Vec2i::all(int alpha)

Parameters:

  • alpha (Fixnum)

Returns:



7411
7412
7413
7414
7415
7416
7417
7418
7419
# File 'lib/ropencv/ropencv_types.rb', line 7411

def all(alpha)
    __validate_pointer__
    result = Rbind::cv_vec_2i_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::Vec2i

Note:

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

Parameters:

Returns:



7424
7425
7426
7427
7428
7429
7430
7431
7432
# File 'lib/ropencv/ropencv_types.rb', line 7424

def mul(other)
    __validate_pointer__
    result = Rbind::cv_vec_2i_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 Vec2i into a string by crawling through all its attributes



7391
7392
7393
# File 'lib/ropencv/ropencv_types.rb', line 7391

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

#valFixnum Also known as: get_val

Note:

method wrapper for int* val

methods

Returns:

  • (Fixnum)


7402
7403
7404
7405
# File 'lib/ropencv/ropencv_types.rb', line 7402

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