# netflate/luminecapture architecture

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

- Interactive diagram: https://gitdiagram.com/netflate/luminecapture
- Repository: https://github.com/netflate/luminecapture

## Overview

LumineCapture is a native Wayland screenshot tool. The main user workflow launches a capture, opens it in an editor for selection and annotation, then saves, copies, pins, or otherwise outputs the result. The graph also preserves documented OCR, color-picking, and Wayland capture capabilities. Internal links are limited to relationships shown by the README or SOURCE INDEX; several implementation details, especially capture dispatch and output actions, were not sampled.

Main entry points: [`src/app.rs`](https://github.com/netflate/luminecapture/blob/main/src/app.rs) (Application workflow), [`src/app/input.rs`](https://github.com/netflate/luminecapture/blob/main/src/app/input.rs) (Editor input), [`src/backend.rs`](https://github.com/netflate/luminecapture/blob/main/src/backend.rs) (Platform backend), [`src/app/actions.rs`](https://github.com/netflate/luminecapture/blob/main/src/app/actions.rs) (Save and copy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and output"]
  node_app["Application workflow<br/>[app.rs]"]
  node_wayland["Wayland capture"]
  node_backend["Platform backend<br/>[backend.rs]"]
  node_outputs["Save and copy<br/>[actions.rs]"]
  node_pin["Screen pinning<br/>[pin.rs]"]
end

subgraph group_editor["Editing and annotations"]
  node_editor["Screenshot editor<br/>[editor.rs]"]
  node_input["Editor input<br/>[input.rs]"]
  node_tools["Annotation tools<br/>[tools.rs]"]
  node_annotations["Annotation model<br/>[annotations.rs]"]
  node_renderer["Canvas renderer<br/>[renderer.rs]"]
  node_color["Color picker<br/>[color.rs]"]
end

subgraph group_ocr["OCR"]
  node_ocr_tool["OCR tool<br/>[ocr.rs]"]
  node_ocr["OCR engine<br/>[ocr.rs]"]
  node_models["OCR models<br/>[models.rs]"]
  node_ocr_backend["Recognition backend<br/>[paddle_backend.rs]"]
  node_ocr_daemon["OCR daemon<br/>[daemon.rs]"]
end

subgraph group_shared["Shared services"]
  node_config["Configuration<br/>[config.rs]"]
  node_notifications["Notifications<br/>[notify.rs]"]
  node_clipboard["Wayland clipboard<br/>[clipboard.rs]"]
end

node_user(("User"))
node_wayland_service(("Wayland compositor"))

node_user -->|"launches"| node_app
node_app -->|"requests capture"| node_backend
node_backend -->|"dispatches capture"| node_wayland
node_wayland -.->|"captures from"| node_wayland_service
node_app -->|"opens editor"| node_editor
node_input -->|"updates state"| node_editor
node_input -->|"dispatches input"| node_tools
node_tools -->|"creates annotations"| node_annotations
node_editor -->|"renders frame"| node_renderer
node_renderer -->|"draws annotations"| node_annotations
node_app -.->|"handles results"| node_outputs
node_outputs -.->|"copies image"| node_clipboard
node_outputs -.->|"pins image"| node_pin
node_app -->|"reports outcomes"| node_notifications
node_input -->|"handles panel input"| node_color
node_tools -->|"dispatches OCR"| node_ocr_tool
node_ocr_tool -->|"requests recognition"| node_ocr
node_ocr -->|"builds backend"| node_ocr_backend
node_ocr -->|"uses model files"| node_models
node_models -.->|"supports daemon mode"| node_ocr_daemon
node_app -->|"reads settings"| node_config
node_backend -->|"reads settings"| node_config

click node_app "https://github.com/netflate/luminecapture/blob/main/src/app.rs"
click node_wayland "https://github.com/netflate/luminecapture/tree/main/src/backend/wayland/capture"
click node_backend "https://github.com/netflate/luminecapture/blob/main/src/backend.rs"
click node_outputs "https://github.com/netflate/luminecapture/blob/main/src/app/actions.rs"
click node_pin "https://github.com/netflate/luminecapture/blob/main/src/backend/wayland/pin.rs"
click node_editor "https://github.com/netflate/luminecapture/blob/main/src/editor.rs"
click node_input "https://github.com/netflate/luminecapture/blob/main/src/app/input.rs"
click node_tools "https://github.com/netflate/luminecapture/blob/main/src/tools.rs"
click node_annotations "https://github.com/netflate/luminecapture/blob/main/src/types/annotations.rs"
click node_renderer "https://github.com/netflate/luminecapture/blob/main/src/renderer.rs"
click node_color "https://github.com/netflate/luminecapture/blob/main/src/app/panels/color.rs"
click node_ocr_tool "https://github.com/netflate/luminecapture/blob/main/src/tools/ocr.rs"
click node_ocr "https://github.com/netflate/luminecapture/blob/main/src/ocr.rs"
click node_models "https://github.com/netflate/luminecapture/blob/main/src/ocr/models.rs"
click node_ocr_backend "https://github.com/netflate/luminecapture/blob/main/src/ocr/paddle_backend.rs"
click node_ocr_daemon "https://github.com/netflate/luminecapture/blob/main/src/ocr/daemon.rs"
click node_config "https://github.com/netflate/luminecapture/blob/main/src/config.rs"
click node_notifications "https://github.com/netflate/luminecapture/blob/main/src/backend/notify.rs"
click node_clipboard "https://github.com/netflate/luminecapture/blob/main/src/backend/wayland/clipboard.rs"

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_app,node_wayland,node_backend,node_outputs,node_pin,node_user toneBlue
class node_editor,node_input,node_tools,node_annotations,node_renderer,node_color toneAmber
class node_ocr_tool,node_ocr,node_models,node_ocr_backend,node_ocr_daemon toneMint
class node_config,node_notifications,node_clipboard toneRose
class node_wayland_service toneIndigo
```

## Components

### Capture and output

- [Application workflow](https://github.com/netflate/luminecapture/blob/main/src/app.rs): `src/app.rs`
- [Wayland capture](https://github.com/netflate/luminecapture/tree/main/src/backend/wayland/capture): `src/backend/wayland/capture`
- [Platform backend](https://github.com/netflate/luminecapture/blob/main/src/backend.rs): `src/backend.rs`
- [Save and copy](https://github.com/netflate/luminecapture/blob/main/src/app/actions.rs): `src/app/actions.rs`
- [Screen pinning](https://github.com/netflate/luminecapture/blob/main/src/backend/wayland/pin.rs): `src/backend/wayland/pin.rs`

### Editing and annotations

- [Screenshot editor](https://github.com/netflate/luminecapture/blob/main/src/editor.rs): `src/editor.rs`
- [Editor input](https://github.com/netflate/luminecapture/blob/main/src/app/input.rs): `src/app/input.rs`
- [Annotation tools](https://github.com/netflate/luminecapture/blob/main/src/tools.rs): `src/tools.rs`
- [Annotation model](https://github.com/netflate/luminecapture/blob/main/src/types/annotations.rs): `src/types/annotations.rs`
- [Canvas renderer](https://github.com/netflate/luminecapture/blob/main/src/renderer.rs): `src/renderer.rs`
- [Color picker](https://github.com/netflate/luminecapture/blob/main/src/app/panels/color.rs): `src/app/panels/color.rs`

### OCR

- [OCR tool](https://github.com/netflate/luminecapture/blob/main/src/tools/ocr.rs): `src/tools/ocr.rs`
- [OCR engine](https://github.com/netflate/luminecapture/blob/main/src/ocr.rs): `src/ocr.rs`
- [OCR models](https://github.com/netflate/luminecapture/blob/main/src/ocr/models.rs): `src/ocr/models.rs`
- [Recognition backend](https://github.com/netflate/luminecapture/blob/main/src/ocr/paddle_backend.rs): `src/ocr/paddle_backend.rs`
- [OCR daemon](https://github.com/netflate/luminecapture/blob/main/src/ocr/daemon.rs): `src/ocr/daemon.rs`

### Shared services

- [Configuration](https://github.com/netflate/luminecapture/blob/main/src/config.rs): `src/config.rs`
- [Notifications](https://github.com/netflate/luminecapture/blob/main/src/backend/notify.rs): `src/backend/notify.rs`
- [Wayland clipboard](https://github.com/netflate/luminecapture/blob/main/src/backend/wayland/clipboard.rs): `src/backend/wayland/clipboard.rs`

### Other components

- **User**
- **Wayland compositor**

## Connections

- User → Application workflow: launches
- Application workflow → Platform backend: requests capture (evidence: `src/app.rs`)
- Platform backend → Wayland capture: dispatches capture (evidence: `src/backend.rs`)
- Wayland capture → Wayland compositor: captures from
- Application workflow → Screenshot editor: opens editor (evidence: `src/app.rs`)
- Editor input → Screenshot editor: updates state (evidence: `src/app/input.rs`)
- Editor input → Annotation tools: dispatches input (evidence: `src/app/input.rs`)
- Annotation tools → Annotation model: creates annotations (evidence: `src/tools.rs`)
- Screenshot editor → Canvas renderer: renders frame (evidence: `src/editor.rs`)
- Canvas renderer → Annotation model: draws annotations (evidence: `src/renderer.rs`)
- Application workflow → Save and copy: handles results (evidence: `src/app.rs`)
- Save and copy → Wayland clipboard: copies image
- Save and copy → Screen pinning: pins image
- Application workflow → Notifications: reports outcomes (evidence: `src/app.rs`)
- Editor input → Color picker: handles panel input (evidence: `src/app/input.rs`)
- Annotation tools → OCR tool: dispatches OCR (evidence: `src/tools.rs`)
- OCR tool → OCR engine: requests recognition (evidence: `src/tools/ocr.rs`)
- OCR engine → Recognition backend: builds backend (evidence: `src/ocr.rs`)
- OCR engine → OCR models: uses model files (evidence: `src/ocr.rs`)
- OCR models → OCR daemon: supports daemon mode
- Application workflow → Configuration: reads settings (evidence: `src/app.rs`)
- Platform backend → Configuration: reads settings (evidence: `src/backend.rs`)
