An extension on `UIImage.Orientation` to convert it to the corresponding `CGImagePropertyOrientation` case.
extension UIImage.Orientation { | |
/// Get the equivalent `CGImagePropertyOrientation` enum case. | |
var cgOrientation: CGImagePropertyOrientation { | |
switch self { | |
case .up: return .up | |
case .down: return .down | |
case .left: return .left | |
case .right: return .right | |
case .upMirrored: return .upMirrored | |
case .downMirrored: return .downMirrored | |
case .leftMirrored: return .leftMirrored | |
case .rightMirrored: return .rightMirrored | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment