00001 #ifndef CTRANSFERWDT_H 00002 #define CTRANSFERWDT_H 00003 00004 /****************************************************************************\ 00005 * REQUIRED HEADERS * 00006 \****************************************************************************/ 00007 00008 //UI 00009 #include "ui_CTransferWdt.h" 00010 //QT 00011 #include <QFrame> 00012 //OWN 00013 #include "modules/Memory/IManagedObject.h" 00014 #include "QColorSelect.h" 00015 00016 /**************************************************************************\ 00017 * DEFINITIONS * 00018 \**************************************************************************/ 00019 00020 class QSlider; 00021 class QResizeEvent; 00022 class QColorSelect; 00023 class CGLHistogram; 00024 class QImage; 00025 00026 #define DIRTY_TRANSFER 0 00027 #define DIRTY_HISTOGRAM 1 00028 #define DIRTY_LOG 2 00029 #define DIRTY_OVERLAY 3 00030 00031 /**************************************************************************\ 00032 * CLASS * 00033 \**************************************************************************/ 00034 class CTransferWdt : public QFrame,public IManagedObject 00035 { 00036 Q_OBJECT 00037 00038 /**************************************************************************\ 00039 * PUBLIC CLASS FUNCTIONS * 00040 \**************************************************************************/ 00041 public: 00042 00043 CTransferWdt(QWidget *parent = 0,int transferSize = 1024); 00044 ~CTransferWdt(); 00045 00046 //TRANSFEREDIT 00047 QGradientStops GetColorStops(eColorSelectType type); 00048 void SetColorStops(QGradientStops & stopList, eColorSelectType type); 00049 void ClearColorStops(eColorSelectType type); 00050 00051 //HISTOGRAM 00052 CGLHistogram & GetHistogram(){return *pHistogram;} 00053 void SetHistogramData(float * data,int dataSize); 00054 void SetHistogramQuality(int quality); 00055 int GetHistogramQuality(); 00056 void SetHistogramSize(int size); 00057 int GetHistogramSize(); 00058 bool Logarithmic(){return ui.logCheck->isChecked();} 00059 bool Overlay(){return ui.overCheck->isChecked();} 00060 00061 //TRANSFER 00062 uchar * GetTransfer(){return transfer;} 00063 void SetTransferSize(int); 00064 QSize GetTransferSize(); 00065 00066 //TRIGGER UPDATE 00067 void UpdateTransfer(){pColorSelect->UpdateGradient();} 00068 00069 /**************************************************************************\ 00070 * PUBLIC SIGNALS * 00071 \**************************************************************************/ 00072 signals: 00073 00074 void Dirty(int); 00075 00076 /**************************************************************************\ 00077 * PROTECTED CLASS FUNCTIONS * 00078 \**************************************************************************/ 00079 protected: 00080 00081 void resizeEvent(QResizeEvent *); 00082 00083 /**************************************************************************\ 00084 * PRIVATE SLOTS * 00085 \**************************************************************************/ 00086 private slots: 00087 void on_overCheck_stateChanged(int); 00088 void on_logCheck_stateChanged(int); 00089 void on_overCheck_pressed(); 00090 void on_logCheck_pressed(); 00091 00092 void on_quantSlider_valueChanged(int); 00093 void on_colorSelect_Changed(); 00094 void on_alphaSelect_Changed(); 00095 00096 /**************************************************************************\ 00097 * PRIVATE CLASS MEMBERS * 00098 \**************************************************************************/ 00099 private: 00100 00101 Ui::CTransferWdtClass ui; 00102 00103 CGLHistogram * pHistogram; 00104 QSlider * pQualitySlider; 00105 QColorSelect * pColorSelect; 00106 QColorSelect * pAlphaSelect; 00107 00108 int histQuality; 00109 int histSize; 00110 00111 QImage * colorTransferImg; 00112 QImage * alphaTransferImg; 00113 uchar * transfer; 00114 00115 bool dirty; 00116 }; 00117 00118 #endif // CTRANSFERWDT_H