00001 #ifndef SHADEWIDGET_H
00002 #define SHADEWIDGET_H
00003
00004 #include <QtGui>
00005 #include "Volume.h"
00006
00007 class HoverPoints;
00008
00013 class ShadeWidget : public QWidget
00014 {
00015 Q_OBJECT
00016 public:
00020 enum ShadeType {
00021 RedShade,
00022 GreenShade,
00023 BlueShade,
00024 ARGBShade
00025 };
00026
00027 ShadeWidget(ShadeType type, QWidget *parent);
00028
00029 void setHistogramPtr(QPixmap *histogramPtr);
00030 void setGradientStops(const QGradientStops &stops);
00031
00032 void paintEvent(QPaintEvent *e);
00033
00037 QSize sizeHint() const;
00041 QPolygonF points() const;
00045 HoverPoints *hoverPoints() const { return m_hoverPoints; }
00046
00047 uint colorAt(int x);
00048
00049 signals:
00053 void colorsChanged();
00054
00055 private:
00056 void generateShade();
00057
00058 ShadeType m_shade_type;
00059 QImage m_shade;
00060 HoverPoints *m_hoverPoints;
00061 QLinearGradient m_alpha_gradient;
00062 QPixmap *m_histogram;
00063 };
00064
00065 #endif // SHADEWIDGET_H