public void TestInOutScalars() { var equations = new FixedFunctionEquations <string>(); var fooIn = equations.CreateScalarInput("fooIn", equations.CreateScalarConstant(123)); var fooOut = equations.CreateScalarOutput("fooOut", fooIn); this.AssertEquals_(equations, "Scalar inputs:", "fooIn: 123", "", "Color inputs:", "", "", "Scalar outputs:", "fooOut: {fooIn}", "", "Color outputs:" ); }
public void TestColorMath() { var equations = new FixedFunctionEquations <string>(); var colRgb = equations.CreateColorInput("colRgb", equations.CreateColorConstant(1, 2, 3)); var colRgba = equations.CreateColorInput("colRgba", equations.CreateColorConstant(1, 2, 3, 4)); var colI = equations.CreateColorInput("colI", equations.CreateColorConstant(1)); var colIa = equations.CreateColorInput("colIa", equations.CreateColorConstant(1, 2)); var colOutput = equations.CreateColorOutput("colOutput", (colRgb.Add(colRgba)).Divide( colI.Subtract(colIa))); this.AssertEquals_(equations, "Scalar inputs:", "", "Color inputs:", "colRgb: rgb<1,2,3>", "colRgba: rgba<1,2,3,4>", "colI: i<1>", "colIa: ia<1,2>", "", "", "Scalar outputs:", "", "Color outputs:", "colOutput: (<colRgb> + <colRgba>)/(<colI> + ia<-1,-1>*<colIa>)" ); }