/// <summary> /// this - other /// </summary> /// <param name="other"></param> /// <returns></returns> public Vec6b Subtract(Vec6b other) => new Vec6b( SaturateCast.ToByte(Item0 - other.Item0), SaturateCast.ToByte(Item1 - other.Item1), SaturateCast.ToByte(Item2 - other.Item2), SaturateCast.ToByte(Item3 - other.Item3), SaturateCast.ToByte(Item4 - other.Item4), SaturateCast.ToByte(Item5 - other.Item5));
/// <summary> /// this + other /// </summary> /// <param name="other"></param> /// <returns></returns> public Vec6b Add(Vec6b other) => new Vec6b( SaturateCast.ToByte(Item0 + other.Item0), SaturateCast.ToByte(Item1 + other.Item1), SaturateCast.ToByte(Item2 + other.Item2), SaturateCast.ToByte(Item3 + other.Item3), SaturateCast.ToByte(Item4 + other.Item4), SaturateCast.ToByte(Item5 + other.Item5));
/// <summary> /// this / alpha /// </summary> /// <param name="alpha"></param> /// <returns></returns> public Vec6b Divide(double alpha) => new Vec6b( SaturateCast.ToByte(Item0 / alpha), SaturateCast.ToByte(Item1 / alpha), SaturateCast.ToByte(Item2 / alpha), SaturateCast.ToByte(Item3 / alpha), SaturateCast.ToByte(Item4 / alpha), SaturateCast.ToByte(Item5 / alpha));
/// <summary> /// this * alpha /// </summary> /// <param name="alpha"></param> /// <returns></returns> public Vec6b Multiply(double alpha) => new Vec6b( SaturateCast.ToByte(Item0 * alpha), SaturateCast.ToByte(Item1 * alpha), SaturateCast.ToByte(Item2 * alpha), SaturateCast.ToByte(Item3 * alpha), SaturateCast.ToByte(Item4 * alpha), SaturateCast.ToByte(Item5 * alpha));
/// <summary> /// this - other /// </summary> /// <param name="other"></param> /// <returns></returns> public Vec4b Subtract(Vec4b other) => new Vec4b( SaturateCast.ToByte(Item0 - other.Item0), SaturateCast.ToByte(Item1 - other.Item1), SaturateCast.ToByte(Item2 - other.Item2), SaturateCast.ToByte(Item3 - other.Item3));
/// <summary> /// this + other /// </summary> /// <param name="other"></param> /// <returns></returns> public Vec4b Add(Vec4b other) => new Vec4b( SaturateCast.ToByte(Item0 + other.Item0), SaturateCast.ToByte(Item1 + other.Item1), SaturateCast.ToByte(Item2 + other.Item2), SaturateCast.ToByte(Item3 + other.Item3));
public void ToByteFromDouble(double from, byte to) { Assert.Equal(to, SaturateCast.ToByte(from)); }
public void ToByteFromInt(int from, byte to) { Assert.Equal(to, SaturateCast.ToByte(from)); }
/// <summary> /// this / alpha /// </summary> /// <param name="alpha"></param> /// <returns></returns> public Vec2b Divide(double alpha) => new Vec2b( SaturateCast.ToByte(Item0 / alpha), SaturateCast.ToByte(Item1 / alpha));
/// <summary> /// this * alpha /// </summary> /// <param name="alpha"></param> /// <returns></returns> public Vec2b Multiply(double alpha) => new Vec2b( SaturateCast.ToByte(Item0 * alpha), SaturateCast.ToByte(Item1 * alpha));
/// <summary> /// this - other /// </summary> /// <param name="other"></param> /// <returns></returns> public Vec2b Subtract(Vec2b other) => new Vec2b( SaturateCast.ToByte(Item0 - other.Item0), SaturateCast.ToByte(Item1 - other.Item1));
/// <summary> /// this + other /// </summary> /// <param name="other"></param> /// <returns></returns> public Vec2b Add(Vec2b other) => new Vec2b( SaturateCast.ToByte(Item0 + other.Item0), SaturateCast.ToByte(Item1 + other.Item1));