예제 #1
0
 /// <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));
예제 #2
0
 /// <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));
예제 #3
0
 /// <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));
예제 #4
0
 /// <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));
예제 #5
0
 /// <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));
예제 #6
0
 /// <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));
예제 #7
0
 public void ToByteFromDouble(double from, byte to)
 {
     Assert.Equal(to, SaturateCast.ToByte(from));
 }
예제 #8
0
 public void ToByteFromInt(int from, byte to)
 {
     Assert.Equal(to, SaturateCast.ToByte(from));
 }
예제 #9
0
 /// <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));
예제 #10
0
 /// <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));
예제 #11
0
 /// <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));
예제 #12
0
 /// <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));