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::builder()
    .display(display)
    .exclude_windows(&[])
    .build();

// Capture with specific windows excluded
let window = &content.windows()[0];
let filter = SCContentFilter::builder()
    .display(display)
    .exclude_windows(&[window])
    .build();

// Capture specific window
let filter = SCContentFilter::builder()
    .window(window)
    .build();

Implementations§

Source§

impl SCContentFilterBuilder

Source

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

Set the display to capture

Source

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

Set the window to capture

Source

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

Exclude specific windows from the display capture

Source

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

Include only specific windows in the display capture

Source

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

Include specific applications and optionally except certain windows

Source

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

Set the content rectangle (macOS 14.2+)

Source

pub fn build(self) -> SCContentFilter

Build the content filter

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.