Class: OpenCV::Std::Vector

Inherits:
Object
  • Object
show all
Defined in:
lib/ropencv/ropencv_types.rb,
lib/ropencv/ropencv_ruby.rb

Overview

template std::vector

Defined Under Namespace

Classes: Char, Cv_DMatch, Cv_KeyPoint, Cv_Mat, Cv_Point, Cv_Point2d, Cv_Point2f, Cv_Point3d, Cv_Point3f, Cv_Rect, Cv_Scalar, Cv_String, Cv_Vec4f, Cv_Vec4i, Cv_Vec6f, Double, Float, Int, Int64_T, Int8_T, Std_Vector_Cv_DMatch, Std_Vector_Cv_Point, Std_Vector_Cv_Point2d, Std_Vector_Cv_Point2f, Uchar, Uint32_T, Uint64_T

Constant Summary collapse

Fixnum =
Int

Specializing collapse

Class Method Details

.new(type, *args) ⇒ Object

Raises:

  • (ArgumentError)


32504
32505
32506
32507
32508
32509
32510
32511
32512
32513
32514
32515
32516
32517
32518
32519
32520
32521
32522
# File 'lib/ropencv/ropencv_types.rb', line 32504

def self.new(type,*args)
klass,elements = if type.class == Class
                    [type.name,[]]
                else
                    e = Array(type) + args.flatten
                    args = []
                    [type.class.name,e]
                end
#remove module name
klass = klass.split("::")
klass.shift if klass.size > 1
klass = klass.join("_")
raise ArgumentError,"no std::vector defined for #{type}" unless self.const_defined?(klass)
v = self.const_get(klass).new(*args)
elements.each do |e|
    v << e
end
v
end