public IColorExpression Subtract( IScalarValue term1, params IScalarValue[] terms) => new ColorExpression( ListUtil.ReadonlyConcat(this.Terms, this.ToColorValues( this.NegateTerms(term1, terms))));
private void PrintValue_( StringWriter os, IScalarValue value, bool wrapExpressions = false) { if (value is IScalarExpression expression) { if (wrapExpressions) { os.Write("("); } this.PrintExpression_(os, expression); if (wrapExpressions) { os.Write(")"); } } else if (value is IScalarTerm term) { this.PrintTerm_(os, term); } else if (value is IScalarFactor factor) { this.PrintFactor_(os, factor); } else { Asserts.Fail("Unsupported value type!"); } }
public IScalarExpression Subtract( IScalarValue term1, params IScalarValue[] terms) => new ScalarExpression( ListUtil.ReadonlyFrom( this, this.NegateTerms(term1, terms)));
public IScalarTerm Divide( IScalarValue factor1, params IScalarValue[] factors) => new ScalarTerm(this.NumeratorFactors, ListUtil.ReadonlyConcat( this.DenominatorFactors, ListUtil.ReadonlyFrom(factor1, factors)));
public ColorWrapper(IScalarValue intensity) { this.Intensity = intensity; this.R = intensity; this.G = intensity; this.B = intensity; }
public ColorWrapper(IScalarValue intensity, IScalarValue?a = null) { this.Intensity = intensity; this.R = intensity; this.G = intensity; this.B = intensity; this.AOrNull = a; }
public string Print(IScalarValue scalarValue) { var sb = new StringBuilder(); using var os = new StringWriter(sb); this.PrintScalarValue_(os, scalarValue); return(sb.ToString()); }
public ColorWrapper( IScalarValue r, IScalarValue g, IScalarValue b) { this.R = r; this.G = g; this.B = b; }
public ColorWrapper( IScalarValue r, IScalarValue g, IScalarValue b, IScalarValue?a = null) { this.R = r; this.G = g; this.B = b; this.AOrNull = a; }
public ColorFixedFunctionOps( IFixedFunctionEquations <FixedFunctionSource> equations) { this.equations_ = equations; this.Zero = equations.CreateColorConstant(0); this.One = equations.CreateColorConstant(1); this.scZero_ = equations.CreateScalarConstant(0); this.scOne_ = equations.CreateScalarConstant(1); this.scMinusOne_ = equations.CreateScalarConstant(-1); }
public IColorExpression Add( IScalarValue term1, params IScalarValue[] terms) => new ColorExpression( ListUtil.ReadonlyFrom(this, this.ToColorValues(term1, terms)));
public ScalarOutput(TIdentifier identifier, IScalarValue value) { this.Identifier = identifier; this.ScalarValue = value; }
public IScalarExpression Add( IScalarValue term1, params IScalarValue[] terms) => new ScalarExpression(ListUtil.ReadonlyConcat(this.Terms, terms));
public IScalarTerm Multiply( IScalarValue factor1, params IScalarValue[] factors) => new ScalarTerm(ListUtil.ReadonlyConcat( this.NumeratorFactors, ListUtil.ReadonlyFrom(factor1, factors)));
public IScalarTerm Divide( IScalarValue factor1, params IScalarValue[] factors) => new ScalarTerm(ListUtil.ReadonlyFrom(this), ListUtil.ReadonlyFrom(factor1, factors));
protected IScalarValue[] NegateTerms( IScalarValue term1, params IScalarValue[] terms) => this.NegateTerms(ListUtil.From(term1, terms).ToArray());
public IScalarTerm Multiply( IScalarValue factor1, params IScalarValue[] factors) => new ScalarTerm(ListUtil.ReadonlyFrom(this, factor1, factors));
public IColorTerm Multiply( IScalarValue factor1, params IScalarValue[] factors) => new ColorTerm( ListUtil.ReadonlyFrom(this, this.ToColorValues(factor1, factors)));
public IColorTerm Divide( IScalarValue factor1, params IScalarValue[] factors) => new ColorTerm(ListUtil.ReadonlyFrom(this), new ReadOnlyCollection <IColorValue>( this.ToColorValues(factor1, factors)));
protected IColorValue[] ToColorValues( IScalarValue first, params IScalarValue[] scalars) => this.ToColorValues(ListUtil.From(first, scalars).ToArray());
public IColorTerm Multiply( IScalarValue factor1, params IScalarValue[] factors) => new ColorTerm(ListUtil.ReadonlyConcat( this.NumeratorFactors, this.ToColorValues(factor1, factors)));