FunctionGradient

Gradient
[IoId("00000000-f650-4f43-9fe3-22cf962b4d68")] public sealed class FunctionGradient : Gradient
A one dimensional colour gradient based on a colour space and channel functions.

Constructors

FunctionGradient

#
public FunctionGradient(IReader reader)
reader (IReader)

FunctionGradient

#
public FunctionGradient(Space3 space, GradientMapping mapping, Function f1, Function f2, Function f3, Function fa = null)
space (Space3)
mapping (GradientMapping)
f1 (Function)
f2 (Function)
f3 (Function)
fa (Function = null)

Properties

ApparentDomain

public (double lower, double upper) ApparentDomain { get; }
Gets the domain based on the Gradient.Mapping of this gradient. Note that this domain may be decreasing.
inherited fromGradient

F1

#
public Function F1 { get; }
The function for the first channel.

F2

#
public Function F2 { get; }
The function for the second channel.

F3

#
public Function F3 { get; }
The function for the third channel.

FA

#
public Function FA { get; }
The function for the alpha channel.

Interaction

public virtual GripGradientInteraction Interaction { get; }
Gets a user interaction object based on this gradient. Not all gradient types will have interaction objects.
inherited fromGradient

IntrinsicDomain

#
public override (double lower, double upper) IntrinsicDomain { get; }

Mapping

public GradientMapping Mapping { get; }
Gets the mapping from sampling space to gradient space.
inherited fromGradient

Space

#
public Space3 Space { get; }
Gets the colour space in which this gradient is defined.

Methods

ColourAt

public bool ColourAt(double parameter, out Colour colour)
Gets the exact colour at the given parameter.
inherited fromGradient
parameter (double)Evaluation parameter.
colour (out Colour)Colour result.
True if the parameter is a valid one.

ColourAt

public Color ColourAt(double parameter)
Gets the colour at the given parameter.
inherited fromGradient
parameter (double)Evaluation parameter.
True if the parameter is a valid one.

ColourAtInternal

#
protected override Colour ColourAtInternal(double gradientParameter)
gradientParameter (double)

CreateTextureCache

protected virtual Gradient.GradientTexture CreateTextureCache()
Create a texture cache object for displaying this texture in the UI. The width of the texture bitmap ought to be decided by the callee.
inherited fromGradient

Draw

public virtual void Draw(Graphics graphics, RectangleF rectangle, double lower, double upper)
Draw this gradient as a horizontal progression. This method is optimized for speed and may not necessarily yield the exact result.
inherited fromGradient
graphics (Graphics)Graphics object to draw with.
rectangle (RectangleF)Rectangle to fill.
lower (double)Gradient parameter along left edge of rectangle.
upper (double)Gradient parameter along right edge of rectangle.

Draw

public void Draw(Graphics graphics, RectangleF rectangle)
Draw this gradient as a horizontal progression. This method is optimized for speed and may not necessarily yield the exact result.
inherited fromGradient
graphics (Graphics)Graphics object to draw with.
rectangle (RectangleF)Rectangle to fill.

IsConstant

public bool IsConstant(out Colour colour)
Tests whether this gradient has a zero-length domain and whether the colours on either side are identical.
inherited fromGradient
colour (out Colour)Colour inside domain.
True if gradient only has a single colour.

Remap

public Gradient Remap(double t0, double t1)
Create a new gradient which is similar to this gradient but remapped to a different interval.
inherited fromGradient
t0 (double)New gradient lower limit.
t1 (double)New gradient upper limit.
Mapped gradient.

Remap

#
public override Gradient Remap(GradientMapping newMapping)
newMapping (GradientMapping)
Gradient.Remap

RemapAutomatic

public Gradient RemapAutomatic(double lower, double upper)
Remap this gradient to a new domain if the mapping has automatic lower or upper bounds.
inherited fromGradient
lower (double)
upper (double)

Store

#
public override void Store(IWriter writer)
writer (IWriter)
Gradient.Store

ToBitmap

public Bitmap ToBitmap(int width, int height, double lower, double upper)
Render this gradient to a bitmap using exact per-pixel colours.
inherited fromGradient
width (int)Bitmap width.
height (int)Bitmap height.
lower (double)Gradient parameter at left edge of bitmap.
upper (double)Gradient parameter at right edge of bitmap.
Bitmap.

ToBitmap

public Bitmap ToBitmap(int width, int height)
Render this gradient to a bitmap.
inherited fromGradient
width (int)Bitmap width.
height (int)Bitmap height.
Bitmap.

ToString

#
public override string ToString()
Object.ToString

WithAutomaticLimits

public Gradient WithAutomaticLimits(bool autoLower = true, bool autoUpper = true)
Adjust the automatic bounds flags for this gradient.
inherited fromGradient
autoLower (bool = true)
autoUpper (bool = true)