pub struct SCContentFilterBuilder { /* private fields */ }Expand description
Builder for creating SCContentFilter instances
§Examples
use screencapturekit::prelude::*;
let content = SCShareableContent::get()?;
let display = &content.displays()[0];
// Capture entire display
let filter = SCContentFilter::create()
.with_display(display)
.with_excluding_windows(&[])
.build();
// Capture with specific windows excluded
let window = &content.windows()[0];
let filter = SCContentFilter::create()
.with_display(display)
.with_excluding_windows(&[window])
.build();
// Capture specific window
let filter = SCContentFilter::create()
.with_window(window)
.build();Implementations§
Source§impl SCContentFilterBuilder
impl SCContentFilterBuilder
Sourcepub fn with_display(self, display: &SCDisplay) -> Self
pub fn with_display(self, display: &SCDisplay) -> Self
Set the display to capture
Sourcepub fn with_window(self, window: &SCWindow) -> Self
pub fn with_window(self, window: &SCWindow) -> Self
Set the window to capture
Sourcepub fn with_excluding_windows(self, windows: &[&SCWindow]) -> Self
pub fn with_excluding_windows(self, windows: &[&SCWindow]) -> Self
Exclude specific windows from the display capture
Sourcepub fn with_including_windows(self, windows: &[&SCWindow]) -> Self
pub fn with_including_windows(self, windows: &[&SCWindow]) -> Self
Include only specific windows in the display capture
Sourcepub fn with_including_applications(
self,
applications: &[&SCRunningApplication],
excepting_windows: &[&SCWindow],
) -> Self
pub fn with_including_applications( self, applications: &[&SCRunningApplication], excepting_windows: &[&SCWindow], ) -> Self
Include specific applications and optionally except certain windows
Sourcepub fn with_excluding_applications(
self,
applications: &[&SCRunningApplication],
excepting_windows: &[&SCWindow],
) -> Self
pub fn with_excluding_applications( self, applications: &[&SCRunningApplication], excepting_windows: &[&SCWindow], ) -> Self
Exclude specific applications and optionally except certain windows
Captures everything on the display except the specified applications.
Windows in excepting_windows will still be captured even if their
owning application is excluded.
Sourcepub fn with_content_rect(self, rect: CGRect) -> Self
pub fn with_content_rect(self, rect: CGRect) -> Self
Set the content rectangle (macOS 14.2+)
Sourcepub fn display(self, display: &SCDisplay) -> Self
👎Deprecated since 1.5.0: Use with_display() instead
pub fn display(self, display: &SCDisplay) -> Self
Set the display to capture
Sourcepub fn window(self, window: &SCWindow) -> Self
👎Deprecated since 1.5.0: Use with_window() instead
pub fn window(self, window: &SCWindow) -> Self
Set the window to capture
Sourcepub fn exclude_windows(self, windows: &[&SCWindow]) -> Self
👎Deprecated since 1.5.0: Use with_excluding_windows() instead
pub fn exclude_windows(self, windows: &[&SCWindow]) -> Self
Exclude specific windows from the display capture
Sourcepub fn include_windows(self, windows: &[&SCWindow]) -> Self
👎Deprecated since 1.5.0: Use with_including_windows() instead
pub fn include_windows(self, windows: &[&SCWindow]) -> Self
Include only specific windows in the display capture
Sourcepub fn include_applications(
self,
applications: &[&SCRunningApplication],
excepting_windows: &[&SCWindow],
) -> Self
👎Deprecated since 1.5.0: Use with_including_applications() instead
pub fn include_applications( self, applications: &[&SCRunningApplication], excepting_windows: &[&SCWindow], ) -> Self
Include specific applications and optionally except certain windows
Sourcepub fn exclude_applications(
self,
applications: &[&SCRunningApplication],
excepting_windows: &[&SCWindow],
) -> Self
👎Deprecated since 1.5.0: Use with_excluding_applications() instead
pub fn exclude_applications( self, applications: &[&SCRunningApplication], excepting_windows: &[&SCWindow], ) -> Self
Exclude specific applications and optionally except certain windows
Sourcepub fn content_rect(self, rect: CGRect) -> Self
👎Deprecated since 1.5.0: Use with_content_rect() instead
pub fn content_rect(self, rect: CGRect) -> Self
Set the content rectangle (macOS 14.2+)
Sourcepub fn build(self) -> SCContentFilter
pub fn build(self) -> SCContentFilter
Build the content filter
§Panics
Panics if no filter type was set. Call .display() or .window() before .build().