SCScreenshotConfiguration

Struct SCScreenshotConfiguration 

Source
pub struct SCScreenshotConfiguration { /* private fields */ }
Expand description

Configuration for advanced screenshot capture (macOS 26.0+)

Provides fine-grained control over screenshot output including:

  • Output dimensions
  • Source and destination rectangles
  • Shadow and clipping behavior
  • HDR/SDR dynamic range
  • File output

§Examples

use screencapturekit::screenshot_manager::{SCScreenshotConfiguration, SCScreenshotDynamicRange};

let config = SCScreenshotConfiguration::new()
    .with_width(1920)
    .with_height(1080)
    .with_shows_cursor(true)
    .with_dynamic_range(SCScreenshotDynamicRange::BothSDRAndHDR);

Implementations§

Source§

impl SCScreenshotConfiguration

Source

pub fn new() -> Self

Create a new screenshot configuration

§Panics

Panics if the configuration cannot be created (requires macOS 26.0+)

Source

pub fn with_width(self, width: usize) -> Self

Set the output width in pixels

Source

pub fn with_height(self, height: usize) -> Self

Set the output height in pixels

Source

pub fn with_shows_cursor(self, shows_cursor: bool) -> Self

Set whether to show the cursor

Source

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

Set the source rectangle (subset of capture area)

Source

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

Set the destination rectangle (output area)

Source

pub fn with_ignore_shadows(self, ignore_shadows: bool) -> Self

Set whether to ignore shadows

Source

pub fn with_ignore_clipping(self, ignore_clipping: bool) -> Self

Set whether to ignore clipping

Source

pub fn with_include_child_windows(self, include_child_windows: bool) -> Self

Set whether to include child windows

Source

pub fn with_display_intent( self, display_intent: SCScreenshotDisplayIntent, ) -> Self

Set the display intent

Source

pub fn with_dynamic_range(self, dynamic_range: SCScreenshotDynamicRange) -> Self

Set the dynamic range

Source

pub fn with_file_path(self, path: &str) -> Self

Set the output file URL

§Panics

Panics if the path contains null bytes

Source

pub fn with_content_type(self, identifier: &str) -> Self

Set the content type (output format) using UTType identifier

Common identifiers include:

  • "public.png" - PNG format
  • "public.jpeg" - JPEG format
  • "public.heic" - HEIC format
  • "public.tiff" - TIFF format

Use supported_content_types() to get available formats.

§Panics

Panics if the identifier contains null bytes

Source

pub fn content_type(&self) -> Option<String>

Get the current content type as UTType identifier

Source

pub fn supported_content_types() -> Vec<String>

Get the list of supported content types (UTType identifiers)

Returns a list of UTType identifiers that can be used with with_content_type().

Common types include:

  • "public.png" - PNG format
  • "public.jpeg" - JPEG format
  • "public.heic" - HEIC format
Source

pub const fn as_ptr(&self) -> *const c_void

Trait Implementations§

Source§

impl Debug for SCScreenshotConfiguration

Available on crate feature macos_26_0 only.
Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for SCScreenshotConfiguration

Available on crate feature macos_26_0 only.
Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for SCScreenshotConfiguration

Available on crate feature macos_26_0 only.
Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for SCScreenshotConfiguration

Available on crate feature macos_26_0 only.
Source§

impl Sync for SCScreenshotConfiguration

Available on crate feature macos_26_0 only.

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.