Skip to content

Instantly share code, notes, and snippets.

View richardhenry's full-sized avatar

Richard Henry richardhenry

  • San Francisco, CA
View GitHub Profile
@richardhenry
richardhenry / CVPixelBuffer+Rotate.swift
Last active November 3, 2023 23:12
Rotate a CVPixelBuffer with ARGB pixels by 90 degrees using the Accelerate framework
//
// CVPixelBuffer+Rotate.swift
//
// Abstract:
// This CVPixelBuffer extension provides a method that will rotate an
// ARGB pixel buffer by a multiple of 90 degrees using the high performance
// Accelerate framework provided on Apple platforms. This method is
// designed to be compatible with Core Video APIs on iOS, which may require
// the pixel buffer to be memory aligned and backed by an IOSurface.
//