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
19class QLabel;
20class QImage;
21class QToolButton;
22class QPushButton;
23class QComboBox;
24class ClickableLabel;
25class LayoutWidget;
27class Subalbum;
28class Photo;
30//--------------------
31
34typedef enum
35{
42 //===============
43 //place effects that are not release quality below
44 //NUM_MANIPULATIONS to exclude them from the drop-down menu
48
49#include <qwidget.h>
51
52//=====================================
54//=====================================
55
57{
58Q_OBJECT
59
60public:
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//----------------------
78signals:
80//----------------------
81public slots:
84 void setFocus();
85 //----------------------
86protected:
87 void keyPressEvent( QKeyEvent *e );
88//----------------------
89private 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 //----------------------
156private:
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
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
A clickable label.
Interface for editing photo.
void flipVertical()
Flip image vertically.
bool findSelection(QPoint &topLeft, QPoint &bottomRight)
Finds the selected region of the image.
void adjustGrain()
Opens image grain editor.
ClickableLabel * previousButton
void removeRedeye()
Applies redeye removal.
void finishCorrectTilt(QPoint p1, QPoint p2)
Finish correcting and image's tilt.
void rotateSelection()
Rotate current selection.
ClickableLabel * redEyeReductionButton
The red eye reduction button is disabled when no selection is present.
QComboBox * effectsList
List of effects that can be applied to photos.
void startCorrectTilt()
Enter correct image tilt mode.
QSize * aspectRatioValues
array of common aspect ratios to crop to
Photo * photo
Pointer to backend photo.
void applyEffect()
Apply selected effect.
void selectAspectRatio()
Aspect ratio selection changed.
void enhanceContrast()
Enhance image contrast.
void selectEffect()
Effect seletion changed.
void colorBalance()
Improve color balance.
void showNextPrevFirstLastPhoto(Photo *newPhoto)
Utility method for show prev/next photos.
void showLastPhoto()
Show last photo.
void showFirstPhoto()
Show first photo.
void applyImageUpdate(QImage *editedImage, bool resetSelection)
Applies update to image.
QComboBox * orientations
void tuneLevels()
Opens levels editor for manual histogram and brightness/contrast adjustments.
void setPhoto(Subalbum *collection, Photo *photo)
Sets the photo pointer and constructs scaled qimage's for painting.
void crop()
Cropped image.
LayoutWidget * layout
Pointer to the parent layout widget.
void rotateFlip(TRANSFORM_CODE rotationFlipType)
Utility method for rotation + flip slots.
void returnAction()
Exit editing interface.
QComboBox * aspectRatios
Widget for selection aspect ratio to crop to.
QString effectPreviewImageFilename
Path to scaled down version of image for fast generation of previews of effects.
bool selectionRotated
state variable indicating if the user wants to use a rotate aspect ratio
EditingInterface(QWidget *parent=0, const char *name=0)
Constructs layout.
void keyPressEvent(QKeyEvent *e)
int displayResolutionIndex
Index for screen resolution, needed if this value pair changes during program executing.
QToolButton * cropButton
The crop buttons is disabled when no seletion is present.
QPushButton * applyEffectButton
The apply effect button is disabled when no effect has been chosen.
void selectAll(QPoint &topLeft, QPoint &bottomRight)
Return coordinates that select entire image.
void showPrevPhoto()
Show prev photo.
Subalbum * collection
========== Pointer to backend collection
void rotateRight()
Rotate image right 90 degrees.
void screenResolutionChanged()
Update recorded screen resolution and selection if necessary.
void rotateLeft()
Rotate image left 90 degrees.
Photo * getPhoto()
Returns a pointer to the currently selected photo.
ClickableLabel * nextButton
QToolButton * correctTiltButton
The start tilt button is disabled while a line is being selected.
void revertCurrentPhoto()
reverts current photo and updates display
int imageWidth
Dimension of photo in image coordinates.
SelectionInterface * selectionInterface
This widget scales and displays the photo to fit the available screen space, and provides extensive s...
void flipHorizontal()
Flip image horizontally.
void showNextPhoto()
Show next photo.
QLabel * effectPreview
Label that shows preview of effect.
int displayWidth
Dimension of photo in display coordinates.
Displays list of subalbums and a particular subalbum layout.
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image,...
Definition photo.h:45
Display widget for photos. Used by the PhotoEditWidget.
A subalbum contains photos.
Definition subalbum.h:49
MANIPULATION
Manipulations listed in the order in which they will be displayed in the drop down list.
@ INVERT_EFFECT
@ PAINTING_EFFECT
@ POINTILLISM_EFFECT
@ BW_EFFECT
@ EMBOSS_EFFECT
@ MOSAIC_EFFECT
@ SEPIA_EFFECT
@ NUM_MANIPULATIONS
TRANSFORM_CODE
Definition imageTools.h:25
QImage * editedImage
QPoint topLeft
QPoint bottomRight