# linuxdeepin/image-editor architecture

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

- Interactive diagram: https://gitdiagram.com/linuxdeepin/image-editor
- Repository: https://github.com/linuxdeepin/image-editor

## Overview

##### Project type and purpose
- This is a C++/Qt-based public library (“image-editor”) providing image-viewing and editing capabilities for Deepin’s image viewer and album applications. It exposes core functionality (libimageviewer) and visual filter/processing functionality (libimagevisualresult), plus integration of third-party TIFF tools.

##### File structure
- Top-level build & CI:
- CMakeLists.txt, imageeditor.pro: build orchestrators
- .github/workflows & .obs/workflows.yml: CI/CD pipelines
- Packaging: debian/ (Debian packaging metadata & rules)
- Third-party code: 3rdparty/tiff-tools
- Core modules:
- libimageviewer/ — Qt GUI & service layers for viewing, slideshow, plugins (OCR, AI-enhance, MTP, ffmpeg thumbnailer)
- libimagevisualresult/ — LUT-based filter engine, CLI interface
- Tests: tests/ — unit tests with GoogleTest and resource fixtures

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build & CI/CD Layer
    subgraph "Build & CI/CD" 
        CI1["CMakeLists.txt"]:::buildci
        CI2["imageeditor.pro"]:::buildci
        CI3["GitHub Actions (.github/workflows)"]:::buildci
        CI4["OBS Workflows (.obs/workflows.yml)"]:::buildci
    end

    %% Packaging
    Packaging["debian/"]:::packaging

    %% Third-party Tools
    TIFF["3rdparty/tiff-tools/"]:::external

    %% Core Libraries
    subgraph "Core Libraries"
        subgraph "libimageviewer" 
            IV_CFG["CMake & Pro & PC configs"]:::core
            IV_ASSETS["assets/"]:::plugin
            IV_SERVICE["service/"]:::plugin
            IV_SLIDESHOW["slideshow/"]:::plugin
            IV_UNION["unionimage/"]:::plugin
            IV_VIEW["viewpanel/"]:::plugin
            IV_WIDGETS["widgets/"]:::plugin
            IV_TRANSLATIONS["translations/"]:::plugin
        end
        subgraph "libimagevisualresult"
            VR_CFG["CMake & PC configs"]:::core
            VR_FILTER["filter_cube/"]:::plugin
            VR_SRC["src/"]:::plugin
        end
    end

    %% Test Harness
    Tests["tests/"]:::tests

    %% External Dependencies
    subgraph "External Dependencies"
        QT["Qt5/Qt6"]:::external
        FFMP["FFmpeg"]:::external
        EXIF["libexif"]:::external
        SQLI["SQLite"]:::external
        LIBR["libraw"]:::external
        LIBT["libtiff"]:::external
    end

    %% Relationships
    CI1 -->|configures| IV_CFG
    CI2 -->|configures| IV_CFG
    CI1 -->|configures| VR_CFG
    CI2 -->|configures| VR_CFG
    CI3 -->|triggers build/test| CI1
    CI4 -->|triggers build/test| CI1
    CI1 -->|builds| IV_CFG
    CI1 -->|builds| VR_CFG

    IV_CFG -->|provides GUI & API| IV_SERVICE
    IV_CFG -->|bundles| IV_ASSETS
    IV_CFG -->|includes| IV_SLIDESHOW
    IV_CFG -->|includes| IV_UNION
    IV_CFG -->|includes| IV_VIEW
    IV_CFG -->|includes| IV_WIDGETS
    IV_CFG -->|includes| IV_TRANSLATIONS

    VR_CFG -->|provides filter engine| VR_FILTER
    VR_CFG -->|includes| VR_SRC

    IV_CFG -->|uses LUT| VR_CFG

    IV_UNION -->|invokes| TIFF

    IV_CFG <-->|links against| QT
    IV_CFG <-->|uses| FFMP
    IV_CFG <-->|uses| EXIF
    IV_CFG <-->|uses| SQLI
    IV_CFG <-->|uses| LIBR
    IV_CFG <-->|uses| LIBT

    VR_CFG <-->|links against| QT
    VR_CFG <-->|uses| LIBT

    CI1 -->|runs| Tests
    Tests -->|verifies| IV_CFG
    Tests -->|verifies| VR_CFG

    CI1 -->|packages| Packaging
    IV_CFG -->|outputs| Packaging
    VR_CFG -->|outputs| Packaging

    %% Click Events
    click CI1 "https://github.com/linuxdeepin/image-editor/blob/master/CMakeLists.txt"
    click CI2 "https://github.com/linuxdeepin/image-editor/blob/master/imageeditor.pro"
    click CI3 "https://github.com/linuxdeepin/image-editor/tree/master/.github/workflows/"
    click CI4 "https://github.com/linuxdeepin/image-editor/blob/master/.obs/workflows.yml"
    click Packaging "https://github.com/linuxdeepin/image-editor/tree/master/debian/"
    click TIFF "https://github.com/linuxdeepin/image-editor/tree/master/3rdparty/tiff-tools/"
    click IV_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimageviewer/CMakeLists.txt"
    click IV_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimageviewer/libimageviewer.pro"
    click IV_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimageviewer/libimageviewer-qt5.cmake"
    click IV_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimageviewer/libimageviewer-qt6.cmake"
    click IV_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimageviewer/libimageviewer.cmake"
    click IV_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimageviewer/libimageviewer.pc.in"
    click IV_ASSETS "https://github.com/linuxdeepin/image-editor/tree/master/libimageviewer/assets/"
    click IV_SERVICE "https://github.com/linuxdeepin/image-editor/tree/master/libimageviewer/service/"
    click IV_SLIDESHOW "https://github.com/linuxdeepin/image-editor/tree/master/libimageviewer/slideshow/"
    click IV_UNION "https://github.com/linuxdeepin/image-editor/tree/master/libimageviewer/unionimage/"
    click IV_VIEW "https://github.com/linuxdeepin/image-editor/tree/master/libimageviewer/viewpanel/"
    click IV_WIDGETS "https://github.com/linuxdeepin/image-editor/tree/master/libimageviewer/widgets/"
    click IV_TRANSLATIONS "https://github.com/linuxdeepin/image-editor/tree/master/libimageviewer/translations/"
    click VR_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimagevisualresult/CMakeLists.txt"
    click VR_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimagevisualresult/libimagevisualresult-qt5.cmake"
    click VR_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimagevisualresult/libimagevisualresult-qt6.cmake"
    click VR_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimagevisualresult/libimagevisualresult.cmake"
    click VR_CFG "https://github.com/linuxdeepin/image-editor/blob/master/libimagevisualresult/libimagevisualresult.pc.in"
    click VR_FILTER "https://github.com/linuxdeepin/image-editor/tree/master/libimagevisualresult/filter_cube/"
    click VR_SRC "https://github.com/linuxdeepin/image-editor/tree/master/libimagevisualresult/src/"
    click Tests "https://github.com/linuxdeepin/image-editor/tree/master/tests/"

    %% Styles
    classDef buildci fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef plugin fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#FFA500,stroke:#333,stroke-width:1px
    classDef tests fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef packaging fill:#D3D3D3,stroke:#333,stroke-width:1px
```
