# fire-eggs/yaiv architecture

> Architecture diagram of the GitHub repository fire-eggs/yaiv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fire-eggs/yaiv
- Repository: https://github.com/fire-eggs/yaiv

## Overview

##### Main Components Identification

a. Core Application Layer
- Main Application (src/main.cpp)
- Window Management (src/yaiv_win.cpp)
- Image Display Components
- Toolbar System (src/toolbar/*)

b. Image Processing Layer
- Multiple Image Format Handlers
- Animation Support
- Image Scaling/Rotation

c. External Dependencies
- FLTK 1.4 Framework
- LibWebP
- OpenMP
- External Libraries Integration

**[User Interface Layer]**

- [Window Management]
- Title Bar
- Toolbar
- Image Display Area

**[Image Processing Layer]**

- [Format Handlers]
- JPEG Handler
- PNG Handler
- GIF Handler
- WebP Handler
- SVG Handler
- BMP Handler

- [Image Operations]
- Scaling
- Rotation
- Animation
- Pan/Zoom

**[External Dependencies]**

- FLTK 1.4
- LibWebP
- OpenMP
- Other Libraries

##### Important Elements to Highlight

a. Input Methods:
- File System Integration
- Drag-and-Drop Support
- Command Line Interface
- Toolbar Interface

b. Image Processing Features:
- Multiple Format Support
- Animation Handling
- Image Transformation
- Metadata Handling (via exiv2)

c. User Interface Features:
- Toolbar Components
- Window Management
- Event Handling
- Keyboard Controls

##### Data Flow Indicators

- Image loading path from source to display
- User input handling flow
- Image processing pipeline
- Inter-component communication

##### Implementation Details

- Mediator pattern (src/mediator.cpp)
- File scanning system (src/fileScanThread.cpp)
- Image format handlers (various *image.hpp files)
- Custom UI components (src/Fl_* files)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        WM["Window Management"]
        TB["Toolbar System"]
        IDA["Image Display Area"]
        SS["Slideshow"]
        MRP["Recent Files"]
    end

    subgraph IP["Image Processing Layer"]
        direction TB
        subgraph FH["Format Handlers"]
            direction TB
            GIF["GIF Handler"]
            WEBP["WebP Handler"]
            APNG["APNG Handler"]
            JPEG["JPEG Handler"]
            PNG["PNG Handler"]
            SVG["SVG Handler"]
        end

        subgraph IO["Image Operations"]
            direction TB
            SCALE["Scaling"]
            ROT["Rotation"]
            ANIM["Animation Support"]
            PZ["Pan/Zoom"]
        end

        META["Metadata Handler"]
        FM["File Management"]
    end

    subgraph EXT["External Dependencies"]
        FLTK["FLTK 1.4"]
        WEBPLIB["LibWebP"]
        OMP["OpenMP"]
        EXIV["Exiv2"]
    end

    MAIN["Main Application"] --> WM
    WM --> TB
    WM --> IDA
    WM --> SS
    WM --> MRP

    FM --> FH
    FH --> IO
    IO --> IDA
    META --> IDA

    FLTK --> WM
    WEBPLIB --> WEBP
    EXIV --> META

    classDef ui fill:#a8d1f0
    classDef processing fill:#90EE90
    classDef external fill:#FFB366
    classDef main fill:#FFB6C1

    class WM,TB,IDA,SS,MRP ui
    class FH,IO,META,FM processing
    class FLTK,WEBPLIB,OMP,EXIV external
    class MAIN main

    click MAIN "https://github.com/fire-eggs/YAIV/blob/main/src/main.cpp"
    click WM "https://github.com/fire-eggs/YAIV/blob/main/src/yaiv_win.cpp"
    click TB "https://github.com/fire-eggs/YAIV/tree/main/src/toolbar/"
    click GIF "https://github.com/fire-eggs/YAIV/blob/main/src/Fl_AGIF_Image.cpp"
    click WEBP "https://github.com/fire-eggs/YAIV/blob/main/src/Webp.cpp"
    click APNG "https://github.com/fire-eggs/YAIV/blob/main/src/apng.cpp"
    click META "https://github.com/fire-eggs/YAIV/blob/main/src/metadata.cpp"
    click FM "https://github.com/fire-eggs/YAIV/blob/main/src/fileScanThread.cpp"
    click SS "https://github.com/fire-eggs/YAIV/blob/main/src/Slideshow.cpp"
    click MRP "https://github.com/fire-eggs/YAIV/blob/main/src/MostRecentPaths.cpp"
    click IDA "https://github.com/fire-eggs/YAIV/blob/main/src/Fl_TransBox.cpp"
    click EXIV "https://github.com/fire-eggs/YAIV/tree/main/exiv2/include/exiv2/"
```
