| CFx SDK Documentation
    2022 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 78 of file GiProceduralGenerator.h.
Color interval addressing mode.
| Enumerator | |
|---|---|
| kClampMode | |
| kWrapMode | |
Definition at line 97 of file GiProceduralGenerator.h.
Type of color interpolation function (linear, exponential, inverted exponential, cosine).
| Enumerator | |
|---|---|
| kLinearInterpolation | |
| kExpInterpolation | |
| kInvExpInterpolation | |
| kCosInterpolation | |
Definition at line 84 of file GiProceduralGenerator.h.
| OdGiGradientGenerator::OdGiGradientGenerator | ( | ) | 
| OdGiGradientGenerator::OdGiGradientGenerator | ( | const OdGiGradientGenerator & | other | ) | 
| OdGiGradientGenerator::~OdGiGradientGenerator | ( | ) | 
| OdGiGradientGenerator::AddressMode OdGiGradientGenerator::addressMode | ( | ) | const | 
Get addressing mode.
| void OdGiGradientGenerator::appendGradient | ( | const OdGiGradientGenerator & | other | ) | 
| const OdUInt32Array& OdGiGradientGenerator::asArray | ( | ) | const | 
Get reference to array of gradient colors.
| 
 | staticprotected | 
Cosine interpolation function.
| 
 | protected | 
inVal addressing.
| ODCOLORREF OdGiGradientGenerator::colorAt | ( | double | at | ) | const | 
Get 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 | 
Get color from gradient colors array.
| nColor | [in] Index of color in array. | 
| OdUInt32 OdGiGradientGenerator::colorsCount | ( | ) | const | 
Get count of colors in gradient colors array.
| void OdGiGradientGenerator::copyGradient | ( | const ODCOLORREF * | colors, | 
| OdUInt32 | nColors | ||
| ) | 
Create 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 | ) | 
Create gradient colors array from other colors array.
| other | [in] Input colors array for copy from. | 
Create gradient colors array, filled with black color.
| nColors | [in] Count of colors in gradient array. | 
| void OdGiGradientGenerator::createColorArrayFilled | ( | ODCOLORREF | color, | 
| OdUInt32 | nColors | ||
| ) | 
Create gradient colors array, filled with 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 | ||
| ) | 
Create 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 | ||
| ) | 
Create 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 | ||
| ) | 
Create 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 | ||
| ) | 
Create 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 | ||
| ) | 
Create 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 | ||
| ) | 
Create 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 | ||
| ) | 
Create 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 | 
| 
 | staticprotected | 
Exponential interpolation function.
| void OdGiGradientGenerator::fillInterval | ( | ODCOLORREF | color, | 
| double | from = 0.0, | ||
| double | to = 1.0 | ||
| ) | 
Fill 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 | ||
| ) | 
Fill 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 | ||
| ) | 
Fill 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 | ||
| ) | 
Fill 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 | 
Interpolate 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 | 
Test whether gradient is initialized.
| 
 | staticprotected | 
Linear interpolation function.
| void OdGiGradientGenerator::operator+= | ( | const OdGiGradientGenerator & | other | ) | 
| const OdGiGradientGenerator& OdGiGradientGenerator::operator= | ( | const OdGiGradientGenerator & | other | ) | 
| void OdGiGradientGenerator::setAddressMode | ( | OdGiGradientGenerator::AddressMode | mode | ) | 
Set addressing mode.
| mode | [in] New addressing mode. | 
| 
 | protected | 
Convert inVal to [0.0 - 1.0] range.
| 
 | friend | 
| 
 | protected | 
Definition at line 104 of file GiProceduralGenerator.h.
| 
 | protected | 
Definition at line 103 of file GiProceduralGenerator.h.