ImageScrambler.h
#ifndef IMAGESCRAMBLER_H
#define IMAGESCRAMBLER_H
#include <QMainWindow>
#include <QFileDialog>
#include <QDir>
#include <QMessageBox>
#include <QShortcut>
#include <QImage>
namespace Ui {
class ImageScrambler;
}
class ImageScrambler : public QMainWindow
{
Q_OBJECT
public:
explicit ImageScrambler(QWidget *parent = 0);
~ImageScrambler();
void cropSwap(QImage &, int, int, int, int, int, int);
QImage ScrambleFilter(QImage image, int, int, int, int, int);
private slots:
void on_btnLoadNewImage_clicked();
void on_btnSave_clicked();
void on_btnScrambleImage_clicked();
void on_btnDescrambleImage_clicked();
void on_actionLoad_Image_triggered();
void on_actionSave_Image_triggered();
void on_actionScramble_Image_triggered();
void on_actionDescramble_Image_triggered();
private:
Ui::ImageScrambler *ui;
QImage originalImage;
QImage scrambledImage;
int scrambleDepth ;
};
#endif // MAINWINDOW_H
ImageScrambler::~ImageScrambler
~ImageScrambler()
Destructor.
Definition: ImageScrambler.cpp:45
Ui
Definition: ImageScrambler.h:11
ImageScrambler::on_btnScrambleImage_clicked
void on_btnScrambleImage_clicked()
Function invokes the ScrambleFilter function to scramble the image and load it in the GUI...
Definition: ImageScrambler.cpp:89
ImageScrambler::on_btnSave_clicked
void on_btnSave_clicked()
Function that saves the scrambled image in the computer.
Definition: ImageScrambler.cpp:75
ImageScrambler
Definition: ImageScrambler.h:15
ImageScrambler::scrambledImage
QImage scrambledImage
Definition: ImageScrambler.h:153
ImageScrambler::ScrambleFilter
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
ImageScrambler::on_btnDescrambleImage_clicked
void on_btnDescrambleImage_clicked()
Function that restore the scrambled image to the original image.
Definition: ImageScrambler.cpp:104
ImageScrambler::on_actionSave_Image_triggered
void on_actionSave_Image_triggered()
Function that invokes the on_btnSave_clicked() function.
Definition: ImageScrambler.cpp:123
ImageScrambler::on_btnLoadNewImage_clicked
void on_btnLoadNewImage_clicked()
Function display a file browsing window to load an image into the GUI.
Definition: ImageScrambler.cpp:56
ImageScrambler::on_actionDescramble_Image_triggered
void on_actionDescramble_Image_triggered()
Function that invokes the on_btnDescrambleImage_clicked() function.
Definition: ImageScrambler.cpp:141
ImageScrambler::originalImage
QImage originalImage
Definition: ImageScrambler.h:152
ImageScrambler::ImageScrambler
ImageScrambler(QWidget *parent=0)
Constructor.
Definition: ImageScrambler.cpp:10
ImageScrambler::on_actionLoad_Image_triggered
void on_actionLoad_Image_triggered()
Function that invokes the on_btnLoadNewImage_clicked() function.
Definition: ImageScrambler.cpp:114
ImageScrambler::cropSwap
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
ImageScrambler::on_actionScramble_Image_triggered
void on_actionScramble_Image_triggered()
Function that invokes the on_btnScrambleImage_clicked() function.
Definition: ImageScrambler.cpp:132
ImageScrambler::scrambleDepth
int scrambleDepth
Definition: ImageScrambler.h:154