My Project
|
Public Member Functions | |
MainWindow (QWidget *parent=0) | |
Constructor. More... | |
void | GrayScale (QImage &) |
Function that applies a greyscale filter in the edited image. It works by turning each pixel into the color grey. More... | |
void | VerticalFlip (QImage &) |
Function that applies a vertical flip to the edited image. It works by putting the pixel from the original image in the heigth-1-j position of the edited image. More... | |
void | HorizontalFlip (QImage &) |
Function that applies a horizontal flip to the edited image. It works by putting the pixel from the original image in the width-1-i position of the edited image. More... | |
void | ThresholdFilter (QImage &, QImage &, unsigned int, bool) |
Function that applies a theshold filter to the edited image. It works by creating a black and white image where the color of the new pixel is white or black depending on a threshold value and the average of the colors of the pixel of the original image. More... | |
MainWindow (QWidget *parent=0) | |
void | GrayScale (QImage &) |
void | VerticalFlip (QImage &) |
void | HorizontalFlip (QImage &) |
void | ThresholdFilter (QImage &, QImage &, unsigned int, bool) |
Private Slots | |
void | on_actionLoad_Image_triggered () |
Invokes function on_btnLoadImage_clicked() More... | |
void | on_actionSave_Image_triggered () |
Invokes function on_btnSaveImage_clicked() | |
void | on_actionClose_Window_triggered () |
void | on_actionInvert_Threshold_Colors_triggered () |
Invokes function on_btnInvertThreshold_clicked() | |
void | on_actionFlip_Image_Horizontally_triggered () |
Invokes function on_btnFlipImageHorizontally_clicked() | |
void | on_actionFlip_Image_Vertically_triggered () |
Invokes function on_btnFlipImageVertically_clicked() | |
void | on_actionApply_Grey_Scale_Filter_triggered () |
Invokes function on_btnGreyScaleFilter_clicked() | |
void | on_actionRevert_Edited_Image_to_Original_triggered () |
Invokes function on_btnRevertImage_clicked() | |
void | on_actionInstructions_triggered () |
To display the instructions. | |
void | applyThresholdFilter () |
To apply the threshold filter. | |
void | instructions () |
To display the instructions. | |
void | on_thresholdSlider_sliderReleased () |
To apply the threshold filter and load the edited image to the GUI when the GUI slider is moved. | |
void | on_btnLoadImage_clicked () |
To load an image to the GUI when the load image option is selected. | |
void | on_btnSaveImage_clicked () |
To save an image to the file system when the save image option is selected. | |
void | on_chboxThreshold_clicked () |
To apply the threshold filter and load the edited image to the GUI. | |
void | on_btnInvertThreshold_clicked () |
To apply the threshold filter and load the edited image to the GUI when the threshold color is inverted. | |
void | on_btnFlipImageHorizontally_clicked () |
To call the horizontal flip image filter. | |
void | on_btnFlipImageVertically_clicked () |
To call the vertical flip image filter. | |
void | on_btnGreyScaleFilter_clicked () |
To call the Gray Scale image filter. | |
void | on_btnRevertImage_clicked () |
To reset the edited image to the original image. | |
void | on_actionLoad_Image_triggered () |
void | on_actionSave_Image_triggered () |
void | on_actionClose_Window_triggered () |
void | on_actionInvert_Threshold_Colors_triggered () |
void | on_actionFlip_Image_Horizontally_triggered () |
void | on_actionFlip_Image_Vertically_triggered () |
void | on_actionApply_Grey_Scale_Filter_triggered () |
void | on_actionRevert_Edited_Image_to_Original_triggered () |
void | on_actionInstructions_triggered () |
void | applyThresholdFilter () |
void | instructions () |
void | on_thresholdSlider_sliderReleased () |
void | on_btnLoadImage_clicked () |
void | on_btnSaveImage_clicked () |
void | on_chboxThreshold_clicked () |
void | on_btnInvertThreshold_clicked () |
void | on_btnFlipImageHorizontally_clicked () |
void | on_btnFlipImageVertically_clicked () |
void | on_btnGreyScaleFilter_clicked () |
void | on_btnRevertImage_clicked () |
Private Attributes | |
Ui::MainWindow * | ui |
QImage | originalImage |
QImage | editedImage |
bool | invertColor |
|
explicit |
Constructor.
Destructor.
KEYBOARD SHORTCUTS Loads a image with cmd + o Carga una imagen con cmd + o
Saves a image with cmd + s Guarda una imagen con cmd + s
Closes window with cmd + w Cierra la ventana con cmd + w
Inverts threshold color with cmd + t Invierte el color umbral con cmd + t
Flips horizontally a image with cmd + f Rota horizontalmente una imagen con cmd + f
Flips vertically a image with cmd + v Rota verticalmente una imagen con cmd + v
Applies greyscale filter to a image with cmd + g Aplica el filtro de tonos grises a una imagen con cmd + g
Resets an edited image to the orignal one to a image with cmd + r Devuelve la imagen editada a su estado original con cmd + r
Display the instructions with cmd + i Despliega las instrucciones con cmd + i
void MainWindow::GrayScale | ( | QImage & | editedImage | ) |
Function that applies a greyscale filter in the edited image. It works by turning each pixel into the color grey.
Function that applies a greyscale filter to the edited image. It works by turning each pixel into the color grey. For this we use two for loops to access the pixels of the edited image.
originalImage | Reference to the original image (no filter) |
editedImage | Reference to the destination image with the filter applied. |
void MainWindow::HorizontalFlip | ( | QImage & | editedImage | ) |
Function that applies a horizontal flip to the edited image. It works by putting the pixel from the original image in the width-1-i position of the edited image.
Function that applies a horizontal flip to the edited image For this we use two for loops to access the pixels of the images. In the first loop we go through the x axis and in the second we go through the y axis and inside of it we put the pixel from the original image in the width-1-i position of the edited image.
originalImage | Reference to the original image (no filter) |
editedImage | Reference to the destination image with the filter applied. |
|
privateslot |
Invokes function on_btnLoadImage_clicked()
ACTION FUNCTIONS
void MainWindow::ThresholdFilter | ( | QImage & | originalImage, |
QImage & | editedImage, | ||
unsigned int | threshold, | ||
bool | color | ||
) |
Function that applies a theshold filter to the edited image. It works by creating a black and white image where the color of the new pixel is white or black depending on a threshold value and the average of the colors of the pixel of the original image.
originalImage | Reference to the original image (no filter) |
editedImage | Reference to the destination image with the filter applied. |
threshold | Integer value that serves as a black or white color threshold |
color | boolean value to select which color white or black if the color average is under or over the threshold. |
Function that applies a threshold filter to the edited image. For this we use two for loops to access the pixels of the images. In the first loop we go through the x axis and in the second we go through the y axis.
void MainWindow::VerticalFlip | ( | QImage & | editedImage | ) |
Function that applies a vertical flip to the edited image. It works by putting the pixel from the original image in the heigth-1-j position of the edited image.
Function that applies a vertical flip to the edited image. For this we use two for loops to access the pixels of the images. In the first loop we go through the x axis and in the second we go through the y axis and inside of it we put the pixel from the original image in the heigth-1-j position of the edited image.
originalImage | Reference to the original image (no filter) |
editedImage | Reference to the destination image with the filter applied. |