CFx SDK Documentation 2024 SP0
|
#include <GiProceduralGenerator.h>
Public Types | |
enum | InterpolationType { kLinearInterpolation = 0 , kExpInterpolation , kInvExpInterpolation , kCosInterpolation } |
enum | AddressMode { kClampMode = 0 , kWrapMode } |
Static Public Member Functions | |
static ODCOLORREF | interpolateColor (ODCOLORREF color1, ODCOLORREF color2, double at, OdGiGradientGenerator::InterpolationType ipl=OdGiGradientGenerator::kLinearInterpolation, OdGiGradientGenerator::AddressMode mode=OdGiGradientGenerator::kWrapMode) |
static OdGiGradientGenerator | createSpectrumGradient (OdUInt32 nColors, OdUInt8 alpha=0) |
Protected Member Functions | |
OdUInt32 | clampToRange (OdUInt32 inVal) const |
OdUInt32 | clampToRange (double inVal) const |
double | toDoubleRange (OdUInt32 inVal) const |
Static Protected Member Functions | |
static double | linterp (double a, double b, double t) |
static double | einterp (double a, double b, double t) |
static double | cinterp (double a, double b, double t) |
static double | ieinterp (double a, double b, double t) |
Protected Attributes | |
OdUInt32Array | m_colorGradient |
AddressMode | m_addressMode |
Friends | |
OdGiGradientGenerator | operator+ (const OdGiGradientGenerator &g1, const OdGiGradientGenerator &g2) |
Color gradient generator.
<group OdGi_Classes>
Definition at line 79 of file GiProceduralGenerator.h.
Color interval addressing mode.
Enumerator | |
---|---|
kClampMode | kClampMode clamp color address coordinates to the [0.0, 1.0] range. |
kWrapMode | kWrapMode Repeat color address on every integer junction. |
Definition at line 99 of file GiProceduralGenerator.h.
Type of color interpolation function (linear, exponential, inverted exponential, cosine).
Enumerator | |
---|---|
kLinearInterpolation | Linear interpolation. |
kExpInterpolation | Exponential interpolation. |
kInvExpInterpolation | Inverted exponential interpolation. |
kCosInterpolation | Cosine interpolation. |
Definition at line 85 of file GiProceduralGenerator.h.
OdGiGradientGenerator::OdGiGradientGenerator | ( | ) |
Default constructor for OdGiGradientGenerator class.
OdGiGradientGenerator::OdGiGradientGenerator | ( | const OdGiGradientGenerator & | other | ) |
Copy constructor for OdGiGradientGenerator class.
other | [in] Other gradient generator to copy. |
OdGiGradientGenerator::~OdGiGradientGenerator | ( | ) |
OdGiGradientGenerator::AddressMode OdGiGradientGenerator::addressMode | ( | ) | const |
Retrieves color addressing mode which is used for this gradient generator.
void OdGiGradientGenerator::appendGradient | ( | const OdGiGradientGenerator & | other | ) |
Appends colors of the passed gradient generator to colors of this gradient generator.
other | [in] Other gradient generator. |
const OdUInt32Array & OdGiGradientGenerator::asArray | ( | ) | const |
Retrieves reference to array of gradient colors.
|
staticprotected |
Cosine interpolation function.
|
protected |
inVal addressing.
ODCOLORREF OdGiGradientGenerator::colorAt | ( | double | at | ) | const |
Retrieves color from gradient colors array.
at | [in] Color coordinate (0.0 equals 0 in array; 1.0 equals colorsCount() - 1 in array). |
ODCOLORREF OdGiGradientGenerator::colorAt | ( | OdUInt32 | nColor | ) | const |
Retrieves color from gradient colors array.
nColor | [in] Index of color in array. |
OdUInt32 OdGiGradientGenerator::colorsCount | ( | ) | const |
Retrieves count of colors in gradient colors array.
void OdGiGradientGenerator::copyGradient | ( | const ODCOLORREF * | colors, |
OdUInt32 | nColors | ||
) |
Creates gradient colors array from other colors array.
colors | [in] Linear array of colors. |
nColors | [in] Count of colors in colors linear array. |
void OdGiGradientGenerator::copyGradient | ( | const OdUInt32Array & | other | ) |
Creates gradient colors array from other colors array.
other | [in] Input colors array for copy from. |
Creates gradient colors array, filled with black color.
nColors | [in] Count of colors in gradient array. |
void OdGiGradientGenerator::createColorArrayFilled | ( | ODCOLORREF | color, |
OdUInt32 | nColors | ||
) |
Creates gradient colors array, filled with the specified color.
color | [in] Color for all elements in array. |
nColors | [in] Count of colors in gradient array. |
void OdGiGradientGenerator::createGradient | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
ODCOLORREF | color3, | ||
ODCOLORREF | color4, | ||
ODCOLORREF | color5, | ||
OdUInt32 | nColors, | ||
OdGiGradientGenerator::InterpolationType | ipl1, | ||
OdGiGradientGenerator::InterpolationType | ipl2, | ||
OdGiGradientGenerator::InterpolationType | ipl3, | ||
OdGiGradientGenerator::InterpolationType | ipl4 | ||
) |
Creates gradient from five input colors.
color1 | [in] First color. |
color2 | [in] Second color. |
color3 | [in] Third color. |
color4 | [in] Fourth color. |
color5 | [in] Fifth color. |
nColors | [in] Number of color entries to be created in gradient colors array. |
ipl1 | [in] Interpolation function for interval between color1 and color2. |
ipl2 | [in] Interpolation function for interval between color2 and color3. |
ipl3 | [in] Interpolation function for interval between color3 and color4. |
ipl4 | [in] Interpolation function for interval between color4 and color5. |
void OdGiGradientGenerator::createGradient | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
ODCOLORREF | color3, | ||
ODCOLORREF | color4, | ||
ODCOLORREF | color5, | ||
OdUInt32 | nColors, | ||
OdGiGradientGenerator::InterpolationType | ipl = OdGiGradientGenerator::kLinearInterpolation |
||
) |
Creates gradient from five input colors.
color1 | [in] First color. |
color2 | [in] Second color. |
color3 | [in] Third color. |
color4 | [in] Fourth color. |
color5 | [in] Fifth color. |
nColors | [in] Number of color entries to be created in gradient colors array. |
ipl | [in] Interpolation function. |
void OdGiGradientGenerator::createGradient | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
ODCOLORREF | color3, | ||
ODCOLORREF | color4, | ||
OdUInt32 | nColors, | ||
OdGiGradientGenerator::InterpolationType | ipl1, | ||
OdGiGradientGenerator::InterpolationType | ipl2, | ||
OdGiGradientGenerator::InterpolationType | ipl3 | ||
) |
Creates gradient from four input colors.
color1 | [in] First color. |
color2 | [in] Second color. |
color3 | [in] Third color. |
color4 | [in] Fourth color. |
nColors | [in] Number of color entries to be created in gradient colors array. |
ipl1 | [in] Interpolation function for interval between color1 and color2. |
ipl2 | [in] Interpolation function for interval between color2 and color3. |
ipl3 | [in] Interpolation function for interval between color3 and color4. |
void OdGiGradientGenerator::createGradient | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
ODCOLORREF | color3, | ||
ODCOLORREF | color4, | ||
OdUInt32 | nColors, | ||
OdGiGradientGenerator::InterpolationType | ipl = OdGiGradientGenerator::kLinearInterpolation |
||
) |
Creates gradient from four input colors.
color1 | [in] First color. |
color2 | [in] Second color. |
color3 | [in] Third color. |
color4 | [in] Four color. |
nColors | [in] Number of color entries to be created in gradient colors array. |
ipl | [in] Interpolation function. |
void OdGiGradientGenerator::createGradient | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
ODCOLORREF | color3, | ||
OdUInt32 | nColors, | ||
OdGiGradientGenerator::InterpolationType | ipl1, | ||
OdGiGradientGenerator::InterpolationType | ipl2 | ||
) |
Creates gradient from three input colors.
color1 | [in] First color. |
color2 | [in] Second color. |
color3 | [in] Third color. |
nColors | [in] Number of color entries to be created in gradient colors array. |
ipl1 | [in] Interpolation function for interval between color1 and color2. |
ipl2 | [in] Interpolation function for interval between color2 and color3. |
void OdGiGradientGenerator::createGradient | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
ODCOLORREF | color3, | ||
OdUInt32 | nColors, | ||
OdGiGradientGenerator::InterpolationType | ipl = OdGiGradientGenerator::kLinearInterpolation |
||
) |
Creates gradient from three input colors.
color1 | [in] First color. |
color2 | [in] Second color. |
color3 | [in] Third color. |
nColors | [in] Number of color entries to be created in gradient colors array. |
ipl | [in] Interpolation function. |
void OdGiGradientGenerator::createGradient | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
OdUInt32 | nColors, | ||
OdGiGradientGenerator::InterpolationType | ipl = OdGiGradientGenerator::kLinearInterpolation |
||
) |
Creates gradient from two input colors.
color1 | [in] First color. |
color2 | [in] Second color. |
nColors | [in] Number of color entries to be created in gradient colors array. |
ipl | [in] Interpolation function. |
|
static |
Creates a spectrum gradient.
nColors | [in] Number of colors in gradient. |
alpha | [in] Alpha value for all spectrum colors. |
|
staticprotected |
Exponential interpolation function.
void OdGiGradientGenerator::fillInterval | ( | ODCOLORREF | color, |
double | from = 0.0 , |
||
double | to = 1.0 |
||
) |
Fills gradient range between from and to.
color | [in] Fill color. |
from | [in] Start of range for fill. |
to | [in] End of range for fill. |
void OdGiGradientGenerator::fillInterval | ( | ODCOLORREF | color, |
OdUInt32 | from, | ||
OdUInt32 | to | ||
) |
Fills gradient range between from and to.
color | [in] Fill color. |
from | [in] Start of range for fill. |
to | [in] End of range for fill. |
void OdGiGradientGenerator::generateInterval | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
double | from = 0.0 , |
||
double | to = 1.0 , |
||
OdGiGradientGenerator::InterpolationType | ipl = OdGiGradientGenerator::kLinearInterpolation |
||
) |
Fills range of gradient colors array with another gradient.
color1 | [in] First color. |
color2 | [in] Second color. |
from | [in] Start of range for fill. |
to | [in] End of range for fill. |
ipl | [in] Interpolation function. |
void OdGiGradientGenerator::generateInterval | ( | ODCOLORREF | color1, |
ODCOLORREF | color2, | ||
OdUInt32 | from, | ||
OdUInt32 | to, | ||
OdGiGradientGenerator::InterpolationType | ipl = OdGiGradientGenerator::kLinearInterpolation |
||
) |
Fills range of gradient colors array by another gradient.
color1 | [in] First color. |
color2 | [in] Second color. |
from | [in] Start of range for fill. |
to | [in] End of range for fill. |
ipl | [in] Interpolation function. |
|
staticprotected |
Inverted exponential interpolation function.
|
static |
Interpolates color between color1 and color2.
color1 | [in] First color. |
color2 | [in] Second color. |
at | [in] Interpolation coordinate (0.0 - 1.0 for range without additional addressing). |
to | [in] End of range for fill. |
ipl | [in] Interpolation function. |
mode | [in] Addressing mode. |
bool OdGiGradientGenerator::isInitialized | ( | ) | const |
Tests whether gradient is initialized.
|
staticprotected |
Linear interpolation function.
void OdGiGradientGenerator::operator+= | ( | const OdGiGradientGenerator & | other | ) |
Appends colors of the passed gradient generator to colors of this gradient generator.
other | [in] Other gradient generator. |
const OdGiGradientGenerator & OdGiGradientGenerator::operator= | ( | const OdGiGradientGenerator & | other | ) |
Assignment operator for OdGiGradientGenerator class.
other | [in] Gradient generator to assign. |
void OdGiGradientGenerator::setAddressMode | ( | OdGiGradientGenerator::AddressMode | mode | ) |
Sets addressing mode.
mode | [in] New addressing mode. |
|
protected |
Convert inVal to [0.0 - 1.0] range.
|
friend |
|
protected |
Definition at line 108 of file GiProceduralGenerator.h.
|
protected |
Definition at line 107 of file GiProceduralGenerator.h.