Skip to content

Commit

Permalink
PhotoLaboratory Project Finish
Browse files Browse the repository at this point in the history
  • Loading branch information
tonitaga committed Jul 12, 2023
0 parents commit 89a252b
Show file tree
Hide file tree
Showing 67 changed files with 3,674 additions and 0 deletions.
Empty file added CHANGELOG
Empty file.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# tonitaga License
82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# <img src="src/View/PhotoLaboratoryIcon.ico" width="25" height="25">PhotoLaboratory by tonitaga<img src="src/View/PhotoLaboratoryIcon.ico" width="25" height="25">

---
<p align="center">
<img src="misc/dvi_images/girl_hsl_hue.gif" alt="Powered by PhotoLaboratory" style="width: 20vw; min-width: 300px;" />
</p>

## Contents

1. [Main Information](#main-information)
2. [What it looks like?](#what-it-looks-like)\
2.1. [Main Window](#main-welcome-window)\
2.2. [Edit Window](#edit-window)\
2.3. [Custom Kernel Window](#custom-kernel-window)
3. [Application's Menu](#applications-menu)
4. [HotKeys and ToolTips](#hotkeys-and-tooltips)

---
## Main information:

The application is developed in the C++ programming language and allows the user to apply various filters to his image.\
The application supports images in the png bmp jpg jpeg format.\
You can find 12 different filters in the application:
---
1) <b>Convolution filters</b>: Emboss, Sharpen, BoxBlur, GaussianBlur, Laplacian, Prewitt, Custom
2) <b>Non Convolution filters</b>: GrayScale, Negative, Toning
3) <b>Color-correction filters</b>: Contrast, Brightness, HSV color model, HSL color model
---

## What it looks like?

#### Main (Welcome) window
<p align="center">
<img src="misc/dvi_images/main_window.png" style="width: 50vw; min-width: 300px;" />
</p>

#### Edit window
<p align="center">
<img src="misc/dvi_images/edit_window.png" style="width: 50vw; min-width: 300px;" />
</p>

#### Custom Kernel window
<p align="center">
<img src="misc/dvi_images/kernel_window.png" style="width: 50vw; min-width: 300px;" />
</p>

---

## Application's Menu

The application has a menu with additional options.\
The menu is divided into four parts:
1) File menu (allows you to import and export images).
2) Edit menu (with this menu you can also use some filters, added possibility to adjust window transparency).
3) Image menu (allows you to choose one of three types of image display).
4) Help menu (let you navigate between windows and learn more about the application).

<p align="center">
<img src="misc/dvi_images/file_menu.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/menu_edit.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/menu_image.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/menu_help.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/image_control_size.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/menu_filters.png" style="width: 50vw; min-width: 300px;" />
</p>

---

## HotKeys and ToolTips

Most of the buttons have hotkeys, short information about what this button does can be seen by putting the mouse cursor over it.\
Almost all that is in the application have their own short information, you just need to move the mouse.

<p align="center">
<img src="misc/dvi_images/tooltip.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/color_preview.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/image_tooltip.png" style="width: 50vw; min-width: 300px;" />
</p>

---

#### © tonitaga (Нурислам Губайдуллин) 15.04.2023
82 changes: 82 additions & 0 deletions README_RUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# <img src="src/View/PhotoLaboratoryIcon.ico" width="25" height="25">PhotoLaboratory by tonitaga<img src="src/View/PhotoLaboratoryIcon.ico" width="25" height="25">

---
<p align="center">
<img src="misc/dvi_images/girl_hsl_hue.gif" alt="Powered by PhotoLaboratory" style="width: 20vw; min-width: 300px;" />
</p>

## Contents

