aboutsummaryrefslogtreecommitdiff
path: root/Captura/Core Extensions
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2023-07-28 13:48:53 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2023-07-28 13:48:53 +0200
commitc9b9e1d654ea697afad9f6427d94623bfdf55cce (patch)
treea0095a75f2ba625f92923e72a9831740da989de7 /Captura/Core Extensions
parentf5d16c1c8c259966338b23afd407d142f72784aa (diff)
Add clipboard
Diffstat (limited to 'Captura/Core Extensions')
-rw-r--r--Captura/Core Extensions/CVImageBuffer+cgImage.swift11
-rw-r--r--Captura/Core Extensions/Notification+AppEvents.swift2
2 files changed, 13 insertions, 0 deletions
diff --git a/Captura/Core Extensions/CVImageBuffer+cgImage.swift b/Captura/Core Extensions/CVImageBuffer+cgImage.swift
new file mode 100644
index 0000000..c30cb0c
--- /dev/null
+++ b/Captura/Core Extensions/CVImageBuffer+cgImage.swift
@@ -0,0 +1,11 @@
+import Foundation
+import ReplayKit
+
+extension CVImageBuffer {
+
+ var cgImage: CGImage? {
+ let ciImage = CIImage(cvImageBuffer: self)
+ let context = CIContext()
+ return context.createCGImage(ciImage, from: CGRect(x: 0, y: 0, width: CVPixelBufferGetWidth(self), height: CVPixelBufferGetHeight(self)))
+ }
+}
diff --git a/Captura/Core Extensions/Notification+AppEvents.swift b/Captura/Core Extensions/Notification+AppEvents.swift
index 809c00e..5d00937 100644
--- a/Captura/Core Extensions/Notification+AppEvents.swift
+++ b/Captura/Core Extensions/Notification+AppEvents.swift
@@ -6,4 +6,6 @@ extension Notification.Name {
static let stopRecording = Notification.Name("stopRecording")
static let finalizeRecording = Notification.Name("finalizeRecording")
static let reset = Notification.Name("reset")
+ static let failedToStart = Notification.Name("failedToStart")
+ static let receivedFrame = Notification.Name("receivedFrame")
}