Przeglądaj źródła

Correcciones gramaticales

SaraB 7 lat temu
rodzic
commit
25e7490be1
5 zmienionych plików z 21 dodań i 19 usunięć
  1. 1
    1
      Filter.cpp
  2. 7
    6
      ImageScrambler.cpp
  3. 10
    8
      ImageScrambler.h
  4. 2
    3
      README-en.md
  5. 1
    1
      README-es.md

+ 1
- 1
Filter.cpp Wyświetl plik

3
 
3
 
4
 
4
 
5
 // Given an image and two rectangles defined by the x,y locations of their
5
 // Given an image and two rectangles defined by the x,y locations of their
6
-// upperleft pixels and their height, width, swaps the pixels in those rectangles.
6
+// upperleft pixels and their height and width, the function swaps the pixels in those rectangles.
7
 // For example, for an image I with height and width of 100. The following invocation
7
 // For example, for an image I with height and width of 100. The following invocation
8
 // swaps the top and bottom halves of the image:
8
 // swaps the top and bottom halves of the image:
9
 // cropSwap(I, 0, 0, 0, 50, 100, 50)
9
 // cropSwap(I, 0, 0, 0, 50, 100, 50)

+ 7
- 6
ImageScrambler.cpp Wyświetl plik

18
     // KEYBOARD SHORTCUTS
18
     // KEYBOARD SHORTCUTS
19
     // ATAJOS DEL KEYBOARD
19
     // ATAJOS DEL KEYBOARD
20
 
20
 
21
-    // Loads a image with cmd + o
21
+    // Loads an image with cmd + o
22
     // Carga una imagen con cmd + o
22
     // Carga una imagen con cmd + o
23
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_O), this, SLOT(on_btnLoadNewImage_clicked()));
23
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_O), this, SLOT(on_btnLoadNewImage_clicked()));
24
-    // Saves a image with cmd + s
24
+    // Saves an image with cmd + s
25
     // Guarda una imagen con cmd + s
25
     // Guarda una imagen con cmd + s
26
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_S), this, SLOT(on_btnSave_clicked()));
26
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_S), this, SLOT(on_btnSave_clicked()));
27
     // Closes window with cmd + w
27
     // Closes window with cmd + w
28
     // Cierra la ventana con cmd + w
28
     // Cierra la ventana con cmd + w
29
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this, SLOT(close()));
29
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this, SLOT(close()));
30
-    // Scramble a image with cmd + e
30
+    // Scrambles an image with cmd + e
31
     // Revuelve una imagen con cmd + e
31
     // Revuelve una imagen con cmd + e
32
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_E), this, SLOT(on_btnScrambleImage_clicked()));
32
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_E), this, SLOT(on_btnScrambleImage_clicked()));
33
-    // Restore the image with cmd + d
33
+    // Restores the image with cmd + d
34
     // Restaura la imagen con cmd + d
34
     // Restaura la imagen con cmd + d
35
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_D), this, SLOT(on_btnDescrambleImage_clicked()));
35
     new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_D), this, SLOT(on_btnDescrambleImage_clicked()));
36
     ui->btnDescrambleImage->setEnabled(false);
36
     ui->btnDescrambleImage->setEnabled(false);
49
 
49
 
50
 /// \fn void ImageScrambler::on_btnLoadNewImage_clicked()
50
 /// \fn void ImageScrambler::on_btnLoadNewImage_clicked()
51
 /// \~English
51
 /// \~English
52
-/// \brief Function display a file browsing window to load an image into the GUI
52
+/// \brief Function that displays a browsing window file to load an image into the GUI
53
 /// \~Spanish
53
 /// \~Spanish
54
 /// \brief Funcion que despliega una ventana de busqueda de archivos para cargar
54
 /// \brief Funcion que despliega una ventana de busqueda de archivos para cargar
55
 /// una imagen en el GUI.
55
 /// una imagen en el GUI.
