Skip to content

Support HDR Capture#660

Merged
TheJoeFin merged 7 commits into
devfrom
hdr-capture-wgc
Jul 7, 2026
Merged

Support HDR Capture#660
TheJoeFin merged 7 commits into
devfrom
hdr-capture-wgc

Conversation

@TheJoeFin

Copy link
Copy Markdown
Owner

PR Classification

New feature and bug fix to support accurate screen capture on HDR displays and resolve washed-out screenshot issues.

PR Summary

This PR adds HDR-aware screen capture and tone-mapping to correct brightness on HDR monitors, introduces user settings for HDR correction, and provides unit tests for the new logic.

  • Added DisplayHdrInfo, HdrScreenCapture, and HdrToneMapper classes in Text_Grab.Utilities.Hdr for HDR detection, capture, and tone-mapping.
  • Updated ImageMethods to use HDR capture and tone-mapping when enabled.
  • Enhanced GeneralSettings.xaml and GeneralSettings.xaml.cs with HDR correction toggles and borderless capture permission UI.
  • Registered new HDR-related settings in App.config, Settings.settings, and Settings.Designer.cs.
  • Added unit tests for tone-mapping in HdrToneMapperTests.cs.

Closes #111

TheJoeFin added 7 commits July 5, 2026 20:24
Added two new user-scoped Boolean settings: HdrCaptureCorrection and HdrBorderlessGranted, both defaulting to False. Updated App.config, Settings.settings, and Settings.Designer.cs to support these options as strongly-typed properties.
Introduce DisplayHdrInfo, HdrScreenCapture, and HdrToneMapper under Text_Grab.Utilities.Hdr. These components enable accurate detection of per-monitor HDR state, high-precision screen capture from HDR displays, and correct tone-mapping to SDR bitmaps. Addresses washed-out capture issues on HDR monitors by leveraging DXGI, Direct3D 11, and Windows.Graphics.Capture APIs.
Integrate HDR screen region capture with tone mapping fallback to GDI when needed. Add Vortice.Direct3D11/DXGI dependencies for HDR support. Refactor ImageMethods to centralize capture logic. Add HdrToneMapper unit tests to validate tone mapping behavior.
Added an "HDR Displays" section to GeneralSettings with a toggle for HDR capture correction and a button to check/grant borderless capture permissions. Updated code-behind to handle toggle state, update settings, and display permission status to the user. Added explanatory text for new options.
Added Bash(git log *) to settings.local.json to permit execution of git log commands via Bash, expanding the set of allowed command patterns.
Added Bash(gh pr view *) and Bash(gh pr diff *) to the allowlist in settings.local.json, enabling use of GitHub CLI commands for viewing and diffing pull requests.
Refactored HDR screen capture to use a process-wide shared D3D11 device, context, and WinRT device for efficiency and reliability. Reduced frame timeout to 250ms to avoid UI stalls. Added helpers for device lifecycle management and improved error handling to recover from device loss. Ensured proper resource cleanup and event unsubscription.
@TheJoeFin TheJoeFin merged commit da93dd6 into dev Jul 7, 2026
1 check passed
@TheJoeFin TheJoeFin deleted the hdr-capture-wgc branch July 7, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant