histogramEditor.h

Go to the documentation of this file.
00001 //==============================================
00002 //  copyright            : (C) 2003-2005 by Will Stokes
00003 //==============================================
00004 //  This program is free software; you can redistribute it
00005 //  and/or modify it under the terms of the GNU General
00006 //  Public License as published by the Free Software
00007 //  Foundation; either version 2 of the License, or
00008 //  (at your option) any later version.
00009 //==============================================
00010 
00011 #ifndef GUI_EDITING_HISTOGRAMEDITOR_H
00012 #define GUI_EDITING_HISTOGRAMEDITOR_H
00013 
00014 //--------------------
00015 //forward declarations
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   //accepts changes, otherwise calls reject
00070   void applyAction();  
00071   
00073   void resetAction();
00074 
00076   void generateAdjustedPreviewImage();
00077   //----------------------
00078 private:
00079   //adjust image using current contrast, brightness, and histogram settings
00080   void adjustImage( QImage& image );
00081 
00082   //scale between two colors
00083   double scaleColor( double color, int left, int right );
00084   
00085   //original image filename
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

Generated on Wed Jan 24 05:38:28 2007 for AlbumShaper by  doxygen 1.5.1