Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scaleFactor parameter #73

Merged
merged 3 commits into from
Mar 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/Aperture/Aperture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public final class Aperture: NSObject {
- Parameter screenId: The ID of the screen to be captured.
- Parameter audioDevice: An optional audio device to capture.
- Parameter videoCodec: The video codec to use when capturing.
- Parameter scaleFactor: The actual height and width of the capture will be multiplied by this number to create the height and width of the output.
*/
public convenience init(
destination: URL,
Expand All @@ -95,7 +96,8 @@ public final class Aperture: NSObject {
highlightClicks: Bool = false,
screenId: CGDirectDisplayID = .main,
audioDevice: AVCaptureDevice? = .default(for: .audio),
videoCodec: AVVideoCodecType? = nil
videoCodec: AVVideoCodecType? = nil,
scaleFactor: Double = 1
) throws {
let input = try AVCaptureScreenInput(displayID: screenId).unwrapOrThrow(Error.invalidScreen)

Expand All @@ -105,6 +107,7 @@ public final class Aperture: NSObject {
input.cropRect = cropRect
}

input.scaleFactor = CGFloat(scaleFactor)
input.capturesCursor = showCursor
input.capturesMouseClicks = highlightClicks

Expand Down