pub enum CaptureArea {
Output {
output_index: u32,
},
Region(CaptureRect),
}dxgi-capture and (crate features dxgi-capture or wasapi-capture) only.Expand description
Which portion of the desktop DxgiCaptureSource::open duplicates —
see DxgiCaptureOptions::area.
Variants§
Output
The output_index’th output’s entire desktop — a flat index
across every adapter’s every output, in enumeration order
(adapter 0’s outputs, then adapter 1’s, …) — “monitor 0”,
“monitor 1”, regardless of which GPU each is attached to. 0 is
whatever Windows considers the first output of the first adapter,
not necessarily the primary monitor.
The simple case: exactly one IDXGIOutputDuplication, no
cropping, no compositing.
Region(CaptureRect)
An arbitrary rectangle in absolute virtual-desktop coordinates —
for callers that only know “this screen area” (e.g. a
user-dragged region-selection UI), not which monitor index owns
it. May overlap more than one output: open resolves every
output the rectangle intersects and opens one
IDXGIOutputDuplication per contributing output, then stitches
each output’s contribution into one composite
rect.width x rect.height image every capture tick —
CopySubresourceRegion under CaptureMode::Gpu, a plain
per-row memory copy under CaptureMode::Cpu — placing each
piece at its correct offset, no scaling or blending.
Every intersected output must share the same adapter. Desktop
Duplication resources can’t be copied directly across
ID3D11Devices from different adapters without a CPU round trip
— open checks every intersected output’s adapter before
opening any duplication, so a rejected region never partially
opens anything, and fails outright
(DxgiCaptureSourceError::RegionSpansMultipleAdapters) rather
than silently falling back to a CPU bridge for the mismatched
output — same “hard, loud failure, never a silent auto-copy”
reasoning as D3d12Renderer’s own device-mismatch guard.
include_cursor (see CaptureMode::Cpu) is only valid when the
region resolves to a single output —
DxgiCaptureSourceError::CursorUnsupportedForRegion otherwise.
The cursor can legitimately straddle a monitor boundary inside a
stitched composite; handling that correctly isn’t done, simplest
to reject rather than silently draw it wrong.
Trait Implementations§
Source§impl Clone for CaptureArea
impl Clone for CaptureArea
Source§fn clone(&self) -> CaptureArea
fn clone(&self) -> CaptureArea
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more