SCContentFilterBuilder

Struct SCContentFilterBuilder 

Source
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

Source

pub fn with_display(self, display: &SCDisplay) -> Self

Set the display to capture

Source

pub fn with_window(self, window: &SCWindow) -> Self

Set the window to capture

Source

pub fn with_excluding_windows(self, windows: &[&SCWindow]) -> Self

Exclude specific windows from the display capture

Source

pub fn with_including_windows(self, windows: &[&SCWindow]) -> Self

Include only specific windows in the display capture

Source

pub fn with_including_applications( self, applications: &[&SCRunningApplication], excepting_windows: &[&SCWindow], ) -> Self

Include specific applications and optionally except certain windows

Source

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.

Source

pub fn with_content_rect(self, rect: CGRect) -> Self

Set the content rectangle (macOS 14.2+)

Source

pub fn display(self, display: &SCDisplay) -> Self

👎Deprecated since 1.5.0: Use with_display() instead

Set the display to capture

Source

pub fn window(self, window: &SCWindow) -> Self

👎Deprecated since 1.5.0: Use with_window() instead

Set the window to capture

Source

pub fn exclude_windows(self, windows: &[&SCWindow]) -> Self

👎Deprecated since 1.5.0: Use with_excluding_windows() instead

Exclude specific windows from the display capture

Source

pub fn include_windows(self, windows: &[&SCWindow]) -> Self

👎Deprecated since 1.5.0: Use with_including_windows() instead

Include only specific windows in the display capture

Source

pub fn include_applications( self, applications: &[&SCRunningApplication], excepting_windows: &[&SCWindow], ) -> Self

👎Deprecated since 1.5.0: Use with_including_applications() instead

Include specific applications and optionally except certain windows

Source

pub fn exclude_applications( self, applications: &[&SCRunningApplication], excepting_windows: &[&SCWindow], ) -> Self

👎Deprecated since 1.5.0: Use with_excluding_applications() instead

Exclude specific applications and optionally except certain windows

Source

pub fn content_rect(self, rect: CGRect) -> Self

👎Deprecated since 1.5.0: Use with_content_rect() instead

Set the content rectangle (macOS 14.2+)

Source

pub fn build(self) -> SCContentFilter

Build the content filter

§Panics

Panics if no filter type was set. Call .display() or .window() before .build().

Trait Implementations§

Source§

impl Debug for SCContentFilterBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.