# mindstudioofficial/scopes_plusplus architecture

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

- Interactive diagram: https://gitdiagram.com/mindstudioofficial/scopes_plusplus
- Repository: https://github.com/mindstudioofficial/scopes_plusplus

## Overview

Scopes++ is a native realtime video-analysis application: users choose a live NDI source and configure color space/range and scope visibility, then inspect a preview, false-color view, waveforms, and scopes. The documented GPU pipeline converts source frames and produces analysis images using OpenCL with OpenGL texture interop; ImGui presents those results. The sampled excerpts establish the application UI and renderer behavior, while source-provider and device-provider internals were not sampled, so uncertain call wiring is omitted.

Main entry points: [`src/app/src/app.cpp`](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp) (Application UI), [`src/app/src/cl_renderer.cpp`](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/cl_renderer.cpp) (OpenCL renderer), [`src/app/src/cl_renderer.hpp`](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/cl_renderer.hpp) (Analysis textures), [`src/app/kernels/common.cl`](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/common.cl) (Kernel utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and UI"]
  node_application["Application UI<br/>[app.cpp]"]
end

subgraph group_sources["Video sources"]
  node_ndi_provider["NDI source provider"]
  node_ndi_source["NDI source<br/>[ndi_source.cpp]"]
  node_video_source["Video source interface<br/>[video_source.hpp]"]
end

subgraph group_gpu["GPU processing"]
  node_device_provider["OpenCL device provider"]
  node_renderer["OpenCL renderer<br/>[cl_renderer.cpp]"]
  node_interop["GL/CL texture interop<br/>[cl_gl_utils.cpp]"]
  node_convert_kernel["Frame conversion<br/>[01_convert.cl]"]
  node_accumulate_kernel["Scope accumulation<br/>[02_accumulate.cl]"]
  node_images_kernel["Analysis image creation"]
  node_postfx_kernel["False-color processing<br/>[04_post_fx.cl]"]
  node_color_kernels["Color-space kernels<br/>[colorspaces.cl]"]
  node_common_kernel["Kernel utilities<br/>[common.cl]"]
end

subgraph group_views["Analysis views"]
  node_target_textures["Analysis textures<br/>[cl_renderer.hpp]"]
  node_preview["Source preview<br/>[app.cpp]"]
  node_false_color["False-color viewer<br/>[app.cpp]"]
  node_waveforms["Waveform views<br/>[app.cpp]"]
  node_scopes["Scope views<br/>[app.cpp]"]
end

node_operator(("Video professional"))
node_ndi_service(("NDI stream"))

node_operator -->|"configures and views"| node_application
node_application -->|"lists NDI sources"| node_ndi_provider
node_ndi_provider -->|"discovers streams"| node_ndi_service
node_ndi_source -->|"receives stream"| node_ndi_service
node_application -->|"owns provider"| node_device_provider
node_device_provider -->|"provides kernels"| node_renderer
node_renderer -->|"dispatches conversion"| node_convert_kernel
node_renderer -->|"dispatches accumulation"| node_accumulate_kernel
node_renderer -->|"dispatches image creation"| node_images_kernel
node_renderer -->|"dispatches false color"| node_postfx_kernel
node_convert_kernel -->|"uses color transforms"| node_color_kernels
node_convert_kernel -->|"uses utilities"| node_common_kernel
node_accumulate_kernel -->|"uses utilities"| node_common_kernel
node_images_kernel -->|"uses utilities"| node_common_kernel
node_postfx_kernel -->|"uses utilities"| node_common_kernel
node_renderer -->|"creates shared textures"| node_interop
node_renderer -->|"produces images"| node_target_textures
node_application -->|"renders preview"| node_preview
node_application -->|"renders false color"| node_false_color
node_application -->|"renders waveforms"| node_waveforms
node_application -->|"renders scopes"| node_scopes
node_target_textures -->|"supplies texture"| node_preview
node_target_textures -->|"supplies texture"| node_false_color
node_target_textures -->|"supplies textures"| node_waveforms
node_target_textures -->|"supplies textures"| node_scopes

click node_application "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp"
click node_ndi_provider "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/ndi_source_provider.cpp"
click node_ndi_source "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/ndi_source.cpp"
click node_video_source "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/video_source.hpp"
click node_device_provider "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/cl_device_provider.cpp"
click node_renderer "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/cl_renderer.cpp"
click node_interop "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/util/cl_gl_utils.cpp"
click node_convert_kernel "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/01_convert.cl"
click node_accumulate_kernel "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/02_accumulate.cl"
click node_images_kernel "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/03_create_images.cl"
click node_postfx_kernel "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/04_post_fx.cl"
click node_color_kernels "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/colorspaces.cl"
click node_common_kernel "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/common.cl"
click node_target_textures "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/cl_renderer.hpp"
click node_preview "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp"
click node_false_color "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp"
click node_waveforms "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp"
click node_scopes "https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.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_application toneBlue
class node_ndi_provider,node_ndi_source,node_video_source toneAmber
class node_device_provider,node_renderer,node_interop,node_convert_kernel,node_accumulate_kernel,node_images_kernel,node_postfx_kernel,node_color_kernels,node_common_kernel toneMint
class node_target_textures,node_preview,node_false_color,node_waveforms,node_scopes toneRose
class node_operator,node_ndi_service toneIndigo
```

## Components

### Application and UI

- [Application UI](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp): `src/app/src/app.cpp`

### Video sources

- [NDI source provider](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/ndi_source_provider.cpp): `src/app/src/ndi_source_provider.cpp`
- [NDI source](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/ndi_source.cpp): `src/app/src/ndi_source.cpp`
- [Video source interface](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/video_source.hpp): `src/app/src/video_source.hpp`

### GPU processing

- [OpenCL device provider](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/cl_device_provider.cpp): `src/app/src/cl_device_provider.cpp`
- [OpenCL renderer](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/cl_renderer.cpp): `src/app/src/cl_renderer.cpp`
- [GL/CL texture interop](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/util/cl_gl_utils.cpp): `src/app/src/util/cl_gl_utils.cpp`
- [Frame conversion](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/01_convert.cl): `src/app/kernels/01_convert.cl`
- [Scope accumulation](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/02_accumulate.cl): `src/app/kernels/02_accumulate.cl`
- [Analysis image creation](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/03_create_images.cl): `src/app/kernels/03_create_images.cl`
- [False-color processing](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/04_post_fx.cl): `src/app/kernels/04_post_fx.cl`
- [Color-space kernels](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/colorspaces.cl): `src/app/kernels/colorspaces.cl`
- [Kernel utilities](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/kernels/common.cl): `src/app/kernels/common.cl`

### Analysis views

- [Analysis textures](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/cl_renderer.hpp): `src/app/src/cl_renderer.hpp`
- [Source preview](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp): `src/app/src/app.cpp`
- [False-color viewer](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp): `src/app/src/app.cpp`
- [Waveform views](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp): `src/app/src/app.cpp`
- [Scope views](https://github.com/mindstudioofficial/scopes_plusplus/blob/main/src/app/src/app.cpp): `src/app/src/app.cpp`

### Other components

- **Video professional**
- **NDI stream**

## Connections

- Video professional → Application UI: configures and views
- Application UI → NDI source provider: lists NDI sources
- NDI source provider → NDI stream: discovers streams
- NDI source → NDI stream: receives stream
- Application UI → OpenCL device provider: owns provider
- OpenCL device provider → OpenCL renderer: provides kernels
- OpenCL renderer → Frame conversion: dispatches conversion
- OpenCL renderer → Scope accumulation: dispatches accumulation
- OpenCL renderer → Analysis image creation: dispatches image creation
- OpenCL renderer → False-color processing: dispatches false color
- Frame conversion → Color-space kernels: uses color transforms
- Frame conversion → Kernel utilities: uses utilities
- Scope accumulation → Kernel utilities: uses utilities
- Analysis image creation → Kernel utilities: uses utilities
- False-color processing → Kernel utilities: uses utilities
- OpenCL renderer → GL/CL texture interop: creates shared textures
- OpenCL renderer → Analysis textures: produces images
- Application UI → Source preview: renders preview
- Application UI → False-color viewer: renders false color
- Application UI → Waveform views: renders waveforms
- Application UI → Scope views: renders scopes
- Analysis textures → Source preview: supplies texture
- Analysis textures → False-color viewer: supplies texture
- Analysis textures → Waveform views: supplies textures
- Analysis textures → Scope views: supplies textures
