Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Manipulation Application Screenshot

Image Manipulation Application

Overview

This project demonstrates the development of an image manipulation application aimed at showcasing advanced design patterns and robust software architecture. The application allows users to display an image in three different panels, each with distinct functionalities: one static and two interactive, enabling zoom, translation, rotation, and undo/redo operations.

Objectives

The primary goals of the project include:

  1. Displaying an image in three distinct panels using local files and allowing their saving in new formats.
  2. Independent manipulation of the images via mouse listeners.
  3. Integration of design patterns to enhance code readability and maintenance, specifically Command, Observer, Singleton, and Memento patterns.

Key Features

  • Three Panel Display: An image is shown in three panels, with one panel being static and the other two allowing zoom, translation, and rotation adjustments.
  • Independent Manipulation: Users can independently manipulate the images in the interactive panels, including zooming, translating, rotating, and resetting to the original state.
  • Image Filters: Apply filters such as black and glitch effects to the images.
  • Design Patterns Implementation: The project integrates several design patterns:
    • Observer: For the MVC architecture, ensuring views update automatically when models change.
    • Memento: For capturing and restoring the state of the images, enabling undo/redo functionality.
    • Singleton: Ensuring a single instance of the Caretaker class, which manages the state history.
    • Command: Encapsulating requests as objects, allowing parameterization of clients with queues, requests, and operations.

Class Responsibilities and Dependencies

Classes and Their Responsibilities

  • IPerspective: Manages image states using Memento pattern, handles zoom, position, and rotation.
  • Perspective: Implements IPerspective, notifies observers, and uses Memento for state management.
  • Controller: Manages user interactions and communicates with the model and view, handles undo/redo via Memento.
  • Serialization: Manages object serialization for saving and loading states.
  • Caretaker: Manages Memento objects for undo and redo operations, implemented as a Singleton.
  • Commands: Encapsulate actions like zoom, translation, rotation, apply filter, undo, and redo, following the Command pattern.

Design Pattern Usage

Observer Pattern

  • Subject: Perspective, OtherPerspective
  • Observer: Views such as PerspectivePanel and OtherPerspectivePanel
  • This pattern decouples the model from the views, enhancing modularity and ease of maintenance.

Memento Pattern

  • Originator: IPerspective implementations (Perspective, OtherPerspective)
  • Memento: Captures the state of an image (imageIcon, position, zoomFactor, rotation)
  • Caretaker: Manages Memento instances, provides undo and redo functionalities.

Singleton Pattern

  • Caretaker: Ensures a single instance for managing state histories, crucial for consistent undo/redo operations.

Command Pattern

  • Defines executable actions such as ZoomInCommand, ZoomOutCommand, RotateCommand, ApplyBlackFilterCommand, ApplyGlitchCommand, Translate, Undo, Redo.
  • Facilitates adding new commands without altering existing code.

Installation

To run the application, follow these steps:

  1. Clone the repository:
  2. git clone https://github.com/username/repository.git
  3. Navigate to the project directory:
  4. cd repository
  5. Build the project using your preferred IDE or build tool.

Usage

  1. Launch the application.
  2. Load an image using the file menu.
  3. Use the mouse to zoom in/out, translate, and rotate the image in the interactive panels.
  4. Apply filters using the filter menu options.
  5. Use undo/redo commands to revert or reapply changes.

Widget and Shortcuts

A widget is available to display all the shortcuts and features of the application. To access the widget:

  1. Open the widget "Help" from the toolbar
  2. The widget will display all available shortcuts and commands, including:
    • Zoom In: Scroll Wheel Up
    • Zoom Out: Scroll Wheel Down
    • Translate: Drag and Drop
    • Rotate: Ctrl + R
    • Apply Black Filter: Ctrl + N
    • Apply Glitch Filter: Ctrl + G
    • Undo: Ctrl + Z
    • Redo: Ctrl + Y

Conclusion

This project successfully demonstrates the application of design patterns in a practical software engineering context. The use of Observer, Memento, Singleton, and Command patterns ensures a modular, maintainable, and extensible architecture. Future improvements could include performance optimizations and additional image processing features.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages