# novato-intlgnt/imagesteganography architecture

> Architecture diagram of the GitHub repository novato-intlgnt/imagesteganography, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/novato-intlgnt/imagesteganography
- Repository: https://github.com/novato-intlgnt/imagesteganography

## Overview

##### Project Type and Purpose
- This is a standalone desktop application with a GUI front-end (Qt), built in C++ using an MVC pattern.
- Purpose: Securely embed (and extract) image data into audio files by combining Cellular Automata encryption, Discrete Wavelet Transform (DWT), and Least Significant Bit (LSB) embedding.

##### File Structure
- Top-level:
- CMakeLists.txt – build configuration
- README.md – documentation
- src/ – all source code

- src/ hierarchy:
- view/ – Qt GUI (mainwindow.ui, mainwindow.{cpp,h})
- controller/ – stegoController.{cpp,h} (orchestrates user actions)
- model/ – core algorithms:
– audioProcessor.*
– waveletTransform.*
– cellularAutomaton.*
– LSBHandler.*
– permutationGenerator.*, dataProcessor.* (auxiliary)
- utils/ – fileHandler.* (disk I/O, format handling)
- assets/ – .qrc resource file, images

##### Extract Insights from the README
- Architecture: MVC
- Core Modules:
- Wavelet Transform Module (Wavelib)
- Cellular Automaton Module
- LSB Handler Module
- External Dependencies: Qt, FFmpeg, OpenCV, Eigen, Wavelib

a. Main Components
- View (Qt GUI)
- Controller (StegoController)
- Model Modules:
- Wavelet Transform
- Cellular Automaton
- LSB Handler
- Audio Processor
- Data/Permutation Generators
- Utility Layer (FileHandler, FFmpeg wrapper)
- External Services/Libraries (Qt, FFmpeg, OpenCV, Wavelib)

b. Relationships & Data Flow
- User interacts with View → events sent to Controller
- Controller invokes Model modules in sequence:
1. FileHandler loads audio/image
2. Cellular Automaton encrypts image data
3. Wavelet Transform decomposes audio
4. LSB Handler embeds encrypted bits into wavelet coefficients
5. AudioProcessor reconstructs audio signal
6. FileHandler writes output file
- Reverse flow for extraction: Controller → Model (LSB → CA decrypt)

c. Architectural Patterns & Principles
- MVC separation: clean boundaries between UI, orchestration, and core logic
- Modular design: each algorithm in its own module for testability and reuse
- Layered architecture: Presentation → Application → Domain → Infrastructure

d. Key Technologies/Frameworks
- Qt (View)
- C++20 / STL / Multithreading (Model performance)
- Wavelib (Wavelet operations)
- FFmpeg (audio extraction/injection)
- OpenCV (image handling)
- Eigen (linear algebra, if used)

## Diagram (Mermaid)

```mermaid
graph TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        MWUI["mainwindow.ui"]:::view
        MWCPP["mainwindow.cpp"]:::view
        MWH["mainwindow.h"]:::view
    end

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        StegoCPP["stegoController.cpp"]:::controller
        StegoH["stegoController.h"]:::controller
    end

    %% Domain Layer
    subgraph "Domain Layer"
        direction TB
        CAcpp["cellularAutomaton.cpp"]:::model
        CAh["cellularAutomaton.h"]:::model
        WTcpp["waveletTransform.cpp"]:::model
        WTh["waveletTransform.h"]:::model
        LSBcpp["LSBHandler.cpp"]:::model
        LSBh["LSBHandler.h"]:::model
        APcpp["audioProcessor.cpp"]:::model
        APh["audioProcessor.h"]:::model
        DPcpp["dataProcessor.cpp"]:::model
        DPh["dataProcessor.h"]:::model
        PGcpp["permutationGenerator.cpp"]:::model
        PGh["permutationGenerator.h"]:::model
        ICcpp["imageCompressor.cpp"]:::model
        ICh["imageCompressor.h"]:::model
    end

    %% Infrastructure Layer
    subgraph "Infrastructure Layer"
        direction TB
        FHcpp["fileHandler.cpp"]:::infra
        FHh["fileHandler.h"]:::infra
        AssetsQRC["assets.qrc"]:::infra
        Images["images/"]:::infra
        QtLib["Qt"]:::external
        FFmpegLib["FFmpeg"]:::external
        OpenCVLib["OpenCV"]:::external
        WavelibLib["Wavelib"]:::external
        EigenLib["Eigen"]:::external
    end

    %% Data Flow
    MWCPP -->|"user action"| StegoCPP
    StegoH --> StegoCPP
    StegoCPP -->|"load audio/image"| FHcpp
    FHcpp --> StegoCPP
    StegoCPP -->|"encrypt image"| CAcpp
    CAcpp -->|"decompose audio"| WTcpp
    WTcpp -->|"embed bits"| LSBcpp
    LSBcpp -->|"reconstruct audio"| APcpp
    APcpp -->|"write output"| FHcpp

    %% External Dependencies
    QtLib --> MWUI
    QtLib --> MWCPP
    QtLib --> MWH
    FFmpegLib --> FHcpp
    FFmpegLib --> FHh
    OpenCVLib --> ICcpp
    OpenCVLib --> ICh
    WavelibLib --> WTcpp
    WavelibLib --> WTh
    EigenLib --> WTcpp
    EigenLib --> WTh

    %% Click Events
    click MWUI "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/view/mainwindow.ui"
    click MWCPP "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/view/mainwindow.cpp"
    click MWH "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/view/mainwindow.h"
    click StegoCPP "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/controller/stegoController.cpp"
    click StegoH "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/controller/stegoController.h"
    click WTcpp "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/waveletTransform.cpp"
    click WTh "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/waveletTransform.h"
    click CAcpp "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/cellularAutomaton.cpp"
    click CAh "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/cellularAutomaton.h"
    click LSBcpp "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/LSBHandler.cpp"
    click LSBh "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/LSBHandler.h"
    click APcpp "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/audioProcessor.cpp"
    click APh "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/audioProcessor.h"
    click DPcpp "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/dataProcessor.cpp"
    click DPh "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/dataProcessor.h"
    click PGcpp "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/permutationGenerator.cpp"
    click PGh "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/permutationGenerator.h"
    click ICcpp "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/imageCompressor.cpp"
    click ICh "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/model/imageCompressor.h"
    click FHcpp "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/utils/fileHandler.cpp"
    click FHh "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/utils/fileHandler.h"
    click AssetsQRC "https://github.com/novato-intlgnt/imagesteganography/blob/main/src/assets/assets.qrc"
    click Images "https://github.com/novato-intlgnt/imagesteganography/tree/main/src/assets/images/"

    %% Styles
    classDef view fill:#e0f7e9,stroke:#2e7d32,stroke-width:1px
    classDef controller fill:#e3f2fd,stroke:#1565c0,stroke-width:1px
    classDef model fill:#fff3e0,stroke:#ef6c00,stroke-width:1px
    classDef infra fill:#eceff1,stroke:#546e7a,stroke-width:1px
    classDef external fill:#f5f5f5,stroke:#9e9e9e,stroke-width:1px
```
