My Project
Public Member Functions | Private Slots | Private Attributes | List of all members
ImageScrambler Class Reference
Inheritance diagram for ImageScrambler:

Public Member Functions

 ImageScrambler (QWidget *parent=0)
 Constructor.
 
 ~ImageScrambler ()
 Destructor.
 
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). More...
 
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 swapping them. The first step the program does is divide the image in two or four squares and swap the squares, the resulting image is divided in four squares and then the same steps are applied recursively to each of the four squares. More...
 

Private Slots

void on_btnLoadNewImage_clicked ()
 Function display a file browsing window to load an image into the GUI.
 
void on_btnSave_clicked ()
 Function that saves the scrambled image in the computer.
 
void on_btnScrambleImage_clicked ()
 Function invokes the ScrambleFilter function to scramble the image and load it in the GUI.
 
void on_btnDescrambleImage_clicked ()
 Function that restore the scrambled image to the original image.
 
void on_actionLoad_Image_triggered ()
 Function that invokes the on_btnLoadNewImage_clicked() function.
 
void on_actionSave_Image_triggered ()
 Function that invokes the on_btnSave_clicked() function.
 
void on_actionScramble_Image_triggered ()
 Function that invokes the on_btnScrambleImage_clicked() function.
 
void on_actionDescramble_Image_triggered ()
 Function that invokes the on_btnDescrambleImage_clicked() function.
 

Private Attributes

Ui::ImageScrambler * ui
 
QImage originalImage
 
QImage scrambledImage
 
int scrambleDepth
 

Member Function Documentation

void ImageScrambler::cropSwap ( QImage &  img,
int  x0,
int  y0,
int  x1,
int  y1,
int  width,
int  height 
)

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).

Parameters
imgReference to the image to swap the squares.
x0The top left x coordinate of the first square in the image.
y0The top left y coordinate of the first square in the image.
x1The top left x coordinate of the second square in the image.
y1The top left y coordinate of the second square in the image.
widthWidth of the squares
heightHeight of the squares
QImage ImageScrambler::ScrambleFilter ( QImage  image,
int  N,
int  sx,
int  sy,
int  width,
int  height 
)

Funtion that recursively scrambles an images by dividing the image in squares (sub images) and then swapping them. The first step the program does is divide the image in two or four squares and swap the squares, the resulting image is divided in four squares and then the same steps are applied recursively to each of the four squares.

Parameters
imageThe image to scramble
NThe depth of the recursion. The image will be scrambled in 4^n squares.
sxStarting left top x coordinate of the image or sub image to divide
syStarting left top y coodinate of the image or sub image to divide
widthWidth of the received image
heightHeight of the received image
Returns
the scrambled image

Member Data Documentation

QImage ImageScrambler::originalImage
private

the original image (imagen original)

int ImageScrambler::scrambleDepth
private

recursive depth (profundidad de la recursion)

QImage ImageScrambler::scrambledImage
private

scrambled image (imagen revuelta)


The documentation for this class was generated from the following files: