No Description

class_image_scrambler.tex 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. \hypertarget{class_image_scrambler}{}\section{Image\+Scrambler Class Reference}
  2. \label{class_image_scrambler}\index{Image\+Scrambler@{Image\+Scrambler}}
  3. Inheritance diagram for Image\+Scrambler\+:\begin{figure}[H]
  4. \begin{center}
  5. \leavevmode
  6. \includegraphics[height=2.000000cm]{class_image_scrambler}
  7. \end{center}
  8. \end{figure}
  9. \subsection*{Public Member Functions}
  10. \begin{DoxyCompactItemize}
  11. \item
  12. \hypertarget{class_image_scrambler_add8fe476a0557f10a1fdae5b2b8e576a}{}\hyperlink{class_image_scrambler_add8fe476a0557f10a1fdae5b2b8e576a}{Image\+Scrambler} (Q\+Widget $\ast$parent=0)\label{class_image_scrambler_add8fe476a0557f10a1fdae5b2b8e576a}
  13. \begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item
  14. \hypertarget{class_image_scrambler_aa0ad5b405d49d1769d7e794f391f8657}{}\hyperlink{class_image_scrambler_aa0ad5b405d49d1769d7e794f391f8657}{$\sim$\+Image\+Scrambler} ()\label{class_image_scrambler_aa0ad5b405d49d1769d7e794f391f8657}
  15. \begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item
  16. void \hyperlink{class_image_scrambler_afe4e275f55ee362ea7ce13fcec6f0b26}{crop\+Swap} (Q\+Image \&, int, int, int, int, int, int)
  17. \begin{DoxyCompactList}\small\item\em 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). \end{DoxyCompactList}\item
  18. Q\+Image \hyperlink{class_image_scrambler_a7eb90242d1779b98f48f9abe5ed7d698}{Scramble\+Filter} (Q\+Image image, int, int, int, int, int)
  19. \begin{DoxyCompactList}\small\item\em 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. \end{DoxyCompactList}\end{DoxyCompactItemize}
  20. \subsection*{Private Slots}
  21. \begin{DoxyCompactItemize}
  22. \item
  23. \hypertarget{class_image_scrambler_afa24bbf9d4f71fd0853478a66d74d5f4}{}void \hyperlink{class_image_scrambler_afa24bbf9d4f71fd0853478a66d74d5f4}{on\+\_\+btn\+Load\+New\+Image\+\_\+clicked} ()\label{class_image_scrambler_afa24bbf9d4f71fd0853478a66d74d5f4}
  24. \begin{DoxyCompactList}\small\item\em Function display a file browsing window to load an image into the G\+U\+I. \end{DoxyCompactList}\item
  25. \hypertarget{class_image_scrambler_aba8b3a0f8d406c9e48e1d0e9e429a60e}{}void \hyperlink{class_image_scrambler_aba8b3a0f8d406c9e48e1d0e9e429a60e}{on\+\_\+btn\+Save\+\_\+clicked} ()\label{class_image_scrambler_aba8b3a0f8d406c9e48e1d0e9e429a60e}
  26. \begin{DoxyCompactList}\small\item\em Function that saves the scrambled image in the computer. \end{DoxyCompactList}\item
  27. \hypertarget{class_image_scrambler_a2a548be139a62d30dea82e2797d51ec7}{}void \hyperlink{class_image_scrambler_a2a548be139a62d30dea82e2797d51ec7}{on\+\_\+btn\+Scramble\+Image\+\_\+clicked} ()\label{class_image_scrambler_a2a548be139a62d30dea82e2797d51ec7}
  28. \begin{DoxyCompactList}\small\item\em Function invokes the Scramble\+Filter function to scramble the image and load it in the G\+U\+I. \end{DoxyCompactList}\item
  29. \hypertarget{class_image_scrambler_a7c3ef8d29bfc424d296e95c6acdb427e}{}void \hyperlink{class_image_scrambler_a7c3ef8d29bfc424d296e95c6acdb427e}{on\+\_\+btn\+Descramble\+Image\+\_\+clicked} ()\label{class_image_scrambler_a7c3ef8d29bfc424d296e95c6acdb427e}
  30. \begin{DoxyCompactList}\small\item\em Function that restore the scrambled image to the original image. \end{DoxyCompactList}\item
  31. \hypertarget{class_image_scrambler_a7199f376e7dc4fc4b61145be2dcaaad3}{}void \hyperlink{class_image_scrambler_a7199f376e7dc4fc4b61145be2dcaaad3}{on\+\_\+action\+Load\+\_\+\+Image\+\_\+triggered} ()\label{class_image_scrambler_a7199f376e7dc4fc4b61145be2dcaaad3}
  32. \begin{DoxyCompactList}\small\item\em Function that invokes the \hyperlink{class_image_scrambler_afa24bbf9d4f71fd0853478a66d74d5f4}{on\+\_\+btn\+Load\+New\+Image\+\_\+clicked()} function. \end{DoxyCompactList}\item
  33. \hypertarget{class_image_scrambler_aef30dcfeee03fa8aee60fd7ba89815b3}{}void \hyperlink{class_image_scrambler_aef30dcfeee03fa8aee60fd7ba89815b3}{on\+\_\+action\+Save\+\_\+\+Image\+\_\+triggered} ()\label{class_image_scrambler_aef30dcfeee03fa8aee60fd7ba89815b3}
  34. \begin{DoxyCompactList}\small\item\em Function that invokes the \hyperlink{class_image_scrambler_aba8b3a0f8d406c9e48e1d0e9e429a60e}{on\+\_\+btn\+Save\+\_\+clicked()} function. \end{DoxyCompactList}\item
  35. \hypertarget{class_image_scrambler_ac7514d09c9ee2b021d803375eba95f74}{}void \hyperlink{class_image_scrambler_ac7514d09c9ee2b021d803375eba95f74}{on\+\_\+action\+Scramble\+\_\+\+Image\+\_\+triggered} ()\label{class_image_scrambler_ac7514d09c9ee2b021d803375eba95f74}
  36. \begin{DoxyCompactList}\small\item\em Function that invokes the \hyperlink{class_image_scrambler_a2a548be139a62d30dea82e2797d51ec7}{on\+\_\+btn\+Scramble\+Image\+\_\+clicked()} function. \end{DoxyCompactList}\item
  37. \hypertarget{class_image_scrambler_a80b3b6e575f0b24290d71d202d910fed}{}void \hyperlink{class_image_scrambler_a80b3b6e575f0b24290d71d202d910fed}{on\+\_\+action\+Descramble\+\_\+\+Image\+\_\+triggered} ()\label{class_image_scrambler_a80b3b6e575f0b24290d71d202d910fed}
  38. \begin{DoxyCompactList}\small\item\em Function that invokes the \hyperlink{class_image_scrambler_a7c3ef8d29bfc424d296e95c6acdb427e}{on\+\_\+btn\+Descramble\+Image\+\_\+clicked()} function. \end{DoxyCompactList}\end{DoxyCompactItemize}
  39. \subsection*{Private Attributes}
  40. \begin{DoxyCompactItemize}
  41. \item
  42. \hypertarget{class_image_scrambler_a9bdaf498f7f4d2b6143aae8ff59ddff3}{}Ui\+::\+Image\+Scrambler $\ast$ {\bfseries ui}\label{class_image_scrambler_a9bdaf498f7f4d2b6143aae8ff59ddff3}
  43. \item
  44. Q\+Image \hyperlink{class_image_scrambler_a90f0c2de88b3d790ab25460dc2222a60}{original\+Image}
  45. \item
  46. Q\+Image \hyperlink{class_image_scrambler_a691bd6839008b2ec5dc3bc2933328cc2}{scrambled\+Image}
  47. \item
  48. int \hyperlink{class_image_scrambler_a4d5951c83206c8cf7bad2c6a9f7387d8}{scramble\+Depth}
  49. \end{DoxyCompactItemize}
  50. \subsection{Member Function Documentation}
  51. \hypertarget{class_image_scrambler_afe4e275f55ee362ea7ce13fcec6f0b26}{}\index{Image\+Scrambler@{Image\+Scrambler}!crop\+Swap@{crop\+Swap}}
  52. \index{crop\+Swap@{crop\+Swap}!Image\+Scrambler@{Image\+Scrambler}}
  53. \subsubsection[{crop\+Swap}]{\setlength{\rightskip}{0pt plus 5cm}void Image\+Scrambler\+::crop\+Swap (
  54. \begin{DoxyParamCaption}
  55. \item[{Q\+Image \&}]{img, }
  56. \item[{int}]{x0, }
  57. \item[{int}]{y0, }
  58. \item[{int}]{x1, }
  59. \item[{int}]{y1, }
  60. \item[{int}]{width, }
  61. \item[{int}]{height}
  62. \end{DoxyParamCaption}
  63. )}\label{class_image_scrambler_afe4e275f55ee362ea7ce13fcec6f0b26}
  64. 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).
  65. \begin{DoxyParams}{Parameters}
  66. {\em img} & Reference to the image to swap the squares. \\
  67. \hline
  68. {\em x0} & The top left x coordinate of the first square in the image. \\
  69. \hline
  70. {\em y0} & The top left y coordinate of the first square in the image. \\
  71. \hline
  72. {\em x1} & The top left x coordinate of the second square in the image. \\
  73. \hline
  74. {\em y1} & The top left y coordinate of the second square in the image. \\
  75. \hline
  76. {\em width} & Width of the squares \\
  77. \hline
  78. {\em height} & Height of the squares \\
  79. \hline
  80. \end{DoxyParams}
  81. \hypertarget{class_image_scrambler_a7eb90242d1779b98f48f9abe5ed7d698}{}\index{Image\+Scrambler@{Image\+Scrambler}!Scramble\+Filter@{Scramble\+Filter}}
  82. \index{Scramble\+Filter@{Scramble\+Filter}!Image\+Scrambler@{Image\+Scrambler}}
  83. \subsubsection[{Scramble\+Filter}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Image Image\+Scrambler\+::\+Scramble\+Filter (
  84. \begin{DoxyParamCaption}
  85. \item[{Q\+Image}]{image, }
  86. \item[{int}]{N, }
  87. \item[{int}]{sx, }
  88. \item[{int}]{sy, }
  89. \item[{int}]{width, }
  90. \item[{int}]{height}
  91. \end{DoxyParamCaption}
  92. )}\label{class_image_scrambler_a7eb90242d1779b98f48f9abe5ed7d698}
  93. 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.
  94. \begin{DoxyParams}{Parameters}
  95. {\em image} & The image to scramble \\
  96. \hline
  97. {\em N} & The depth of the recursion. The image will be scrambled in 4$^\wedge$n squares. \\
  98. \hline
  99. {\em sx} & Starting left top x coordinate of the image or sub image to divide \\
  100. \hline
  101. {\em sy} & Starting left top y coodinate of the image or sub image to divide \\
  102. \hline
  103. {\em width} & Width of the received image \\
  104. \hline
  105. {\em height} & Height of the received image \\
  106. \hline
  107. \end{DoxyParams}
  108. \begin{DoxyReturn}{Returns}
  109. the scrambled image
  110. \end{DoxyReturn}
  111. \subsection{Member Data Documentation}
  112. \hypertarget{class_image_scrambler_a90f0c2de88b3d790ab25460dc2222a60}{}\index{Image\+Scrambler@{Image\+Scrambler}!original\+Image@{original\+Image}}
  113. \index{original\+Image@{original\+Image}!Image\+Scrambler@{Image\+Scrambler}}
  114. \subsubsection[{original\+Image}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Image Image\+Scrambler\+::original\+Image\hspace{0.3cm}{\ttfamily [private]}}\label{class_image_scrambler_a90f0c2de88b3d790ab25460dc2222a60}
  115. the original image (imagen original) \hypertarget{class_image_scrambler_a4d5951c83206c8cf7bad2c6a9f7387d8}{}\index{Image\+Scrambler@{Image\+Scrambler}!scramble\+Depth@{scramble\+Depth}}
  116. \index{scramble\+Depth@{scramble\+Depth}!Image\+Scrambler@{Image\+Scrambler}}
  117. \subsubsection[{scramble\+Depth}]{\setlength{\rightskip}{0pt plus 5cm}int Image\+Scrambler\+::scramble\+Depth\hspace{0.3cm}{\ttfamily [private]}}\label{class_image_scrambler_a4d5951c83206c8cf7bad2c6a9f7387d8}
  118. recursive depth (profundidad de la recursion) \hypertarget{class_image_scrambler_a691bd6839008b2ec5dc3bc2933328cc2}{}\index{Image\+Scrambler@{Image\+Scrambler}!scrambled\+Image@{scrambled\+Image}}
  119. \index{scrambled\+Image@{scrambled\+Image}!Image\+Scrambler@{Image\+Scrambler}}
  120. \subsubsection[{scrambled\+Image}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Image Image\+Scrambler\+::scrambled\+Image\hspace{0.3cm}{\ttfamily [private]}}\label{class_image_scrambler_a691bd6839008b2ec5dc3bc2933328cc2}
  121. scrambled image (imagen revuelta)
  122. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  123. \item
  124. Image\+Scrambler.\+h\item
  125. Filter.\+cpp\item
  126. Image\+Scrambler.\+cpp\end{DoxyCompactItemize}