# pundarikakshntripathi/lumasort-engine architecture

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

- Interactive diagram: https://gitdiagram.com/pundarikakshntripathi/lumasort-engine
- Repository: https://github.com/pundarikakshntripathi/lumasort-engine

## Overview

LumaSort is a desktop visualizer that turns webcam frames, loaded images, or canvas drawings into particles that converge on a target image. The user selects an input and target, previews content, then starts or stops the transformation; GUI controls also tune particle and flow parameters. App coordinates capture, canvas input, sorting, simulation, and rendering. The README documents webcam input and adaptive resolution, but the sampled excerpts do not show their implementation details, so those internal links are omitted. The graph includes the documented capabilities while limiting implementation links to supported calls.

Main entry points: [`src/app.cpp`](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/app.cpp) (App Coordinator), [`src/ui/gui_layer.cpp`](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/ui/gui_layer.cpp) (Controls and Dialogs), [`src/graphics/renderer.cpp`](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/graphics/renderer.cpp) (Particle Renderer), [`src/main.cpp`](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/main.cpp) (Application Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User Interaction"]
  node_main["Application Entry<br/>[main.cpp]"]
  node_app["App Coordinator<br/>[app.cpp]"]
  node_gui["Controls and Dialogs<br/>[gui_layer.cpp]"]
  node_nfd["Native File Dialog"]
end

subgraph group_inputs["Image Inputs"]
  node_source["Webcam or Image"]
  node_webcam["Webcam"]
  node_canvas["Drawing Canvas<br/>[canvas.cpp]"]
  node_target["Target Image"]
end

subgraph group_simulation["Particle Simulation"]
  node_sorter["Luminance Sorter<br/>[sorter.cpp]"]
  node_particles["Particle State<br/>[particle.h]"]
  node_flow["Noise Flow Field<br/>[flow_field.cpp]"]
end

subgraph group_visualization["Graphics and Display"]
  node_renderer["Particle Renderer<br/>[renderer.cpp]"]
  node_shaders["Particle Shaders<br/>[particle.vert]"]
  node_texture["GPU Texture<br/>[texture.cpp]"]
  node_display["Window Display"]
end

node_user(("User"))

node_user -->|"launches"| node_main
node_main -->|"creates"| node_app
node_app -->|"coordinates"| node_gui
node_user -->|"operates"| node_gui
node_gui -.->|"opens picker"| node_nfd
node_gui -->|"controls"| node_app
node_app -->|"loads image"| node_source
node_webcam -.->|"provides frames"| node_app
node_app -->|"draws and reads"| node_canvas
node_canvas -->|"returns image"| node_app
node_app -->|"loads target"| node_target
node_app -->|"uploads preview"| node_texture
node_gui -->|"shows preview"| node_texture
node_app -->|"calculates mapping"| node_sorter
node_sorter -->|"returns mapping"| node_app
node_app -->|"updates state"| node_particles
node_app -->|"gets force"| node_flow
node_app -->|"renders particles"| node_renderer
node_renderer -->|"loads shaders"| node_shaders
node_renderer -->|"draws frame"| node_display
node_gui -->|"draws controls"| node_display

click node_main "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/main.cpp"
click node_app "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/app.cpp"
click node_gui "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/ui/gui_layer.cpp"
click node_canvas "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/graphics/canvas.cpp"
click node_sorter "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/core/sorter.cpp"
click node_particles "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/core/particle.h"
click node_flow "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/core/flow_field.cpp"
click node_renderer "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/graphics/renderer.cpp"
click node_shaders "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/assets/shaders/particle.vert"
click node_texture "https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/graphics/texture.cpp"

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_main,node_app,node_gui,node_nfd,node_user toneBlue
class node_source,node_webcam,node_canvas,node_target toneAmber
class node_sorter,node_particles,node_flow toneMint
class node_renderer,node_shaders,node_texture,node_display toneRose
```

## Components

### User Interaction

- [Application Entry](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/main.cpp): `src/main.cpp`
- [App Coordinator](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/app.cpp): `src/app.cpp`
- [Controls and Dialogs](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/ui/gui_layer.cpp): `src/ui/gui_layer.cpp`
- **Native File Dialog**

### Image Inputs

- **Webcam or Image**
- **Webcam**
- [Drawing Canvas](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/graphics/canvas.cpp): `src/graphics/canvas.cpp`
- **Target Image**

### Particle Simulation

- [Luminance Sorter](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/core/sorter.cpp): `src/core/sorter.cpp`
- [Particle State](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/core/particle.h): `src/core/particle.h`
- [Noise Flow Field](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/core/flow_field.cpp): `src/core/flow_field.cpp`

### Graphics and Display

- [Particle Renderer](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/graphics/renderer.cpp): `src/graphics/renderer.cpp`
- [Particle Shaders](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/assets/shaders/particle.vert): `assets/shaders/particle.vert`
- [GPU Texture](https://github.com/pundarikakshntripathi/lumasort-engine/blob/main/src/graphics/texture.cpp): `src/graphics/texture.cpp`
- **Window Display**

### Other components

- **User**

## Connections

- User → Application Entry: launches
- Application Entry → App Coordinator: creates
- App Coordinator → Controls and Dialogs: coordinates
- User → Controls and Dialogs: operates
- Controls and Dialogs → Native File Dialog: opens picker
- Controls and Dialogs → App Coordinator: controls
- App Coordinator → Webcam or Image: loads image
- Webcam → App Coordinator: provides frames
- App Coordinator → Drawing Canvas: draws and reads
- Drawing Canvas → App Coordinator: returns image
- App Coordinator → Target Image: loads target
- App Coordinator → GPU Texture: uploads preview
- Controls and Dialogs → GPU Texture: shows preview
- App Coordinator → Luminance Sorter: calculates mapping
- Luminance Sorter → App Coordinator: returns mapping
- App Coordinator → Particle State: updates state
- App Coordinator → Noise Flow Field: gets force
- App Coordinator → Particle Renderer: renders particles
- Particle Renderer → Particle Shaders: loads shaders
- Particle Renderer → Window Display: draws frame
- Controls and Dialogs → Window Display: draws controls
