AlbumShaper  1.0a3
editingInterface.h
Go to the documentation of this file.
1 //Added by qt3to4:
2 #include <QLabel>
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_EDITINGINTERFACE_H
15 #define GUI_EDITING_EDITINGINTERFACE_H
16 
17 //--------------------
18 //forward declarations
19 class QLabel;
20 class QImage;
21 class QToolButton;
22 class QPushButton;
23 class QComboBox;
24 class ClickableLabel;
25 class LayoutWidget;
26 class SelectionInterface;
27 class Subalbum;
28 class Photo;
30 //--------------------
31 
34 typedef enum
35 {
36  BW_EFFECT = 0,
42  //===============
43  //place effects that are not release quality below
44  //NUM_MANIPULATIONS to exclude them from the drop-down menu
47 } MANIPULATION;
48 
49 #include <qwidget.h>
50 #include "../../backend/tools/imageTools.h"
51 
52 //=====================================
54 //=====================================
55 
56 class EditingInterface : public QWidget
57 {
58 Q_OBJECT
59 
60 public:
62  EditingInterface(QWidget *parent=0, const char* name=0);
63 
65 
68 
70  Photo* getPhoto();
71 
72  //returns true if currently selected photo is revertable
74 
76  void revertCurrentPhoto();
77 //----------------------
78 signals:
79  void photoModified();
80 //----------------------
81 public slots:
84  void setFocus();
85  //----------------------
86 protected:
87  void keyPressEvent( QKeyEvent *e );
88 //----------------------
89 private slots:
91  void showPrevPhoto();
92 
94  void showNextPhoto();
95 
97  void showFirstPhoto();
98 
100  void showLastPhoto();
101 
103  void rotateRight();
104 
106  void rotateLeft();
107 
109  void flipHorizontal();
110 
112  void startCorrectTilt();
113 
115  void finishCorrectTilt( QPoint p1, QPoint p2 );
116 
118  void flipVertical();
119 
121  void selectAspectRatio();
122 
125 
127  void rotateSelection();
128 
130  void crop();
131 
133  void enhanceContrast();
134 
136  void colorBalance();
137 
139  void removeRedeye();
140 
142  void tuneLevels();
143 
145  void adjustGrain();
146 
148  void selectEffect();
149 
151  void applyEffect();
152 
154  void returnAction();
155  //----------------------
156 private:
158  void showNextPrevFirstLastPhoto( Photo* newPhoto );
159 
161  void rotateFlip( TRANSFORM_CODE rotationFlipType );
162 
164  bool findSelection(QPoint& topLeft, QPoint& bottomRight);
165 
167  void selectAll(QPoint& topLeft, QPoint& bottomRight);
168 
170  QImage* applyEffect(QString filename, ManipulationOptions* options=NULL);
171 
173  void applyImageUpdate(QImage* editedImage, bool resetSelection);
177 
181 
183  QComboBox* aspectRatios;
184 
185  //Widget for selecting orientation for cropping
186  QComboBox* orientations;
187 
190 
193  double* maxDimensions;
194 
197 
199  QToolButton* correctTiltButton;
200 
202  QToolButton* cropButton;
203 
206 
208  QComboBox* effectsList;
209 
211  QPushButton* applyEffectButton;
212 
218 
221 
224 
227 
230 
233 //----------------------
234 };
235 //======================
236 
237 #endif //GUI_EDITING_EDITINGINTERFACE_H
ClickableLabel * nextButton
QPoint bottomRight
QPoint topLeft
void crop()
Cropped image.
void applyImageUpdate(QImage *editedImage, bool resetSelection)
Applies update to image.
void enhanceContrast()
Enhance image contrast.
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image...
Definition: photo.h:44
int imageWidth
Dimension of photo in image coordinates.
TRANSFORM_CODE
Definition: imageTools.h:24
ClickableLabel * previousButton
Buttons for changing the shown image
void showPrevPhoto()
Show prev photo.
void adjustGrain()
Opens image grain editor.
MANIPULATION
Manipulations listed in the order in which they will be displayed in the drop down list...
QToolButton * correctTiltButton
The start tilt button is disabled while a line is being selected.
Subalbum * collection
========== Pointer to backend collection
void removeRedeye()
Applies redeye removal.
bool findSelection(QPoint &topLeft, QPoint &bottomRight)
Finds the selected region of the image.
void flipVertical()
Flip image vertically.
void rotateLeft()
Rotate image left 90 degrees.
void startCorrectTilt()
Enter correct image tilt mode.
void tuneLevels()
Opens levels editor for manual histogram and brightness/contrast adjustments.
Displays list of subalbums and a particular subalbum layout.
Definition: layoutWidget.h:39
void colorBalance()
Improve color balance.
void keyPressEvent(QKeyEvent *e)
void rotateRight()
Rotate image right 90 degrees.
void revertCurrentPhoto()
reverts current photo and updates display
A clickable label.
QString effectPreviewImageFilename
Path to scaled down version of image for fast generation of previews of effects.
A subalbum contains photos.
Definition: subalbum.h:48
QComboBox * effectsList
List of effects that can be applied to photos.
QPushButton * applyEffectButton
The apply effect button is disabled when no effect has been chosen.
void showNextPhoto()
Show next photo.
void rotateFlip(TRANSFORM_CODE rotationFlipType)
Utility method for rotation + flip slots.
void applyEffect()
Apply selected effect.
void finishCorrectTilt(QPoint p1, QPoint p2)
Finish correcting and image&#39;s tilt.
void rotateSelection()
Rotate current selection.
SelectionInterface * selectionInterface
This widget scales and displays the photo to fit the available screen space, and provides extensive s...
ClickableLabel * redEyeReductionButton
The red eye reduction button is disabled when no selection is present.
void selectAspectRatio()
Aspect ratio selection changed.
Display widget for photos. Used by the PhotoEditWidget.
QComboBox * aspectRatios
Widget for selection aspect ratio to crop to.
void flipHorizontal()
Flip image horizontally.
bool selectionRotated
state variable indicating if the user wants to use a rotate aspect ratio
Photo * photo
Pointer to backend photo.
QComboBox * orientations
void setPhoto(Subalbum *collection, Photo *photo)
Sets the photo pointer and constructs scaled qimage&#39;s for painting.
QLabel * effectPreview
Label that shows preview of effect.
QToolButton * cropButton
The crop buttons is disabled when no seletion is present.
void screenResolutionChanged()
Update recorded screen resolution and selection if necessary.
int displayResolutionIndex
Index for screen resolution, needed if this value pair changes during program executing.
void showNextPrevFirstLastPhoto(Photo *newPhoto)
Utility method for show prev/next photos.
QSize * aspectRatioValues
array of common aspect ratios to crop to
LayoutWidget * layout
Pointer to the parent layout widget.
QImage * editedImage
void showFirstPhoto()
Show first photo.
Photo * getPhoto()
Returns a pointer to the currently selected photo.
EditingInterface(QWidget *parent=0, const char *name=0)
Constructs layout.
void selectAll(QPoint &topLeft, QPoint &bottomRight)
Return coordinates that select entire image.
void returnAction()
Exit editing interface.
int displayWidth
Dimension of photo in display coordinates.
Interface for editing photo.
void showLastPhoto()
Show last photo.
void selectEffect()
Effect seletion changed.