# sceace/mac-screenshot architecture

> Architecture diagram of the GitHub repository sceace/mac-screenshot, 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/sceace/mac-screenshot
- Repository: https://github.com/sceace/mac-screenshot

## Overview

Mark Shot is a Qt desktop screenshot, annotation, and capture utility. Its main workflow is to capture a screen or selected region, open an interactive annotation overlay, then save, copy, upload, or pin the resulting image. Separate workflows provide scrolling capture, screen recording, code scanning, and OCR-backed pinned-image translation. Provider plugins supply optional OCR, barcode scanning, and translation implementations. The README documents these capabilities; sampled source confirms selected recording, configuration, pinned-window, and shortcut details, but does not establish every runtime connection.

Main entry points: [`src/shot_window.cpp`](https://github.com/sceace/mac-screenshot/blob/main/src/shot_window.cpp) (Annotation Overlay), [`src/screen_capture.cpp`](https://github.com/sceace/mac-screenshot/blob/main/src/screen_capture.cpp) (Capture API), [`src/providers/provider_plugin_registry.cpp`](https://github.com/sceace/mac-screenshot/blob/main/src/providers/provider_plugin_registry.cpp) (Plugin Registry), [`src/export_image_effect.cpp`](https://github.com/sceace/mac-screenshot/blob/main/src/export_image_effect.cpp) (Image Export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Screen Capture"]
  node_capture_api["Capture API<br/>[screen_capture.cpp]"]
  node_platform_capture["Platform Capture"]
end

subgraph group_image["Image Workflow"]
  node_overlay["Annotation Overlay<br/>[shot_window.cpp]"]
  node_export["Image Export"]
  node_clipboard["Clipboard Image"]
  node_pin["Pinned Image"]
end

subgraph group_extended["Capture Modes"]
  node_scroll["Scroll Capture"]
  node_stitcher["Image Stitcher<br/>[stitcher.cpp]"]
  node_recording["Recording Sessions"]
  node_record_controller["Recording Controller"]
  node_record_writer["Recording Writers"]
  node_recordings[("Recording Files")]
end

subgraph group_providers["Provider Services"]
  node_code_scan["Code Scanning"]
  node_ocr["OCR Providers"]
  node_translation["Translation Providers"]
  node_plugin_registry["Plugin Registry"]
  node_marketplace["Plugin Marketplace"]
end

subgraph group_app["App Services"]
  node_settings["Settings UI"]
  node_config_store[("App Configuration")]
  node_shortcuts["Global Shortcuts"]
end

node_user(("User"))
node_desktop{{"Desktop Capture Services"}}
node_cloud_services{{"Translation APIs"}}
node_image_host{{"Image Host"}}

node_user -->|"requests capture"| node_capture_api
node_capture_api -->|"dispatches capture"| node_platform_capture
node_platform_capture -->|"captures frames"| node_desktop
node_capture_api -->|"opens overlay"| node_overlay
node_user -->|"selects and annotates"| node_overlay
node_overlay -->|"exports image"| node_export
node_export -->|"publishes image"| node_clipboard
node_overlay -->|"pins image"| node_pin
node_user -->|"starts scroll capture"| node_scroll
node_scroll -->|"requests frames"| node_capture_api
node_scroll -->|"combines frames"| node_stitcher
node_user -->|"starts recording"| node_recording
node_recording -->|"starts session"| node_record_controller
node_record_controller -->|"writes frames"| node_record_writer
node_record_controller -->|"selects output path"| node_recordings
node_record_writer -->|"saves recording"| node_recordings
node_overlay -->|"requests scan"| node_code_scan
node_pin -->|"recognizes text"| node_ocr
node_pin -->|"requests translation"| node_translation
node_translation -.->|"sends translation request"| node_cloud_services
node_plugin_registry -->|"provides plugins"| node_ocr
node_plugin_registry -->|"provides plugins"| node_translation
node_plugin_registry -->|"provides plugins"| node_code_scan
node_marketplace -->|"installs plugins"| node_plugin_registry
node_settings -->|"updates configuration"| node_config_store
node_shortcuts -->|"triggers capture"| node_capture_api
node_export -.->|"uploads image"| node_image_host

click node_capture_api "https://github.com/sceace/mac-screenshot/blob/main/src/screen_capture.cpp"
click node_platform_capture "https://github.com/sceace/mac-screenshot/blob/main/src/screen_capture_platform_api.cpp"
click node_overlay "https://github.com/sceace/mac-screenshot/blob/main/src/shot_window.cpp"
click node_export "https://github.com/sceace/mac-screenshot/blob/main/src/export_image_effect.cpp"
click node_clipboard "https://github.com/sceace/mac-screenshot/blob/main/src/clipboard_image.cpp"
click node_pin "https://github.com/sceace/mac-screenshot/blob/main/src/pinned_window/pinned_image_window.cpp"
click node_scroll "https://github.com/sceace/mac-screenshot/blob/main/src/scroll/scroll_session_window.cpp"
click node_stitcher "https://github.com/sceace/mac-screenshot/blob/main/src/scroll/stitcher.cpp"
click node_recording "https://github.com/sceace/mac-screenshot/blob/main/src/recording/recording_session_manager.cpp"
click node_record_controller "https://github.com/sceace/mac-screenshot/blob/main/src/recording/recording_controller.cpp"
click node_record_writer "https://github.com/sceace/mac-screenshot/blob/main/src/recording/video_recording_writer.cpp"
click node_code_scan "https://github.com/sceace/mac-screenshot/blob/main/src/providers/code_scan/code_scan_provider_factory.cpp"
click node_ocr "https://github.com/sceace/mac-screenshot/blob/main/src/providers/ocr/ocr_provider_factory.cpp"
click node_translation "https://github.com/sceace/mac-screenshot/blob/main/src/providers/translate/translate_provider_factory.cpp"
click node_plugin_registry "https://github.com/sceace/mac-screenshot/blob/main/src/providers/provider_plugin_registry.cpp"
click node_marketplace "https://github.com/sceace/mac-screenshot/blob/main/src/marketplace/plugin_marketplace_client.cpp"
click node_settings "https://github.com/sceace/mac-screenshot/blob/main/src/settings/settings_dialog.cpp"
click node_config_store "https://github.com/sceace/mac-screenshot/blob/main/src/app_config_store.cpp"
click node_shortcuts "https://github.com/sceace/mac-screenshot/blob/main/src/shortcuts/global_shortcut_manager.cpp"
click node_recordings "https://github.com/sceace/mac-screenshot/blob/main/src/recording/recording_storage_config.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_capture_api,node_platform_capture,node_user toneBlue
class node_overlay,node_export,node_clipboard,node_pin toneAmber
class node_scroll,node_stitcher,node_recording,node_record_controller,node_record_writer,node_recordings,node_cloud_services toneMint
class node_code_scan,node_ocr,node_translation,node_plugin_registry,node_marketplace toneRose
class node_settings,node_config_store,node_shortcuts,node_desktop,node_image_host toneIndigo
```

## Components

### Screen Capture

- [Capture API](https://github.com/sceace/mac-screenshot/blob/main/src/screen_capture.cpp): `src/screen_capture.cpp`
- [Platform Capture](https://github.com/sceace/mac-screenshot/blob/main/src/screen_capture_platform_api.cpp): `src/screen_capture_platform_api.cpp`

### Image Workflow

- [Annotation Overlay](https://github.com/sceace/mac-screenshot/blob/main/src/shot_window.cpp): `src/shot_window.cpp`
- [Image Export](https://github.com/sceace/mac-screenshot/blob/main/src/export_image_effect.cpp): `src/export_image_effect.cpp`
- [Clipboard Image](https://github.com/sceace/mac-screenshot/blob/main/src/clipboard_image.cpp): `src/clipboard_image.cpp`
- [Pinned Image](https://github.com/sceace/mac-screenshot/blob/main/src/pinned_window/pinned_image_window.cpp): `src/pinned_window/pinned_image_window.cpp`

### Capture Modes

- [Scroll Capture](https://github.com/sceace/mac-screenshot/blob/main/src/scroll/scroll_session_window.cpp): `src/scroll/scroll_session_window.cpp`
- [Image Stitcher](https://github.com/sceace/mac-screenshot/blob/main/src/scroll/stitcher.cpp): `src/scroll/stitcher.cpp`
- [Recording Sessions](https://github.com/sceace/mac-screenshot/blob/main/src/recording/recording_session_manager.cpp): `src/recording/recording_session_manager.cpp`
- [Recording Controller](https://github.com/sceace/mac-screenshot/blob/main/src/recording/recording_controller.cpp): `src/recording/recording_controller.cpp`
- [Recording Writers](https://github.com/sceace/mac-screenshot/blob/main/src/recording/video_recording_writer.cpp): `src/recording/video_recording_writer.cpp`
- [Recording Files](https://github.com/sceace/mac-screenshot/blob/main/src/recording/recording_storage_config.cpp): `src/recording/recording_storage_config.cpp`

### Provider Services

- [Code Scanning](https://github.com/sceace/mac-screenshot/blob/main/src/providers/code_scan/code_scan_provider_factory.cpp): `src/providers/code_scan/code_scan_provider_factory.cpp`
- [OCR Providers](https://github.com/sceace/mac-screenshot/blob/main/src/providers/ocr/ocr_provider_factory.cpp): `src/providers/ocr/ocr_provider_factory.cpp`
- [Translation Providers](https://github.com/sceace/mac-screenshot/blob/main/src/providers/translate/translate_provider_factory.cpp): `src/providers/translate/translate_provider_factory.cpp`
- [Plugin Registry](https://github.com/sceace/mac-screenshot/blob/main/src/providers/provider_plugin_registry.cpp): `src/providers/provider_plugin_registry.cpp`
- [Plugin Marketplace](https://github.com/sceace/mac-screenshot/blob/main/src/marketplace/plugin_marketplace_client.cpp): `src/marketplace/plugin_marketplace_client.cpp`

### App Services

- [Settings UI](https://github.com/sceace/mac-screenshot/blob/main/src/settings/settings_dialog.cpp): `src/settings/settings_dialog.cpp`
- [App Configuration](https://github.com/sceace/mac-screenshot/blob/main/src/app_config_store.cpp): `src/app_config_store.cpp`
- [Global Shortcuts](https://github.com/sceace/mac-screenshot/blob/main/src/shortcuts/global_shortcut_manager.cpp): `src/shortcuts/global_shortcut_manager.cpp`

### Other components

- **User**
- **Desktop Capture Services**
- **Translation APIs**
- **Image Host**

## Connections

- User → Capture API: requests capture
- Capture API → Platform Capture: dispatches capture
- Platform Capture → Desktop Capture Services: captures frames
- Capture API → Annotation Overlay: opens overlay
- User → Annotation Overlay: selects and annotates
- Annotation Overlay → Image Export: exports image
- Image Export → Clipboard Image: publishes image
- Annotation Overlay → Pinned Image: pins image
- User → Scroll Capture: starts scroll capture
- Scroll Capture → Capture API: requests frames
- Scroll Capture → Image Stitcher: combines frames
- User → Recording Sessions: starts recording
- Recording Sessions → Recording Controller: starts session
- Recording Controller → Recording Writers: writes frames
- Recording Controller → Recording Files: selects output path
- Recording Writers → Recording Files: saves recording
- Annotation Overlay → Code Scanning: requests scan
- Pinned Image → OCR Providers: recognizes text
- Pinned Image → Translation Providers: requests translation
- Translation Providers → Translation APIs: sends translation request
- Plugin Registry → OCR Providers: provides plugins
- Plugin Registry → Translation Providers: provides plugins
- Plugin Registry → Code Scanning: provides plugins
- Plugin Marketplace → Plugin Registry: installs plugins
- Settings UI → App Configuration: updates configuration
- Global Shortcuts → Capture API: triggers capture
- Image Export → Image Host: uploads image
