// - edit Vector.pack.tt to modify
#nullable enable
namespace Brutal.Numerics;
public partial struct int2
{
public static int2 Unpack(in sbyte2 vector, Func elementConverter)
{
VectorPack.Pack(vector, out int2 result, elementConverter);
return result;
}
public static int2 Unpack(in byte2 vector, Func elementConverter)
{
VectorPack.Pack(vector, out int2 result, elementConverter);
return result;
}
public static int2 Unpack(in short2 vector, Func elementConverter)
{
VectorPack.Pack(vector, out int2 result, elementConverter);
return result;
}
public static int2 Unpack(in ushort2 vector, Func elementConverter)
{
VectorPack.Pack(vector, out int2 result, elementConverter);
return result;
}
public static int2 Pack(in uint2 vector, Func elementConverter)
{
VectorPack.Pack(vector, out int2 result, elementConverter);
return result;
}
public static int2 Pack(in float2 vector, Func elementConverter)
{
VectorPack.Pack(vector, out int2 result, elementConverter);
return result;
}
public static int2 Pack(in double2 vector, Func elementConverter)
{
VectorPack.Pack(vector, out int2 result, elementConverter);
return result;
}
public static int2 Unpack(in sbyte2 vector, Unpack.Integer mode = Numerics.Unpack.Integer.Cast)
{
return Unpack(vector, PackUtils.SByte.ToInt(mode));
}
public static int2 Unpack(in byte2 vector, Unpack.IntegerMixed mode = Numerics.Unpack.IntegerMixed.Cast)
{
return Unpack(vector, PackUtils.Byte.ToInt(mode));
}
public static int2 Unpack(in short2 vector, Unpack.Integer mode = Numerics.Unpack.Integer.Cast)
{
return Unpack(vector, PackUtils.Short.ToInt(mode));
}
public static int2 Unpack(in ushort2 vector, Unpack.IntegerMixed mode = Numerics.Unpack.IntegerMixed.Cast)
{
return Unpack(vector, PackUtils.UShort.ToInt(mode));
}
public static int2 Pack(in uint2 vector, Pack.IntegerMixed mode = Numerics.Pack.IntegerMixed.Cast)
{
return Pack(vector, PackUtils.UInt.ToInt(mode));
}
public static int2 Pack(in float2 vector, Pack.Float mode = Numerics.Pack.Float.Truncate)
{
return Pack(vector, PackUtils.Float.ToInt(mode));
}
public static int2 Pack(in double2 vector, Pack.Float mode = Numerics.Pack.Float.Truncate)
{
return Pack(vector, PackUtils.Double.ToInt(mode));
}
public static void UnpackSpan(
in ReadOnlySpan source,
Span destination,
Func elementConverter
)
{
VectorPack.Pack(source, destination, elementConverter);
}
public static void UnpackSpan(
in ReadOnlySpan source,
Span destination,
Func elementConverter
)
{
VectorPack.Pack(source, destination, elementConverter);
}
public static void UnpackSpan(
in ReadOnlySpan source,
Span destination,
Func elementConverter
)
{
VectorPack.Pack(source, destination, elementConverter);
}
public static void UnpackSpan(
in ReadOnlySpan source,
Span destination,
Func elementConverter
)
{
VectorPack.Pack(source, destination, elementConverter);
}
public static void PackSpan(
in ReadOnlySpan source,
Span destination,
Func elementConverter
)
{
VectorPack.Pack(source, destination, elementConverter);
}
public static void PackSpan(
in ReadOnlySpan source,
Span destination,
Func elementConverter
)
{
VectorPack.Pack(source, destination, elementConverter);
}
public static void PackSpan(
in ReadOnlySpan source,
Span destination,
Func elementConverter
)
{
VectorPack.Pack(source, destination, elementConverter);
}
public static void UnpackSpan(
in ReadOnlySpan source,
Span destination,
Unpack.Integer mode = Numerics.Unpack.Integer.Cast
)
{
UnpackSpan(source, destination, PackUtils.SByte.ToInt(mode));
}
public static void UnpackSpan(
in ReadOnlySpan source,
Span destination,
Unpack.IntegerMixed mode = Numerics.Unpack.IntegerMixed.Cast
)
{
UnpackSpan(source, destination, PackUtils.Byte.ToInt(mode));
}
public static void UnpackSpan(
in ReadOnlySpan source,
Span destination,
Unpack.Integer mode = Numerics.Unpack.Integer.Cast
)
{
UnpackSpan(source, destination, PackUtils.Short.ToInt(mode));
}
public static void UnpackSpan(
in ReadOnlySpan source,
Span destination,
Unpack.IntegerMixed mode = Numerics.Unpack.IntegerMixed.Cast
)
{
UnpackSpan(source, destination, PackUtils.UShort.ToInt(mode));
}
public static void PackSpan(
in ReadOnlySpan source,
Span destination,
Pack.IntegerMixed mode = Numerics.Pack.IntegerMixed.Cast
)
{
PackSpan(source, destination, PackUtils.UInt.ToInt(mode));
}
public static void PackSpan(
in ReadOnlySpan source,
Span destination,
Pack.Float mode = Numerics.Pack.Float.Truncate
)
{
PackSpan(source, destination, PackUtils.Float.ToInt(mode));
}
public static void PackSpan(
in ReadOnlySpan source,
Span destination,
Pack.Float mode = Numerics.Pack.Float.Truncate
)
{
PackSpan(source, destination, PackUtils.Double.ToInt(mode));
}
}