Interpolate a normalized value t (0–1) through the given gradient stops.
| 751 | |
| 752 | // Interpolate a normalized value t (0–1) through the given gradient stops. |
| 753 | static QRgb interpolateGradient(float t, const WfGradientStop* stops, int n) |
| 754 | { |
| 755 | int i = 0; |
| 756 | while (i < n - 2 && stops[i + 1].pos < t) ++i; |
| 757 | const float seg = (t - stops[i].pos) / (stops[i + 1].pos - stops[i].pos); |
| 758 | const int r = static_cast<int>(stops[i].r + seg * (stops[i + 1].r - stops[i].r)); |
| 759 | const int g = static_cast<int>(stops[i].g + seg * (stops[i + 1].g - stops[i].g)); |
| 760 | const int b = static_cast<int>(stops[i].b + seg * (stops[i + 1].b - stops[i].b)); |
| 761 | return qRgb(qBound(0, r, 255), qBound(0, g, 255), qBound(0, b, 255)); |
| 762 | } |
| 763 | |
| 764 | #ifdef AETHER_GPU_SPECTRUM |
| 765 | static bool qtSoftwareOpenGlRequested() |
no outgoing calls
no test coverage detected