Base interface for classes that provide a color ramp.
interface
|
IColorRamp
|
extends
|
IConfigurable
|
||
IEquatable<IColorRamp>
|
|||||
ISerializable
|
|||||
base of
|
ColorRampBase
|
A color ramp has zero or more color slots, where each slot has an input coordinate and an associated color value.
Returns the coordinate range of this color ramp.
property
|
Range
{
get
}
|
||
type
|
RangeD
|
||
value
|
The coordinate range. |
Returns the serial type of this object.
property
|
SerialType
{
get
}
|
||
type
|
ISerialTypeInfo
|
||
value
|
|
The serial type. | |
inherited
|
ISerializable.SerialType
|
Returns the serial data version.
property
|
SerialVersion
{
get
}
|
||
type
|
int32
|
||
value
|
|
The serial data version tag. | |
inherited
|
ISerializable.SerialVersion
|
Remarks:
An ISerializable implementation is required to support all versions up to the one returned by SerialVersion.
See also:
ISerializable.SerializeInitializes the state of this object from the given data stream.
method
|
Deserialize
(int32 serialVersion,
ISerializer data)
|
||
type
|
ISerializable
|
||
params
|
serialVersion
|
[>=1]
|
The serial data version. |
data
|
[not-null]
|
The serial data stream. | |
returns
|
|
The
deserialized
object.
This
will
typically
be
this ,
but
in
some
circumstances,
another
instance
may
be
returned
(e.g.
singletons).
|
|
inherited
|
ISerializable.Deserialize
|
Remarks:
The Deserialize method will be called immediately after the object has been instantiated via its default constructor.
The provided serialVersion number is guaranteed to be equal to or less than the SerialVersion returned by this object (i.e. ISerializable object must provide backwards compatibility).
See also:
ISerializable.SerializeReturns an interpolated color on this color ramp.
method
|
Get
(float64 x)
|
||
type
|
int64
|
||
params
|
x
|
Coordinate of color to return. | |
returns
|
The color value. |
Returns a color index on this color ramp.
method
|
Index
(float64 x)
|
||
type
|
float64
|
||
params
|
x
|
Coordinate of color to return. | |
returns
|
The color index. |
Modulates the colors in this color ramp.
method
|
Modulate
(int64 color)
|
||
type
|
IColorRamp
|
||
params
|
color
|
The color to modulate with. | |
returns
|
|
The resulting color ramp. |
Serializes the current state of this object to the given data stream.
method
|
Serialize
(ISerializer data)
|
||
params
|
data
|
[not-null]
|
The serial data stream. |
inherited
|
ISerializable.Serialize
|
See also:
ISerializable.DeserializeReturns the configuration value that describes this object.
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
inherited
|
IConfigurable.ToConfig
|
Remarks:
All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.
The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.
Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.
Transforms the input coordinate of this color ramp.
method
|
Transform
(float64 offset,
float64 scale = 1)
|
||
type
|
IColorRamp
|
||
params
|
offset
|
Offset value to add to scaled input X-coordinates. | |
scale
|
Scale
factor
to
apply
to
input
X-coordinates.
Defaults
to
1 .
|
||
returns
|
|
The resulting color ramp. |
Remarks:
Input X-coordinates are transformed as follows:
xOut = offset + scale * xIn xIn = (xOut - offset) / scale = xOut / scale - offset / scalewhere
xIn
refers
to
the
coordinate
passed
to
the
returned
color
ramp
and
xOut
is
the
coordinate
that
is
passed
to
this
color
ramp.
Converts this color ramp into a color buffer with a height of one.
method
|
ToColorBuffer
(int32 n = 256)
|
||
type
|
ColorBuffer
|
||
params
|
n
|
[>0]
|
The
number
of
palette
colors.
Defaults
to
256 . |
returns
|
|
The created color buffer. |
See also:
RangeConverts this color ramp into a color buffer with a height of one.
method
|
ToColorBuffer
(float64 x1,
float64 x2,
int32 n = 256)
|
||
type
|
ColorBuffer
|
||
params
|
x1
|
X-coordinate of first palette color. | |
x2
|
X-coordinate of last palette color. | ||
n
|
[>0]
|
The
number
of
palette
colors.
Defaults
to
256 . |
|
returns
|
|
The created color buffer. |
Converts this color ramp into a color palette.
method
|
ToColorPalette
(int32 n = 256)
|
||
type
|
int64[]
|
||
params
|
n
|
[>0]
|
The
number
of
palette
colors.
Defaults
to
256 . |
returns
|
|
The created color palette. |
See also:
RangeConverts this color ramp into a color palette.
method
|
ToColorPalette
(float64 x1,
float64 x2,
int32 n = 256)
|
||
type
|
int64[]
|
||
params
|
x1
|
X-coordinate of first palette color. | |
x2
|
X-coordinate of last palette color. | ||
n
|
[>0]
|
The
number
of
palette
colors.
Defaults
to
256 . |
|
returns
|
|
The created color palette. |