This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve compatibility with macOS Ventura and macOS Monterey.
- Loading branch information
1 parent
12b48a3
commit 9388c4f
Showing
21 changed files
with
412 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// QRCodeGenerator.swift | ||
// Retroactive | ||
// | ||
|
||
import AppKit | ||
|
||
final class QRCodeGenerator { | ||
static func generate(string: String, size: CGSize) -> NSImage? { | ||
guard let data = string.data(using: .utf8) else { | ||
return nil | ||
} | ||
|
||
guard let filter = CIFilter(name: "CIQRCodeGenerator") else { | ||
return nil | ||
} | ||
|
||
filter.setValue(data, forKey: "inputMessage") | ||
filter.setValue("Q", forKey: "inputCorrectionLevel") | ||
|
||
|
||
guard let ciImage = filter.outputImage else { | ||
return nil | ||
} | ||
|
||
guard let colorInvertFilter = CIFilter(name: "CIColorInvert") else { return nil } | ||
colorInvertFilter.setValue(ciImage, forKey: "inputImage") | ||
guard let outputInvertedImage = colorInvertFilter.outputImage else { return nil } | ||
|
||
guard let maskToAlphaFilter = CIFilter(name: "CIMaskToAlpha") else { return nil } | ||
maskToAlphaFilter.setValue(outputInvertedImage, forKey: "inputImage") | ||
guard let outputCIImage = maskToAlphaFilter.outputImage else { return nil } | ||
|
||
let rep = NSCIImageRep(ciImage: outputCIImage) | ||
let image = NSImage(size: rep.size) | ||
image.addRepresentation(rep) | ||
|
||
let finalImage = NSImage(size: size) | ||
finalImage.lockFocus() | ||
NSGraphicsContext.current?.imageInterpolation = .none | ||
image.draw(in: NSRect(origin: .zero, size: size)) | ||
finalImage.unlockFocus() | ||
|
||
return finalImage | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9388c4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just re-ran retroactive on Aperture in Monterey on a Mac Studio and it seems way more stable, it used to crash like crazy!
I am not sure if it is a coincidence or if that is what all of this work was, but whatever you are doing is making for a great user experience. Thank you!
9388c4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if retroactive runs on the new Sanoma system on the Mac Studio (2022). It now runs perfect on MacOS Montery thx in advance Albert
9388c4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear cormiertyshawn
thank you for your fantastic work with Retroactive!!! Any chance of it make finalcut 7 run on Sonoma M3 Silicon apple macbook pro in the near future?
Best regards,
pedro aspahan