Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 7, 2022
1 parent 06fda2f commit ad9cfcd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gifski/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ extension CGImage {
}


// TODO: Remove this when targeting macOS 13 and use https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/3930658-image?changes=latest_minor instead.
extension AVAssetImageGenerator {
func image(at time: CMTime) -> NSImage? {
(try? copyCGImage(at: time, actualTime: nil))?.nsImage
Expand Down Expand Up @@ -657,6 +658,8 @@ extension AVAssetTrack {
reader.cancelReading()
}

// TODO: When targeting macOS 13, use this instead: https://developer.apple.com/documentation/avfoundation/avsamplebuffergenerator/3950878-makebatch?changes=latest_minor

// Iterate through samples until we reach one with a non-zero size.
while let sampleBuffer = readerOutput.copyNextSampleBuffer() {
guard [.completed, .reading].contains(reader.status) else {
Expand Down Expand Up @@ -4169,6 +4172,7 @@ extension vImage_Buffer {
}


// TODO: Use `vImage.PixelBuffer` for all pixel buffer stuff when targeting macOS 13: https://developer.apple.com/documentation/accelerate/vimage/pixelbuffer?changes=latest_minor
extension CGImage {
/**
Convert an image to a `vImage` buffer of the given pixel format.
Expand Down

0 comments on commit ad9cfcd

Please sign in to comment.