module ChunkyPNG

def self.Vector(*args)

Other tags:
    See: ChunkyPNG::Vector -

Raises:
  • (ArgumentError) - If the given arguments could not be understood as a vector.

Returns:
  • (ChunkyPNG::Vector) - The vector created by this factory method.
  • (ChunkyPNG::Vector) - The instantiated vector.
  • (ChunkyPNG::Vector) - The instantiated vector.
  • (ChunkyPNG::Vector) - The instantiated vector.

Overloads:
  • Vector(pointlike, pointlike, pointlike, ...)
  • Vector(string)
  • Vector(x0, y0, x1, y1, x2, y2, ...)
def self.Vector(*args)
  return args.first if args.length == 1 && args.first.is_a?(ChunkyPNG::Vector)
  if args.length == 1 && args.first.respond_to?(:scan)
    ChunkyPNG::Vector.new(ChunkyPNG::Vector.multiple_from_string(args.first)) # e.g. ['1,1 2,2 3,3']
  else
    ChunkyPNG::Vector.new(ChunkyPNG::Vector.multiple_from_array(args)) # e.g. [[1,1], [2,2], [3,3]] or [1,1,2,2,3,3]
  end
end