26 #ifndef QCP_COLORGRADIENT_H
27 #define QCP_COLORGRADIENT_H
44 Q_ENUMS(ColorInterpolation)
63 Q_ENUMS(GradientPreset)
67 bool operator!=(const
QCPColorGradient &other)
const {
return !(*
this == other); }
70 int levelCount()
const {
return mLevelCount; }
71 QMap<double, QColor> colorStops()
const {
return mColorStops; }
72 ColorInterpolation colorInterpolation()
const {
return mColorInterpolation; }
73 bool periodic()
const {
return mPeriodic; }
76 void setLevelCount(
int n);
77 void setColorStops(
const QMap<double, QColor> &colorStops);
78 void setColorStopAt(
double position,
const QColor &color);
79 void setColorInterpolation(ColorInterpolation interpolation);
80 void setPeriodic(
bool enabled);
83 void colorize(
const double *data,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
84 QRgb color(
double position,
const QCPRange &range,
bool logarithmic=
false);
85 void loadPreset(GradientPreset preset);
86 void clearColorStops();
90 void updateColorBuffer();
94 QMap<double, QColor> mColorStops;
95 ColorInterpolation mColorInterpolation;
99 QVector<QRgb> mColorBuffer;
100 bool mColorBufferInvalidated;
103 #endif // QCP_COLORGRADIENT_H