OEExponentColorGradient
class OEExponentColorGradient : public OEColorGradientBase
The OEExponentColorGradient class interpolates between colors that
are defined by using the OEColorStop class.
The OEExponentColorGradient.TransformValue method
defines the transformation that is performed before returning an
interpolated color associated with a floating point value.
The Figure: Example of various exponent color gradients
illustrates the difference between OEExponentColorGradient
objects constructed with the same color stops but with different exponent values.
An OEExponentColorGradient object constructed with 1.0
exponent value is equivalent to an OELinearColorGradient
object constructed with the same color stops.
Example of various exponent color gradients generated with (-2.0, OERed), (0.0, OEWhite) and (+2.0, OEBlue) color stops
See also
OEColorStop class
OELinearColorGradient class
The following methods are publicly inherited from OEColorGradientBase:
Constructors
OEExponentColorGradient(exponent: float) -> OEExponentColorGradient
Constructor that creates an “empty” color gradient with the given exponent value.
- exponent
The given value is clamped into the range of
[0.1, 10.0].
Note
An “empty” color gradient always returns the OEBlack
color, when calling the OEColorGradientBase.GetColorAt,
the OEColorGradientBase.GetMinColor or
the OEColorGradientBase.GetMaxColor methods.
OEExponentColorGradient(exponent: float, oneStop: OEColorStop) -> OEExponentColorGradient
Creates an OEExponentColorGradient object with
one color stop and an exponent value.
An OEExponentColorGradient object that
has only one color stop will always return that color when calling the
OEColorGradientBase.GetColorAt method.
- exponent
The given value is clamped into the range of
[0.1, 10.0].
OEExponentColorGradient(exponent: float, bgnStop: OEColorStop,
endStop: OEColorStop) -> OEExponentColorGradient
Creates an OEExponentColorGradient object with interpolation range between the two specified color stops using the given exponent value.
- exponent
The given value is clamped into the range of
[0.1, 10.0].
OEExponentColorGradient(rhs: OEExponentColorGradient) -> OEExponentColorGradient
Copy constructors.
GetExponent
GetExponent() -> float
Returns the exponent value used in the
OEExponentColorGradient.TransformValue method.
SetExponent
SetExponent(exponent: float) -> None
Sets the exponent value used in the
OEExponentColorGradient.TransformValue method.
- exponent
The given value is clamped into the range of
[0.1, 10.0].
TransformValue
TransformValue(value: float) -> float
Performs a
\(f(x) = -x^y\) transformation when x is less than 0.0 and
\(f(x) = x^y\) transformation when x is greater than 0.0, where
the \(y\) is the exponent returned by
OEExponentColorGradient.GetExponent method.
This method is called by OEColorGradientBase.GetColorAt
method to transform a value before performing color interpolation.