AlbumShaper  1.0a3
histogramEditor.h
Go to the documentation of this file.
1 //Added by qt3to4:
2 #include <Q3Frame>
3 #include <QKeyEvent>
4 //==============================================
5 // copyright : (C) 2003-2005 by Will Stokes
6 //==============================================
7 // This program is free software; you can redistribute it
8 // and/or modify it under the terms of the GNU General
9 // Public License as published by the Free Software
10 // Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //==============================================
13 
14 #ifndef GUI_EDITING_HISTOGRAMEDITOR_H
15 #define GUI_EDITING_HISTOGRAMEDITOR_H
16 
17 //--------------------
18 //forward declarations
19 class Q3Frame;
20 class QComboBox;
21 class ClickableLabel;
22 class DynamicSlider;
23 class HistogramInterface;
25 //--------------------
26 
27 #include <qdialog.h>
28 
29 //=====================================
32 //=====================================
33 
34 class HistogramEditor : public QDialog
35 {
36 Q_OBJECT
37 
38 public:
40  HistogramEditor(QString filename,
41  QWidget *parent=0, const char* name=0);
42 
44 
46  QImage* getModifiedImage();
47 
49  void getHistBoundaries(int &lumLeft, int &lumRight,
50  int &redLeft, int &redRight,
51  int &greenLeft, int &greenRight,
52  int &blueLeft, int &blueRight);
53  //----------------------
54 protected:
55  void keyPressEvent(QKeyEvent *e);
56  void keyReleaseEvent(QKeyEvent *e);
57  //----------------------
58 private slots:
60  void selectPreviewImageType(int selection);
61 
63  void selectHistogramType(int selection);
64 
66  void resetBrightness();
67 
69  void resetContrast();
70 
72  //accepts changes, otherwise calls reject
73  void applyAction();
74 
76  void resetAction();
77 
80  //----------------------
81 private:
82  //adjust image using current contrast, brightness, and histogram settings
83  void adjustImage( QImage& image );
84 
85  //scale between two colors
86  double scaleColor( double color, int left, int right );
87 
88  //original image filename
89  QString fileName;
90 
92  double meanR, meanG, meanB;
93 
96 
99 
100  QComboBox* previewSelection;
101  QComboBox* histogramType;
105 
106 
109 
112 };
113 //======================
114 
115 #endif //GUI_EDITING_HISTOGRAMEDITOR_H
A clickable label.
A more dynamic slider that provides moving tooltips that show the slider value.
Definition: dynamicSlider.h:24
Interface for adjusting image historgram using upper and lower bounds and bright and contrast control...
void resetContrast()
reset contrast
HistogramEditor(QString filename, QWidget *parent=0, const char *name=0)
Constructs layout.
void applyAction()
check for changes to settings, if so
QComboBox * previewSelection
void keyPressEvent(QKeyEvent *e)
void resetAction()
resets all adjustments
void selectHistogramType(int selection)
updates historgram interface
DynamicSlider * contrast
Contrast slider.
ClickableLabel * brightnessIcon
void selectPreviewImageType(int selection)
updates preview image
QImage * getModifiedImage()
get modified image that resulted from adjustments
void keyReleaseEvent(QKeyEvent *e)
HistogramInterface * histogramInterface
Histogram view.
double meanR
Mean color values.
void getHistBoundaries(int &lumLeft, int &lumRight, int &redLeft, int &redRight, int &greenLeft, int &greenRight, int &blueLeft, int &blueRight)
returns histogram boundaries
void adjustImage(QImage &image)
DynamicSlider * brightness
Brightness slider.
ClickableLabel * contrastIcon
QComboBox * histogramType
void generateAdjustedPreviewImage()
updates adjusted preview image
ScaledPreviewInterface * previewInterface
Preview image.
double scaleColor(double color, int left, int right)
Q3Frame * buttonsFrame
void resetBrightness()
reset brightness