GradientMapping

References
[IoId("00000000-5bfa-45cd-8428-84036d7b657c")] public readonly struct GradientMapping : IStorable
A numeric mapping into gradient domain parameters.

Constructors

GradientMapping

#
public GradientMapping(double g0, double g1, double w0, double w1, bool auto0 = false, bool auto1 = false)
Create a new gradient domain mapping.
g0 (double)Start of gradient.
g1 (double)End of gradient.
w0 (double)Start of world domain.
w1 (double)End of world domain.
auto0 (bool = false)Automatic world start.
auto1 (bool = false)Automatic world end.

GradientMapping

#
public GradientMapping(double g0, double g1)
Simple constructor.
g0 (double)
g1 (double)

GradientMapping

#
public GradientMapping(IReader reader)
reader (IReader)

Properties

AutoLower

#
public bool AutoLower { get; }
Gets whether the WorldLower value ought to adjusted to fit a relevant data set. It is up to code dealing with gradients to perform this adjustment.

AutoUpper

#
public bool AutoUpper { get; }
Gets whether the WorldLower value ought to adjusted to fit a relevant data set. It is up to code dealing with gradients to perform this adjustment.

GradientLower

#
public double GradientLower { get; }
Gets the leftmost parameter on the gradient domain.

GradientUpper

#
public double GradientUpper { get; }
Gets the rightmost parameter on the gradient domain.

HasAutomaticBounds

#
public bool HasAutomaticBounds { get; }
Gets whether this mapping has automatic lower or upper bounds.

IsIdentity

#
public bool IsIdentity { get; }
Gets whether this mapping represents an identity mapping.

WorldLower

#
public double WorldLower { get; }
Gets the world parameter where the gradient start is pinned.

WorldUpper

#
public double WorldUpper { get; }
Gets the world parameter where the gradient end if pinned.

Methods

AutoUpdate

#
public GradientMapping AutoUpdate(double minimum, double maximum)
Update this mapping to automatically stretch to the given limits.
minimum (double)Lower world value.
maximum (double)Upper world value.

InverseMap

#
public double InverseMap(double tʹ)
Unmap a gradient parameter.
tʹ (double)

Map

#
public double Map(double t)
Map a parameter into gradient domain.
t (double)

ParseRange

#
public static Result<GradientMapping> ParseRange(string notation, double intrinsicLower, double intrinsicUpper)
Parse a gradient mapping notation.
notation (string)String containing 'from X to Y'.
intrinsicLower (double)The fallback for the lower limit in case of automatic bounds.
intrinsicUpper (double)The fallback for the upper limit in case of automatic bounds.
Result. Note that the gradient lower and upper limits are not part of notation and as such have default values.

Store

#
public void Store(IWriter writer)
writer (IWriter)
Store

ToString

#
public override string ToString()

WithAutomaticLimits

#
public GradientMapping WithAutomaticLimits(bool autoLower, bool autoUpper)
Sets the automatic world limits.
autoLower (bool)
autoUpper (bool)