react-native-vision-camera/package/ios/Frame Processor/UIImageOrientation+descriptor.h
Marc Rousavy 895f3ec889
feat: Make Frame thread-safe and improve error messages (#2327)
* fix: Fix multi-Thread access on Java

* fix: Thread-lock access on iOS as well

* whoops add missing header impl

* Update Podfile.lock

* fix: Don't use `CFGetRetainCount`

* fix: Lock access on iOS as well

* C++ format

* More detailed error

* chore: Move getters into `Frame`

* Format c++

* Use enum `orientation` again

* format

* fix: Synchronize `isValid` on Java

* Also log pixelformat

* feat: Use Java enums in C++

* Format C++
2023-12-29 14:09:56 +01:00

40 lines
939 B
Objective-C

//
// UIImageOrientation+descriptor.h
// VisionCamera
//
// Created by Marc Rousavy on 29.12.23.
// Copyright © 2023 mrousavy. All rights reserved.
//
#pragma once
#import <Foundation/Foundation.h>
#import <UIKit/UIImage.h>
@interface NSString (UIImageOrientationJSDescriptor)
+ (NSString*)stringWithParsed:(UIImageOrientation)orientation;
@end
@implementation NSString (UIImageOrientationJSDescriptor)
+ (NSString*)stringWithParsed:(UIImageOrientation)orientation {
switch (orientation) {
case UIImageOrientationUp:
case UIImageOrientationUpMirrored:
return @"portrait";
case UIImageOrientationDown:
case UIImageOrientationDownMirrored:
return @"portrait-upside-down";
case UIImageOrientationLeft:
case UIImageOrientationLeftMirrored:
return @"landscape-left";
case UIImageOrientationRight:
case UIImageOrientationRightMirrored:
return @"landscape-right";
}
}
@end