AlbumShaper  1.0a3
grainEditor.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_GRAINEDITOR_H
15 #define GUI_EDITING_GRAINEDITOR_H
16 
17 //--------------------
18 //forward declarations
19 class BlurSharpenSlider;
22 //--------------------
23 class QComboBox;
24 class Q3Frame;
25 class ClickableLabel;
26 
27 #include <qdialog.h>
28 #include <qimage.h>
29 
30 //=====================================
32 //=====================================
33 
34 class GrainEditor : public QDialog
35 {
36 Q_OBJECT
37 
38 public:
40  GrainEditor(QString filename,
41  QWidget *parent=0, const char* name=0);
42 
43  ~GrainEditor();
44 
46  QImage* getModifiedImage();
47  //----------------------
48 protected:
49  void keyPressEvent(QKeyEvent *e);
50  void keyReleaseEvent(QKeyEvent *e);
51  //----------------------
52 private slots:
54  void selectPreviewImageType(int selection);
55 
57  void resetBoundaries();
58 
60  void resetRegions();
61 
63  //accepts changes, otherwise calls reject
64  void applyAction();
65 
67  void resetAction();
68 
70  void previewResized();
71 
74 
75  //----------------------
76 private:
77  //adjust image using current blur/sharpen setting
78  void adjustImage( QImage& image, QPoint offset );
79 
80  //original image filename
81  QString fileName;
82 
83  //original image size
85 
86  //Edges image
87  QImage edgesImage;
88 
89  //Cluster map - each pixel assigned an int for the cluster it belongs to
90  int* clusterMap;
92 
95 
98 
99  QComboBox* previewSelection;
101 
105 
108 };
109 //======================
110 
111 #endif //GUI_EDITING_GRAINEDITOR_H
void previewResized()
handle resize preview signals
void adjustImage(QImage &image, QPoint offset)
BlurSharpenSlider * regionsSlider
Definition: grainEditor.h:106
ClickableLabel * regionsIcon
Definition: grainEditor.h:107
QString fileName
Definition: grainEditor.h:81
int * clusterMap
Definition: grainEditor.h:90
void generateAdjustedPreviewImage()
generate and set adjusted image
QImage edgesImage
Definition: grainEditor.h:87
void keyPressEvent(QKeyEvent *e)
Interface for adjusting image grain by bluring and sharpening.
Definition: grainEditor.h:34
A selection region placement interface.
void selectPreviewImageType(int selection)
updates preview image
QImage * getModifiedImage()
get modified image that resulted from adjustments
A clickable label.
ClickableLabel * boundariesIcon
Definition: grainEditor.h:104
int numRegions
Definition: grainEditor.h:91
SelectionPlacementInterface * selectionPlacementInterface
Interface for placing selection.
Definition: grainEditor.h:97
BlurSharpenSlider * boundariesSlider
Grain slider.
Definition: grainEditor.h:103
void resetBoundaries()
reset blur/sharpen of object boundaries
QComboBox * previewSelection
Definition: grainEditor.h:99
void resetRegions()
reset blur/sharpen of regions
PanningPreviewInterface * previewInterface
Preview image.
Definition: grainEditor.h:94
QSize origImageSize
Definition: grainEditor.h:84
Q3Frame * buttonsFrame
Definition: grainEditor.h:100
void applyAction()
check for changes to settings, if so
void resetAction()
resets image grain to original state
GrainEditor(QString filename, QWidget *parent=0, const char *name=0)
Constructs layout.
Definition: grainEditor.cpp:40
void keyReleaseEvent(QKeyEvent *e)