15template<
typename Value>
24 Value
evaluate(Value x, Value y)
const override;
34template<
typename Value>
41template<
typename Value>
48template<
typename Value>
54template<
typename Value>
57 const Value projectedSignedLengthOnDir = m_unitDir.dot({x, y});
58 return projectedSignedLengthOnDir * m_slope;
A linearly increasing/decreasing gradient in a specific direction. Value at (0, 0) is 0.
Definition TLinearGradient2D.h:17
Value evaluate(Value x, Value y) const override
Definition TLinearGradient2D.h:55
static auto makeHorizontal(Value slope) -> TLinearGradient2D
Definition TLinearGradient2D.h:35
static auto makeVertical(Value slope) -> TLinearGradient2D
Definition TLinearGradient2D.h:42
TLinearGradient2D(TVector2< Value > direction, Value slope)
Definition TLinearGradient2D.h:49
Definition TMathFunction2D.h:8
Represents a 2-D vector.
Definition TVector2.h:19
Math functions and utilities.
Definition TransformInfo.h:10
void normalize(std::array< T, N > &vec)
Treating input values as a vector and normalize it. Notice that normalizing a integer typed vector wi...
Definition math.ipp:142