00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef GUI_EDITING_HISTOGRAMEDITOR_H
00012 #define GUI_EDITING_HISTOGRAMEDITOR_H
00013
00014
00015
00016 class QFrame;
00017 class QComboBox;
00018 class ClickableLabel;
00019 class DynamicSlider;
00020 class HistogramInterface;
00021 class ScaledPreviewInterface;
00022
00023
00024 #include <qdialog.h>
00025
00026
00029
00030
00031 class HistogramEditor : public QDialog
00032 {
00033 Q_OBJECT
00034
00035 public:
00037 HistogramEditor(QString filename,
00038 QWidget *parent=0, const char* name=0);
00039
00040 ~HistogramEditor();
00041
00043 QImage* getModifiedImage();
00044
00046 void getHistBoundaries(int &lumLeft, int &lumRight,
00047 int &redLeft, int &redRight,
00048 int &greenLeft, int &greenRight,
00049 int &blueLeft, int &blueRight);
00050
00051 protected:
00052 void keyPressEvent(QKeyEvent *e);
00053 void keyReleaseEvent(QKeyEvent *e);
00054
00055 private slots:
00057 void selectPreviewImageType(int selection);
00058
00060 void selectHistogramType(int selection);
00061
00063 void resetBrightness();
00064
00066 void resetContrast();
00067
00069
00070 void applyAction();
00071
00073 void resetAction();
00074
00076 void generateAdjustedPreviewImage();
00077
00078 private:
00079
00080 void adjustImage( QImage& image );
00081
00082
00083 double scaleColor( double color, int left, int right );
00084
00085
00086 QString fileName;
00087
00089 double meanR, meanG, meanB;
00090
00092 ScaledPreviewInterface* previewInterface;
00093
00095 HistogramInterface* histogramInterface;
00096
00097 QComboBox* previewSelection;
00098 QComboBox* histogramType;
00099 ClickableLabel* brightnessIcon;
00100 ClickableLabel* contrastIcon;
00101 QFrame* buttonsFrame;
00102
00103
00105 DynamicSlider* brightness;
00106
00108 DynamicSlider* contrast;
00109 };
00110
00111
00112 #endif //GUI_EDITING_HISTOGRAMEDITOR_H