Guest User

Untitled

a guest
Jun 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. // Convert UIImageOrientation to CGImageOrientation for use in Vision analysis.
  2. extension CGImagePropertyOrientation {
  3. init(_ uiImageOrientation: UIImage.Orientation) {
  4. switch uiImageOrientation {
  5. case .up: self = .up
  6. case .down: self = .down
  7. case .left: self = .left
  8. case .right: self = .right
  9. case .upMirrored: self = .upMirrored
  10. case .downMirrored: self = .downMirrored
  11. case .leftMirrored: self = .leftMirrored
  12. case .rightMirrored: self = .rightMirrored
  13. }
  14. }
  15. }
Add Comment
Please, Sign In to add comment