1. [Основная информация](#основная-информация)
2. [Как оно выглядит?](#как-оно-выглядит)\
2.1. [Основное окно](#главное-приветственное-окно)\
2.2. [Окно редактирования](#окно-редактирования)\
2.3. [Окно произвольной матрицы ярда фильтра](#окно-произвольной-матрицы-ярда-фильтра)
3. [Меню приложения](#меню-приложения)
4. [Горячие клавиши и Подсказки](#горячие-клавиши-и-подсказки)

---
## Основная информация:

Приложение разработано на языке программирования С++, и позволяет пользователю применять различные фильтры к своему изображению.\
Приложение поддерживает изображения формата png bmp jpg jpeg.\
В приложении вы сможете найти 12 различных фильтров:
---
1) <b>Convolution filters</b>: Барельеф, Повышение резкости, Блочное размытие, Гауссово размытие, Фильтр Лапласа, Фильтр Прюитта, Произвольную матрица ядра фильтра
2) <b>Non Convolution filters</b>: Обесцвечивание, Негатив, Тонирование
3) <b>Color-correction filters</b>: Изменение контрастности, Изменение яркости, работа с насыщенностью по моделям HSL и HSV
---

## Как оно выглядит?

* Главное (Приветственное) окно
<p align="center">
<img src="misc/dvi_images/main_window.png" style="width: 50vw; min-width: 300px;" />
</p>

* Окно редактирования
<p align="center">
<img src="misc/dvi_images/edit_window.png" style="width: 50vw; min-width: 300px;" />
</p>

* Окно произвольной матрицы ярда фильтра
<p align="center">
<img src="misc/dvi_images/kernel_window.png" style="width: 50vw; min-width: 300px;" />
</p>

---

## Меню приложения

У приложения есть меню, где есть дополнительные возможности.\
Меню подразделяется на 4 части:
1) File menu (позволит импортировать и экспортировать изображения).
2) Edit menu (позволит использовать некоторые фильтры, добавлена возможность регулировать прозрачность окна).
3) Image menu (позволит выбрать одну из трех типов отображения изображения).
4) Help menu (позволит переходить между окнами и узнать о приложении побольше).

<p align="center">
<img src="misc/dvi_images/file_menu.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/menu_edit.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/menu_image.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/menu_help.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/image_control_size.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/menu_filters.png" style="width: 50vw; min-width: 300px;" />
</p>

---

## Горячие клавиши и Подсказки

Большинство кнопок имеют горячие клавиши, краткую информацию о том что делает данная кнопка можно увидеть наведя нее мышью.\
Практически все что есть в приложении имеют свою краткую информацию, нужно лишь навести мышкой.

<p align="center">
<img src="misc/dvi_images/tooltip.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/color_preview.png" style="width: 50vw; min-width: 300px;" />
<img src="misc/dvi_images/image_tooltip.png" style="width: 50vw; min-width: 300px;" />
</p>

---

#### © tonitaga (Нурислам Губайдуллин) 15.04.2023
2 changes: 2 additions & 0 deletions materials/linters/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BasedOnStyle: Google
1 change: 1 addition & 0 deletions misc/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added misc/dvi_images/color_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/edit_window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/file_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/girl_hsl_hue.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/image_control_size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/image_tooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/kernel_window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/main_window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/menu_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/menu_filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/menu_help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/menu_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/dvi_images/tooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_boxblur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_bright.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_emboss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_gaussianblur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_grayscale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_hslv_0_255_130.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_kernel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_laplacian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_negative.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_original2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/test_images/test_prewitt.png
Binary file added misc/test_images/test_sharpen.png
Binary file added misc/test_images/test_toning.png
97 changes: 97 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
cmake_minimum_required(VERSION 3.5)

project(PhotoLaboratory VERSION 0.1 LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)

include_directories(
${CMAKE_SOURCE_DIR}/View
${CMAKE_SOURCE_DIR}/Controller
${CMAKE_SOURCE_DIR}/Model
${CMAKE_SOURCE_DIR}/Model/FilterModel
${CMAKE_SOURCE_DIR}/Model/FilterHelper
${CMAKE_SOURCE_DIR}/Model/FilterHelper/FilterManagers
${CMAKE_SOURCE_DIR}/Model/FilterHelper/Filters
${CMAKE_SOURCE_DIR}/Model/FilterHelper/Filters/ConvolutionFilters
${CMAKE_SOURCE_DIR}/Model/FilterHelper/Filters/NonConvolutionFilters
${CMAKE_SOURCE_DIR}/Model/FilterHelper/Filters/ColorCorrectionFilters
)

set(PROJECT_SOURCES
main.cc
View/view.cc
View/view_help.cc
View/view.ui
View/customkernelview.cc
View/customkernelview.ui
Model/FilterHelper/Filters/ColorCorrectionFilters/colorcorrectionfilters.cc
Model/FilterHelper/Filters/NonConvolutionFilters/nonconvolutionfilters.cc
Model/FilterHelper/Filters/ConvolutionFilters/convolutionfilters.cc
Model/FilterHelper/basefilter.cc
)

