public static ComponentMask ToComponentMask(this Operand4ComponentName name) { switch (name) { case Operand4ComponentName.X: return(ComponentMask.X); case Operand4ComponentName.Y: return(ComponentMask.Y); case Operand4ComponentName.Z: return(ComponentMask.Z); case Operand4ComponentName.W: return(ComponentMask.W); default: throw new ArgumentException(); } }
public static string GetDescription(this Operand4ComponentName value) { switch (value) { case Operand4ComponentName.X: return("x"); case Operand4ComponentName.Y: return("y"); case Operand4ComponentName.Z: return("z"); case Operand4ComponentName.W: return("w"); default: throw new ArgumentOutOfRangeException("value", "Unrecognised value:" + value); } }
public Number GetSwizzledNumber(Operand4ComponentName name) { switch (name) { case Operand4ComponentName.X: return(Number0); case Operand4ComponentName.Y: return(Number1); case Operand4ComponentName.Z: return(Number2); case Operand4ComponentName.W: return(Number3); default: throw new ArgumentOutOfRangeException("name"); } }
private static string GetOperand4ComponentName(Operand4ComponentName name) { switch (name) { case Operand4ComponentName.X: return("X"); case Operand4ComponentName.Y: return("Y"); case Operand4ComponentName.Z: return("Z"); case Operand4ComponentName.W: return("W"); default: throw new NotImplementedException(); } }
public Number GetSwizzledNumber(Operand4ComponentName name) { switch (name) { case Operand4ComponentName.X: return Number0; case Operand4ComponentName.Y: return Number1; case Operand4ComponentName.Z: return Number2; case Operand4ComponentName.W: return Number3; default: throw new ArgumentOutOfRangeException("name"); } }
public static Number4 Swizzle(Number4 original, Operand4ComponentName[] swizzles) { return new Number4( original.GetNumber((int) swizzles[0]), original.GetNumber((int) swizzles[1]), original.GetNumber((int) swizzles[2]), original.GetNumber((int) swizzles[3])); }
private static string GetOperand4ComponentName(Operand4ComponentName name) { switch (name) { case Operand4ComponentName.X : return "X"; case Operand4ComponentName.Y: return "Y"; case Operand4ComponentName.Z: return "Z"; case Operand4ComponentName.W: return "W"; default : throw new NotImplementedException(); } }