00001 #ifndef GRADIENTEDITOR_H 00002 #define GRADIENTEDITOR_H 00003 00004 #include <QtGui> 00005 #include "shadewidget.h" 00006 #include "Volume.h" 00007 00011 class GradientEditor : public QWidget 00012 { 00013 Q_OBJECT 00014 public: 00015 GradientEditor(QWidget *parent); 00016 00017 void setGradientStops(const QGradientStops &stops); 00018 unsigned int* getColorsPtr(); 00019 void updateColorTexture(int minDensity = 0, int maxDensity = 4095); 00020 void forwardHistogramPtr(QPixmap *histogramPtr); 00021 00022 public slots: 00023 void pointsUpdated(); 00024 void colorDialog(int index, QWidget *selectedWidget); 00025 void moveColorsToAlpha(bool state); 00026 void moveColorsWithAlpha(int index, qreal newXPos); 00027 void newColorPoints(int index, qreal xPos); 00028 void deleteColorPoints(int index); 00029 00030 signals: 00035 void gradientStopsChanged(const QGradientStops &stops); 00036 00037 protected: 00038 void resizeEvent(QResizeEvent *event); 00039 00040 private: 00041 ShadeWidget *m_red_shade; 00042 ShadeWidget *m_green_shade; 00043 ShadeWidget *m_blue_shade; 00044 ShadeWidget *m_alpha_shade; 00045 unsigned int* colors; 00046 bool colorsFixatedToAlpha; 00047 bool sendUpdate; 00048 }; 00049 00050 #endif // GRADIENTEDITOR_H