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
impl SCScreenshotConfiguration
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new screenshot configuration
§Panics
Panics if the configuration cannot be created (requires macOS 26.0+)
Sourcepub fn with_width(self, width: usize) -> Self
pub fn with_width(self, width: usize) -> Self
Set the output width in pixels
Sourcepub fn with_height(self, height: usize) -> Self
pub fn with_height(self, height: usize) -> Self
Set the output height in pixels
Sourcepub fn with_shows_cursor(self, shows_cursor: bool) -> Self
pub fn with_shows_cursor(self, shows_cursor: bool) -> Self
Set whether to show the cursor
Sourcepub fn with_source_rect(self, rect: CGRect) -> Self
pub fn with_source_rect(self, rect: CGRect) -> Self
Set the source rectangle (subset of capture area)
Sourcepub fn with_destination_rect(self, rect: CGRect) -> Self
pub fn with_destination_rect(self, rect: CGRect) -> Self
Set the destination rectangle (output area)
Sourcepub fn with_ignore_shadows(self, ignore_shadows: bool) -> Self
pub fn with_ignore_shadows(self, ignore_shadows: bool) -> Self
Set whether to ignore shadows
Sourcepub fn with_ignore_clipping(self, ignore_clipping: bool) -> Self
pub fn with_ignore_clipping(self, ignore_clipping: bool) -> Self
Set whether to ignore clipping
Sourcepub fn with_include_child_windows(self, include_child_windows: bool) -> Self
pub fn with_include_child_windows(self, include_child_windows: bool) -> Self
Set whether to include child windows
Sourcepub fn with_display_intent(
self,
display_intent: SCScreenshotDisplayIntent,
) -> Self
pub fn with_display_intent( self, display_intent: SCScreenshotDisplayIntent, ) -> Self
Set the display intent
Sourcepub fn with_dynamic_range(self, dynamic_range: SCScreenshotDynamicRange) -> Self
pub fn with_dynamic_range(self, dynamic_range: SCScreenshotDynamicRange) -> Self
Set the dynamic range
Sourcepub fn with_file_path(self, path: &str) -> Self
pub fn with_file_path(self, path: &str) -> Self
Sourcepub fn with_content_type(self, identifier: &str) -> Self
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
Sourcepub fn content_type(&self) -> Option<String>
pub fn content_type(&self) -> Option<String>
Get the current content type as UTType identifier
Sourcepub fn supported_content_types() -> Vec<String>
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
pub const fn as_ptr(&self) -> *const c_void
Trait Implementations§
Source§impl Debug for SCScreenshotConfiguration
Available on crate feature macos_26_0 only.
impl Debug for SCScreenshotConfiguration
macos_26_0 only.Source§impl Default for SCScreenshotConfiguration
Available on crate feature macos_26_0 only.
impl Default for SCScreenshotConfiguration
macos_26_0 only.Source§impl Drop for SCScreenshotConfiguration
Available on crate feature macos_26_0 only.
impl Drop for SCScreenshotConfiguration
macos_26_0 only.impl Send for SCScreenshotConfiguration
macos_26_0 only.impl Sync for SCScreenshotConfiguration
macos_26_0 only.