set(MACOSX_BUNDLE_ICON_FILE PhotoLaboratoryIcon.icns)
set(APP_ICON ${CMAKE_CURRENT_SOURCE_DIR}/View/PhotoLaboratoryIcon.icns)
set_source_files_properties(${APP_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")


if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(PhotoLaboratory
MANUAL_FINALIZATION
${APP_ICON}
${PROJECT_SOURCES}
View/icon.qrc
View/icon.rc
)

#if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
# qt_add_executable(PhotoLaboratory
# MANUAL_FINALIZATION
# ${APP_ICON}
# ${PROJECT_SOURCES}
# View/icon.qrc
# View/icon.rc
# )
# Define target properties for Android with Qt 6 as:
# set_property(TARGET PhotoLaboratory APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
else()
if(ANDROID)
add_library(PhotoLaboratory SHARED
${PROJECT_SOURCES}
)
# Define properties for Android with Qt 5 after find_package() calls as:
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
else()
add_executable(PhotoLaboratory
${PROJECT_SOURCES}
)
endif()
endif()

target_link_libraries(PhotoLaboratory PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)

set_target_properties(PhotoLaboratory PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)

install(TARGETS PhotoLaboratory
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(PhotoLaboratory)
endif()
35 changes: 35 additions & 0 deletions src/Controller/filtercontroller.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef FILTERENGINE_FILTERCONTROLLER_H
#define FILTERENGINE_FILTERCONTROLLER_H

#include "../Model/FilterModel/filtermodel.h"

namespace ng {
/**
* =============== FilterController class ===============
* Main information:
* FilterController is the class that controls the ng::FilterModel class
*/
class FilterController {
public:
FilterController() = default;
~FilterController() = default;

void ExecuteFilter() { model_.ExecuteFilter(); }

void setBasicImage(const QImage &image) { model_.setBasicImage(image); }

template <typename Filter, typename... Constract>
void setFilter(Constract &&...constract_arguments) {
model_.setFilter<Filter>(constract_arguments...);
}

[[nodiscard]] QImage getFilteredImage() const {
return model_.getFilteredImage();
}

private:
FilterModel model_;
};
} // namespace ng

#endif // FILTERENGINE_FILTERCONTROLLER_H
69 changes: 69 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
OS=$(shell uname)
ifeq ($(OS), Linux)
OPEN=xdg-open
else
OPEN=open
endif

install:
cmake -S . -B ../build
cmake --build ../build
@cp -rf ../build/PhotoLaboratory.app $(HOME)/Applications/

uninstall:
@rm -rf $(HOME)/Applications/PhotoLaboratory.app

tests:
@cmake -S ./Test -B ../buildtest
@cmake --build ../buildtest
@../buildtest/PhotoLaboratoryTest

gcov_report:
@cmake -S ./Test -B ../buildgcov
@cmake --build ../buildgcov
@chmod +x *
@../buildgcov/PhotoLaboratoryTest
@lcov -t "gcov_report" -o gcov_report.info --no-external -c -d .
@genhtml -o report/ gcov_report.info
@open ./report/index.html

leaks:
@cmake -S ./Test -B ../buildtest
@cmake --build ../buildtest
@CK_FORK=no leaks --atExit -- ../buildtest/PhotoLaboratoryTest

dvi:
@$(OPEN) -n -a "Google Chrome" --args "--new-window" "https://github.com/tonitaga/PhotoLab_v1.0"

dist:
@rm -rf PhotoLaboratory
@mkdir PhotoLaboratory
@cp -R ../build/PhotoLaboratory.app PhotoLaboratory
@tar -czvf PhotoLaboratory.tar PhotoLaboratory
@rm -rf PhotoLaboratory

bist:
@rm -rf PhotoLaboratory.tar

clean:
@rm -rf ../build

style:
@cp ../materials/linters/.clang-format .clang-format
@clang-format -i Controller/*.h Model/FilterModel/*.h Model/FilterHelper/*.cc Model/FilterHelper/*.h
@clang-format -i Model/FilterHelper/Filters/ConvolutionFilters/*.cc Model/FilterHelper/Filters/ConvolutionFilters/*.h
@clang-format -i Model/FilterHelper/Filters/NonConvolutionFilters/*.cc Model/FilterHelper/Filters/NonConvolutionFilters/*.h
@clang-format -i Model/FilterHelper/FilterManagers/*.h
@clang-format -i Test/*.cc
@clang-format -i View/*.cc View/*.h
@clang-format -i *.cc


@clang-format -n Controller/*.h Model/FilterModel/*.h Model/FilterHelper/*.cc Model/FilterHelper/*.h
@clang-format -n Model/FilterHelper/Filters/ColorCorrectionFilters/*.cc Model/FilterHelper/Filters/ColorCorrectionFilters/*.h
@clang-format -n Model/FilterHelper/Filters/ConvolutionFilters/*.cc Model/FilterHelper/Filters/ConvolutionFilters/*.h
@clang-format -n Model/FilterHelper/Filters/NonConvolutionFilters/*.cc Model/FilterHelper/Filters/NonConvolutionFilters/*.h
@clang-format -n Model/FilterHelper/FilterManagers/*.h
@clang-format -n Test/*.cc
@clang-format -n View/*.cc View/*.h
@clang-format -n *.cc
Loading

0 comments on commit 89a252b

Please sign in to comment.