My Project
ImageScrambler.h
1 #ifndef IMAGESCRAMBLER_H
2 #define IMAGESCRAMBLER_H
3 
4 #include <QMainWindow>
5 #include <QFileDialog>
6 #include <QDir>
7 #include <QMessageBox>
8 #include <QShortcut>
9 #include <QImage>
10 
11 namespace Ui {
12  class ImageScrambler;
13 }
14 
15 class ImageScrambler : public QMainWindow
16 {
17  Q_OBJECT
18 
19 public:
20 
26  explicit ImageScrambler(QWidget *parent = 0);
27 
34 
60  void cropSwap(QImage &, int, int, int, int, int, int);
61 
87  QImage ScrambleFilter(QImage image, int, int, int, int, int);
88 
89 private slots:
90 
98 
104  void on_btnSave_clicked();
105 
114 
121 
128 
135 
142 
149 
150 private:
151  Ui::ImageScrambler *ui;
152  QImage originalImage;
153  QImage scrambledImage;
155 };
156 
157 #endif // MAINWINDOW_H
~ImageScrambler()
Destructor.
Definition: ImageScrambler.cpp:45
Definition: ImageScrambler.h:11
void on_btnScrambleImage_clicked()
Function invokes the ScrambleFilter function to scramble the image and load it in the GUI...
Definition: ImageScrambler.cpp:89
void on_btnSave_clicked()
Function that saves the scrambled image in the computer.
Definition: ImageScrambler.cpp:75
Definition: ImageScrambler.h:15
QImage scrambledImage
Definition: ImageScrambler.h:153
QImage ScrambleFilter(QImage image, int, int, int, int, int)
Funtion that recursively scrambles an images by dividing the image in squares (sub images) and then s...
Definition: Filter.cpp:72
void on_btnDescrambleImage_clicked()
Function that restore the scrambled image to the original image.
Definition: ImageScrambler.cpp:104
void on_actionSave_Image_triggered()
Function that invokes the on_btnSave_clicked() function.
Definition: ImageScrambler.cpp:123
void on_btnLoadNewImage_clicked()
Function display a file browsing window to load an image into the GUI.
Definition: ImageScrambler.cpp:56
void on_actionDescramble_Image_triggered()
Function that invokes the on_btnDescrambleImage_clicked() function.
Definition: ImageScrambler.cpp:141
QImage originalImage
Definition: ImageScrambler.h:152
ImageScrambler(QWidget *parent=0)
Constructor.
Definition: ImageScrambler.cpp:10
void on_actionLoad_Image_triggered()
Function that invokes the on_btnLoadNewImage_clicked() function.
Definition: ImageScrambler.cpp:114
void cropSwap(QImage &, int, int, int, int, int, int)
Funtion that crop two squares of equal size of an image or sub image and swaps them. The funtion receives two coords (x0, y0) and (x1, y1) and a width and a height. Then swaps pixel by pixel the square formed from the top left coordinate (x0, y0) to the bottom right coordinate (x0+width, y0+height) with the square formed from the top left coordinate (x1, y1) to the bottom right (x1+width, y1+height).
Definition: Filter.cpp:29
void on_actionScramble_Image_triggered()
Function that invokes the on_btnScrambleImage_clicked() function.
Definition: ImageScrambler.cpp:132
int scrambleDepth
Definition: ImageScrambler.h:154