00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef GUI_EDITING_EDITINGINTERFACE_H
00012 #define GUI_EDITING_EDITINGINTERFACE_H
00013
00014
00015
00016 class QLabel;
00017 class QImage;
00018 class QToolButton;
00019 class QPushButton;
00020 class QComboBox;
00021 class ClickableLabel;
00022 class LayoutWidget;
00023 class SelectionInterface;
00024 class Subalbum;
00025 class Photo;
00026 class ManipulationOptions;
00027
00028
00031 typedef enum
00032 {
00033 BW_EFFECT = 0,
00034 SEPIA_EFFECT,
00035 INVERT_EFFECT,
00036 EMBOSS_EFFECT,
00037 MOSAIC_EFFECT,
00038 PAINTING_EFFECT,
00039
00040
00041
00042 NUM_MANIPULATIONS,
00043 POINTILLISM_EFFECT,
00044 } MANIPULATION;
00045
00046 #include <qwidget.h>
00047 #include "../../backend/tools/imageTools.h"
00048
00049
00051
00052
00053 class EditingInterface : public QWidget
00054 {
00055 Q_OBJECT
00056
00057 public:
00059 EditingInterface(QWidget *parent=0, const char* name=0);
00060
00061 ~EditingInterface();
00062
00064 void setPhoto(Subalbum* collection, Photo* photo);
00065
00067 Photo* getPhoto();
00068
00069
00070 bool currentPhotoRevertable();
00071
00073 void revertCurrentPhoto();
00074
00075 signals:
00076 void photoModified();
00077
00078 public slots:
00079 void handleSelectionChanged();
00080 void handleAspectRatioChanged();
00081 void setFocus();
00082
00083 protected:
00084 void keyPressEvent( QKeyEvent *e );
00085
00086 private slots:
00088 void showPrevPhoto();
00089
00091 void showNextPhoto();
00092
00094 void showFirstPhoto();
00095
00097 void showLastPhoto();
00098
00100 void rotateRight();
00101
00103 void rotateLeft();
00104
00106 void flipHorizontal();
00107
00109 void startCorrectTilt();
00110
00112 void finishCorrectTilt( QPoint p1, QPoint p2 );
00113
00115 void flipVertical();
00116
00118 void selectAspectRatio();
00119
00121 void screenResolutionChanged();
00122
00124 void rotateSelection();
00125
00127 void crop();
00128
00130 void enhanceContrast();
00131
00133 void colorBalance();
00134
00136 void removeRedeye();
00137
00139 void tuneLevels();
00140
00142 void adjustGrain();
00143
00145 void selectEffect();
00146
00148 void applyEffect();
00149
00151 void returnAction();
00152
00153 private:
00155 void showNextPrevFirstLastPhoto( Photo* newPhoto );
00156
00158 void rotateFlip( TRANSFORM_CODE rotationFlipType );
00159
00161 bool findSelection(QPoint& topLeft, QPoint& bottomRight);
00162
00164 void selectAll(QPoint& topLeft, QPoint& bottomRight);
00165
00167 QImage* applyEffect(QString filename, ManipulationOptions* options=NULL);
00168
00170 void applyImageUpdate(QImage* editedImage, bool resetSelection);
00173 ClickableLabel *previousButton, *nextButton;
00174
00177 SelectionInterface* selectionInterface;
00178
00180 QComboBox* aspectRatios;
00181
00182
00183 QComboBox* orientations;
00184
00186 int displayResolutionIndex;
00187
00189 QSize* aspectRatioValues;
00190 double* maxDimensions;
00191
00193 bool selectionRotated;
00194
00196 QToolButton* correctTiltButton;
00197
00199 QToolButton* cropButton;
00200
00202 ClickableLabel* redEyeReductionButton;
00203
00205 QComboBox* effectsList;
00206
00208 QPushButton* applyEffectButton;
00209
00211 QLabel* effectPreview;
00214 Subalbum* collection;
00215
00217 Photo* photo;
00218
00220 QString effectPreviewImageFilename;
00221
00223 LayoutWidget* layout;
00224
00226 int displayWidth, displayHeight;
00227
00229 int imageWidth, imageHeight;
00230
00231 };
00232
00233
00234 #endif //GUI_EDITING_EDITINGINTERFACE_H