# saog0721/magpie architecture

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

- Interactive diagram: https://gitdiagram.com/saog0721/magpie
- Repository: https://github.com/saog0721/magpie

## Overview

Magpie Experimental is a Windows window-content processing application. The documented user workflow is to choose an effect group and target window, capture its content, process frames through configured effects, then present the result; the UI also supports live parameter editing, comparison, timing/FPS monitoring, screenshots, and frame pacing. The graph includes the documented processing stages and major experimental capabilities. Source excerpts show application startup and service wiring, but do not expose most renderer/backend call paths, so those relationships are documented README flows rather than claims about inspected calls.

Main entry points: [`src/Magpie.Core/Renderer.cpp`](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/Renderer.cpp) (Frame renderer), [`src/Magpie.Core/EffectDrawer.cpp`](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/EffectDrawer.cpp) (Effect processing), [`src/Magpie/App.cpp`](https://github.com/saog0721/magpie/blob/experimental/src/Magpie/App.cpp) (App lifecycle), [`src/Magpie/ScalingService.cpp`](https://github.com/saog0721/magpie/blob/experimental/src/Magpie/ScalingService.cpp) (Scaling session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and setup"]
  node_main["Application entry<br/>[main.cpp]"]
  node_appcore["App lifecycle<br/>[App.cpp]"]
  node_settings["Settings<br/>[AppSettings.h]"]
  node_modes["Effect groups"]
end

subgraph group_workflow["Capture and presentation"]
  node_scaling["Scaling session<br/>[ScalingService.cpp]"]
  node_window["Scaling window<br/>[ScalingWindow.cpp]"]
  node_capture["Window capture"]
  node_renderer["Frame renderer<br/>[Renderer.cpp]"]
  node_presenter["Output presentation<br/>[PresenterBase.cpp]"]
end

subgraph group_effects["Image processing"]
  node_effects["Effect processing<br/>[EffectDrawer.cpp]"]
  node_temporal["Temporal upscalers<br/>[DLSSSRUpscaler.cpp]"]
  node_framegen["Frame generation"]
  node_rtx["RTX Video"]
  node_hdr["HDR processing"]
end

subgraph group_controls["User controls and diagnostics"]
  node_parameters["Parameter editing"]
  node_toolbar["Comparison and metrics<br/>[OverlayDrawer.cpp]"]
  node_trace["Frame tracing<br/>[FrameTrace.cpp]"]
  node_pacing["Frame pacing<br/>[FramePacingWait.h]"]
end

subgraph group_platform["Platform integrations"]
  node_cache[("Effect cache")]
end

node_user(("User"))
node_gpu["GPU and drivers"]
node_source["Target window"]
node_display["Display"]

node_user -->|"launches"| node_main
node_main -->|"starts"| node_appcore
node_appcore -->|"initializes"| node_settings
node_user -->|"selects group"| node_modes
node_appcore -->|"initializes"| node_scaling
node_modes -.->|"configures"| node_scaling
node_scaling -->|"starts session"| node_window
node_source -->|"provides frames"| node_capture
node_window -->|"captures"| node_capture
node_capture -->|"supplies frames"| node_renderer
node_renderer -->|"processes frames"| node_effects
node_effects -->|"submits result"| node_presenter
node_presenter -->|"displays"| node_display
node_renderer -.->|"uses when selected"| node_temporal
node_renderer -.->|"uses when selected"| node_framegen
node_renderer -.->|"uses when selected"| node_rtx
node_renderer -.->|"processes HDR"| node_hdr
node_user -->|"edits parameters"| node_parameters
node_parameters -->|"adjusts controls"| node_effects
node_user -->|"compares output"| node_toolbar
node_renderer -->|"reports timings"| node_toolbar
node_renderer -.->|"records frame data"| node_trace
node_user -->|"sets frame pace"| node_pacing
node_pacing -->|"regulates submission"| node_renderer
node_gpu -->|"enables supported backends"| node_temporal
node_gpu -->|"enables supported backends"| node_framegen
node_gpu -->|"enables supported backend"| node_rtx
node_effects -.->|"caches effects"| node_cache

click node_main "https://github.com/saog0721/magpie/blob/experimental/src/Magpie/main.cpp"
click node_appcore "https://github.com/saog0721/magpie/blob/experimental/src/Magpie/App.cpp"
click node_settings "https://github.com/saog0721/magpie/blob/experimental/src/Magpie/AppSettings.h"
click node_modes "https://github.com/saog0721/magpie/blob/experimental/src/Magpie/ScalingModesService.cpp"
click node_scaling "https://github.com/saog0721/magpie/blob/experimental/src/Magpie/ScalingService.cpp"
click node_window "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/ScalingWindow.cpp"
click node_capture "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/FrameSourceBase.cpp"
click node_renderer "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/Renderer.cpp"
click node_presenter "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/PresenterBase.cpp"
click node_effects "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/EffectDrawer.cpp"
click node_temporal "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/DLSSSRUpscaler.cpp"
click node_framegen "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/DLSSFrameGenerator.cpp"
click node_rtx "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/RTXVideoDenoiser.cpp"
click node_hdr "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/HdrCaptureProcessor.cpp"
click node_parameters "https://github.com/saog0721/magpie/blob/experimental/src/Magpie/EffectParametersViewModel.cpp"
click node_toolbar "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/OverlayDrawer.cpp"
click node_trace "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/FrameTrace.cpp"
click node_pacing "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/FramePacingWait.h"
click node_cache "https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/EffectCacheManager.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_appcore,node_settings,node_modes,node_user toneBlue
class node_scaling,node_window,node_capture,node_renderer,node_presenter toneAmber
class node_effects,node_temporal,node_framegen,node_rtx,node_hdr toneMint
class node_parameters,node_toolbar,node_trace,node_pacing toneRose
class node_cache,node_gpu,node_source,node_display toneIndigo
```

## Components

### Application and setup

- [Application entry](https://github.com/saog0721/magpie/blob/experimental/src/Magpie/main.cpp): `src/Magpie/main.cpp`
- [App lifecycle](https://github.com/saog0721/magpie/blob/experimental/src/Magpie/App.cpp): `src/Magpie/App.cpp`
- [Settings](https://github.com/saog0721/magpie/blob/experimental/src/Magpie/AppSettings.h): `src/Magpie/AppSettings.h`
- [Effect groups](https://github.com/saog0721/magpie/blob/experimental/src/Magpie/ScalingModesService.cpp): `src/Magpie/ScalingModesService.cpp`

### Capture and presentation

- [Scaling session](https://github.com/saog0721/magpie/blob/experimental/src/Magpie/ScalingService.cpp): `src/Magpie/ScalingService.cpp`
- [Scaling window](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/ScalingWindow.cpp): `src/Magpie.Core/ScalingWindow.cpp`
- [Window capture](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/FrameSourceBase.cpp): `src/Magpie.Core/FrameSourceBase.cpp`
- [Frame renderer](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/Renderer.cpp): `src/Magpie.Core/Renderer.cpp`
- [Output presentation](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/PresenterBase.cpp): `src/Magpie.Core/PresenterBase.cpp`

### Image processing

- [Effect processing](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/EffectDrawer.cpp): `src/Magpie.Core/EffectDrawer.cpp`
- [Temporal upscalers](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/DLSSSRUpscaler.cpp): `src/Magpie.Core/DLSSSRUpscaler.cpp`
- [Frame generation](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/DLSSFrameGenerator.cpp): `src/Magpie.Core/DLSSFrameGenerator.cpp`
- [RTX Video](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/RTXVideoDenoiser.cpp): `src/Magpie.Core/RTXVideoDenoiser.cpp`
- [HDR processing](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/HdrCaptureProcessor.cpp): `src/Magpie.Core/HdrCaptureProcessor.cpp`

### User controls and diagnostics

- [Parameter editing](https://github.com/saog0721/magpie/blob/experimental/src/Magpie/EffectParametersViewModel.cpp): `src/Magpie/EffectParametersViewModel.cpp`
- [Comparison and metrics](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/OverlayDrawer.cpp): `src/Magpie.Core/OverlayDrawer.cpp`
- [Frame tracing](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/FrameTrace.cpp): `src/Magpie.Core/FrameTrace.cpp`
- [Frame pacing](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/FramePacingWait.h): `src/Magpie.Core/FramePacingWait.h`

### Platform integrations

- [Effect cache](https://github.com/saog0721/magpie/blob/experimental/src/Magpie.Core/EffectCacheManager.cpp): `src/Magpie.Core/EffectCacheManager.cpp`

### Other components

- **User**
- **GPU and drivers**
- **Target window**
- **Display**

## Connections

- User → Application entry: launches
- Application entry → App lifecycle: starts (evidence: `src/Magpie/main.cpp`)
- App lifecycle → Settings: initializes (evidence: `src/Magpie/App.cpp`)
- User → Effect groups: selects group
- App lifecycle → Scaling session: initializes (evidence: `src/Magpie/App.cpp`)
- Effect groups → Scaling session: configures
- Scaling session → Scaling window: starts session
- Target window → Window capture: provides frames
- Scaling window → Window capture: captures
- Window capture → Frame renderer: supplies frames
- Frame renderer → Effect processing: processes frames
- Effect processing → Output presentation: submits result
- Output presentation → Display: displays
- Frame renderer → Temporal upscalers: uses when selected
- Frame renderer → Frame generation: uses when selected
- Frame renderer → RTX Video: uses when selected
- Frame renderer → HDR processing: processes HDR
- User → Parameter editing: edits parameters
- Parameter editing → Effect processing: adjusts controls
- User → Comparison and metrics: compares output
- Frame renderer → Comparison and metrics: reports timings
- Frame renderer → Frame tracing: records frame data
- User → Frame pacing: sets frame pace
- Frame pacing → Frame renderer: regulates submission
- GPU and drivers → Temporal upscalers: enables supported backends
- GPU and drivers → Frame generation: enables supported backends
- GPU and drivers → RTX Video: enables supported backend
- Effect processing → Effect cache: caches effects
