# SCContentFilter

```

// 是对shareContent的filter，从而影响捕获的流
@available(macOS 12.3, *)
open class SCContentFilter : NSObject {

//  《1》Creating a filter 创建一个过滤器 ，通过配置shareContent的内容创建
    public init(desktopIndependentWindow window: SCWindow)
    public init(display: SCDisplay, excludingWindows excluded: [SCWindow])
    public init(display: SCDisplay, including includedWindows: [SCWindow])
    public init(display: SCDisplay, including applications: [SCRunningApplication], exceptingWindows: [SCWindow])
    public init(display: SCDisplay, excludingApplications applications: [SCRunningApplication], exceptingWindows: [SCWindow])

// 《2》Filter properties 过滤器的属性
    open var pointPixelScale: Float { get } // 带你像素因子
    open var contentRect: CGRect { get } // 内容的位置大小
    @available(macOS, introduced: 14.0, deprecated: 14.2, message: "Use style instead")
    open var streamType: SCStreamType { get } // 流的类型
    //  流类型
    public enum SCStreamType : Int, @unchecked Sendable {
        case window = 0
        case display = 1
    }

    open var style: SCShareableContentStyle { get } //共享内容的样式

//  《3》Instance Properties 实例属性
//  包括菜单栏是否捕获。 这个属性对桌面独立的过滤器不影响
//  对于使用initWithDisplay:excluding 方法创建的，默认是YES。 display的excluding包括desktop和dock
//  对于使用initWithDisplay:including 方法创建的，默认是NO，display的including不包括desktop和dock
    @available(macOS 14.2, *)
    open var includeMenuBar: Bool
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hly-tech.gitbook.io/fend/mac/screencapturekit/api/content-capture-nei-rong-bu-huo/sccontentfilter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