89
 void ImageScrambler::on_btnScrambleImage_clicked(){
89
 void ImageScrambler::on_btnScrambleImage_clicked(){
90
 
90
 
91
     //Call Scramble to scramble the image
91
     //Call Scramble to scramble the image
92
+    //Llamar Scramble para revolver la imagen
92
     scrambleDepth = ui->scrambleDepth->value() ;
93
     scrambleDepth = ui->scrambleDepth->value() ;
93
     scrambledImage = ScrambleFilter(originalImage, scrambleDepth, 0, 0, originalImage.width(),originalImage.height());
94
     scrambledImage = ScrambleFilter(originalImage, scrambleDepth, 0, 0, originalImage.width(),originalImage.height());
94
     ui->lblScrambleImage->setPixmap(QPixmap::fromImage(scrambledImage));
95
     ui->lblScrambleImage->setPixmap(QPixmap::fromImage(scrambledImage));
98
 
99
 
99
 /// \fn void ImageScrambler::on_btnDescrambleImage_clicked()
100
 /// \fn void ImageScrambler::on_btnDescrambleImage_clicked()
100
 /// \~English
101
 /// \~English
101
-/// \brief Function that restore the scrambled image to the original image.
102
+/// \brief Function that restores the scrambled image to the original image.
102
 /// \~Spanish
103
 /// \~Spanish
103
 /// \brief Funcion que restaura la imagen revuelta a la imagen original.
104
 /// \brief Funcion que restaura la imagen revuelta a la imagen original.
104
 void ImageScrambler::on_btnDescrambleImage_clicked(){
105
 void ImageScrambler::on_btnDescrambleImage_clicked(){

+ 10
- 8
ImageScrambler.h Wyświetl plik

34
 
34
 
35
     /// \fn void ImageScrambler::cropSwap(QImage &img, int x0, int y0, int x1, int y1, int width, int height )
35
     /// \fn void ImageScrambler::cropSwap(QImage &img, int x0, int y0, int x1, int y1, int width, int height )
36
     /// \~English
36
     /// \~English
37
-    /// \brief Funtion that crop two squares of equal size of an image or sub image and swaps them.
38
-    /// The funtion receives two coords (x0, y0) and (x1, y1)  and a width and a height. Then swaps pixel
37
+    /// \brief Function that crops two squares of equal size of an image or sub image and swaps them.
38
+    /// The function receives two coords (x0, y0) and (x1, y1)  and a width and a height. Then swaps pixel
39
     /// by pixel the square formed from the top left coordinate (x0, y0) to the bottom right coordinate (x0+width, y0+height)
39
     /// by pixel the square formed from the top left coordinate (x0, y0) to the bottom right coordinate (x0+width, y0+height)
40
     /// with the square formed from the top left coordinate (x1, y1) to the bottom right (x1+width, y1+height).
40
     /// with the square formed from the top left coordinate (x1, y1) to the bottom right (x1+width, y1+height).
41
     /// \param image Reference to the image to swap the squares.
41
     /// \param image Reference to the image to swap the squares.
61
 
61
 
62
     /// \fn QImage ImageScrambler::ScrambleFilter(QImage image, int N, int sw, int sh, int width, int height)
62
     /// \fn QImage ImageScrambler::ScrambleFilter(QImage image, int N, int sw, int sh, int width, int height)
63
     /// \~English
63
     /// \~English
64
-    /// \brief Funtion that recursively scrambles an images by dividing the image in squares (sub images)
64
+    /// \brief Function that recursively scrambles an image by dividing the image in squares (sub images)
65
     /// and then swapping them.  The first step the program does is divide the image in two or four squares
65
     /// and then swapping them.  The first step the program does is divide the image in two or four squares
66
     /// and swap the squares, the resulting image is divided in four squares and then the same steps are applied
66
     /// and swap the squares, the resulting image is divided in four squares and then the same steps are applied
67
     /// recursively to each of the four squares.
67
     /// recursively to each of the four squares.
74
     /// \return the scrambled image
74
     /// \return the scrambled image
75
     /// \~Spanish
75
     /// \~Spanish
76
     /// \brief Funcion que recursivamente revuelve una imagen dividiendola en cuadrados (sub imagenes)
76
     /// \brief Funcion que recursivamente revuelve una imagen dividiendola en cuadrados (sub imagenes)
77
-    /// y luego intercambiandolas.  El primer paso que el programa hace es dividir la imagen en two o cuatro cuadrados
78
-    /// e intercambia los cuadrados, el resultado de la imagen se divide en cuatros cuadros y cada uno de los cuadros
77
+    /// y luego intercambiandolas.  El primer paso que el programa hace es dividir la imagen en dos o cuatro cuadrados
78
+    /// e intercambia los cuadrados. El resultado de la imagen se divide en cuatros cuadros y cada uno de los cuadros
79
     /// se le aplican los mismos pasos recursivamente.
79
     /// se le aplican los mismos pasos recursivamente.
80
-    /// \param image The image a revolver
80
+    /// \param image La imagen a revolver
81
     /// \param level La profundidad de la recursion. La imagen se revolvera en 4^N cuadrados.
81
     /// \param level La profundidad de la recursion. La imagen se revolvera en 4^N cuadrados.
82
     /// \param sx La coordenada arriba izquierda x inicial de la imagen o sub imagen a dividir.
82
     /// \param sx La coordenada arriba izquierda x inicial de la imagen o sub imagen a dividir.
83
     /// \param sy La coordenada arriba izquierda y inicial de la imagen o sub imagen a dividir.
83
     /// \param sy La coordenada arriba izquierda y inicial de la imagen o sub imagen a dividir.
90
 
90
 
91
     /// \fn void ImageScrambler::on_btnLoadNewImage_clicked()
91
     /// \fn void ImageScrambler::on_btnLoadNewImage_clicked()
92
     /// \~English
92
     /// \~English
93
-    /// \brief Function display a file browsing window to load an image into the GUI
93
+    /// \brief Function that displays a browsing window file to load an image into the GUI
94
     /// \~Spanish
94
     /// \~Spanish
95
     /// \brief Funcion que despliega una ventana de busqueda de archivos para cargar
95
     /// \brief Funcion que despliega una ventana de busqueda de archivos para cargar
96
     /// una imagen en el GUI.
96
     /// una imagen en el GUI.
114
 
114
 
115
     /// \fn void ImageScrambler::on_btnDescrambleImage_clicked()
115
     /// \fn void ImageScrambler::on_btnDescrambleImage_clicked()
116
     /// \~English
116
     /// \~English
117
-    /// \brief Function that restore the scrambled image to the original image.
117
+    /// \brief Function that restores the scrambled image to the original image.
118
     /// \~Spanish
118
     /// \~Spanish
119
     /// \brief Funcion que restaura la imagen revuelta a la imagen original.
119
     /// \brief Funcion que restaura la imagen revuelta a la imagen original.
120
     void on_btnDescrambleImage_clicked();
120
     void on_btnDescrambleImage_clicked();
150
 private:
150
 private:
151
     Ui::ImageScrambler *ui;
151
     Ui::ImageScrambler *ui;
152
     QImage originalImage;  //This will hold the original image.
152
     QImage originalImage;  //This will hold the original image.
153
+			   //Esto aguantará la imagen original.
153
     QImage scrambledImage; //This will hold the encrypted image.
154
     QImage scrambledImage; //This will hold the encrypted image.
155
+			   //Esto aguantará la imagen cifrado .
154
     int scrambleDepth ;
156
     int scrambleDepth ;
155
 };
157
 };
156
 
158
 

+ 2
- 3
README-en.md Wyświetl plik

4
 ![main2.png](images/main2-small.png)
4
 ![main2.png](images/main2-small.png)
5
 ![main3.png](images/main3-small.png)
5
 ![main3.png](images/main3-small.png)
6
 
6
 
7
-[Verano 2016 - Ive - Coralys]
8
 
7
 
9
 One commonly used programming technique is *recursion*. With this technique, problems are solved by solving similar problems, but for smaller cases. We can build sets of objects or tasks using *recursive rules* and *initial values*. *Recursive functions* are functions that are self-invoking, using smaller sets or elements each time, until reaching a point where the initial value is used instead of self-invoking. In this laboratory experience, you will practice the definition and implementation of recursive functions to scramble an image and make it incomprehensible.
8
 One commonly used programming technique is *recursion*. With this technique, problems are solved by solving similar problems, but for smaller cases. We can build sets of objects or tasks using *recursive rules* and *initial values*. *Recursive functions* are functions that are self-invoking, using smaller sets or elements each time, until reaching a point where the initial value is used instead of self-invoking. In this laboratory experience, you will practice the definition and implementation of recursive functions to scramble an image and make it incomprehensible.
10
 
9
 
182
 
181
 
183
        ---
182
        ---
184
 
183
 
185
-     The button that says `Scramble Image` is programmed so it invokes a function called `ScramblerFilter`.
184
+     The button that says `Scramble Image` is programmed so it invokes a function called `ScrambleFilter`.
186
 
185
 
187
-3. Complete the function `ScrambleFIlter` contained in the `Filter.cpp` file so it implements the recursive algorithm to scramble images. The function has the following format:
186
+3. Complete the function `ScrambleFilter` contained in the `Filter.cpp` file so it implements the recursive algorithm to scramble images. The function has the following format:
188
 
187
 
189
      `QImage ImageScrambler::ScrambleFilter(QImage image, int N, int sx, int sy, int width, int height);`
188
      `QImage ImageScrambler::ScrambleFilter(QImage image, int N, int sx, int sy, int width, int height);`
190
 
189
 

+ 1
- 1
README-es.md Wyświetl plik

19
 
19
 
20
 Antes de llegar al laboratorio debes:
20
 Antes de llegar al laboratorio debes:
21
 
21
 
22
-1. Repasado los conceptos relacionados a funciones recursivas.
22
+1. Haber repasado los conceptos relacionados a funciones recursivas.
23
 
23
 
24
 2. Haber estudiado los conceptos e instrucciones para la sesión de laboratorio.
24
 2. Haber estudiado los conceptos e instrucciones para la sesión de laboratorio.
25
 
25