# aragajaga/paniview architecture

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

- Interactive diagram: https://gitdiagram.com/aragajaga/paniview
- Repository: https://github.com/aragajaga/paniview

## Overview

PaniView is a lightweight Windows image viewer. Its main workflow is opening an image (including a shell-supplied path), decoding and converting it with Windows Imaging Component (WIC), then displaying it through a Direct2D-backed window. The UI also exposes navigation, zoom/fit, file operations, and settings. The sampled source shows the application and rendering code concentrated in paniview.c; the README is brief, so detailed wiring for unsampled features is not assumed.

Main entry points: [`paniview.c`](https://github.com/aragajaga/paniview/blob/slave/paniview.c) (Viewer commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Window interface"]
  node_frame["Main frame<br/>[paniview.c]"]
  node_commands["Viewer commands<br/>[paniview.c]"]
  node_dialogs["Settings and dialogs<br/>[paniview.c]"]
  node_fileops["File operations<br/>[paniview.c]"]
end

subgraph group_images["Image display"]
  node_open["Open and identify<br/>[paniview.c]"]
  node_decode["WIC decode<br/>[paniview.c]"]
  node_convert["Pixel conversion<br/>[paniview.c]"]
  node_renderer["Image renderer<br/>[paniview.c]"]
  node_navigation["Image navigation<br/>[paniview.c]"]
end

subgraph group_state["Application state"]
  node_settings["Settings management<br/>[paniview.c]"]
end

node_user(("Viewer user"))
node_imagefile["Image file"]
node_wic["Windows Imaging Component"]
node_d2d["Direct2D"]
node_display["Displayed image"]
node_settingsfile[("Settings file")]
node_filesystem["Windows filesystem"]

node_user -->|"uses"| node_frame
node_frame -->|"dispatches"| node_commands
node_frame -->|"opens"| node_dialogs
node_commands -->|"opens image"| node_open
node_open -->|"reads"| node_imagefile
node_open -->|"checks file"| node_filesystem
node_open -->|"selects decoder"| node_decode
node_decode -->|"decodes"| node_wic
node_decode -->|"provides bitmap"| node_convert
node_convert -->|"converts pixels"| node_wic
node_convert -->|"provides bitmap"| node_renderer
node_renderer -->|"draws with"| node_d2d
node_renderer -->|"renders"| node_display
node_commands -->|"navigates"| node_navigation
node_commands -->|"controls view"| node_renderer
node_commands -->|"invokes"| node_fileops
node_dialogs -->|"edits"| node_settings
node_settings -->|"reads and writes"| node_settingsfile
node_settings -->|"locates data"| node_filesystem

click node_frame "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_commands "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_dialogs "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_open "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_decode "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_convert "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_renderer "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_navigation "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_fileops "https://github.com/aragajaga/paniview/blob/slave/paniview.c"
click node_settings "https://github.com/aragajaga/paniview/blob/slave/paniview.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frame,node_commands,node_dialogs,node_fileops,node_user toneBlue
class node_open,node_decode,node_convert,node_renderer,node_navigation,node_settingsfile toneAmber
class node_settings toneMint
class node_imagefile,node_wic,node_d2d,node_display,node_filesystem toneIndigo
```

## Components

### Window interface

- [Main frame](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`
- [Viewer commands](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`
- [Settings and dialogs](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`
- [File operations](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`

### Image display

- [Open and identify](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`
- [WIC decode](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`
- [Pixel conversion](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`
- [Image renderer](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`
- [Image navigation](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`

### Application state

- [Settings management](https://github.com/aragajaga/paniview/blob/slave/paniview.c): `paniview.c`

### Other components

- **Viewer user**
- **Image file**
- **Windows Imaging Component**
- **Direct2D**
- **Displayed image**
- **Settings file**
- **Windows filesystem**

## Connections

- Viewer user → Main frame: uses
- Main frame → Viewer commands: dispatches
- Main frame → Settings and dialogs: opens
- Viewer commands → Open and identify: opens image
- Open and identify → Image file: reads
- Open and identify → Windows filesystem: checks file
- Open and identify → WIC decode: selects decoder
- WIC decode → Windows Imaging Component: decodes
- WIC decode → Pixel conversion: provides bitmap
- Pixel conversion → Windows Imaging Component: converts pixels
- Pixel conversion → Image renderer: provides bitmap
- Image renderer → Direct2D: draws with
- Image renderer → Displayed image: renders
- Viewer commands → Image navigation: navigates
- Viewer commands → Image renderer: controls view
- Viewer commands → File operations: invokes
- Settings and dialogs → Settings management: edits
- Settings management → Settings file: reads and writes
- Settings management → Windows filesystem: locates data
