mirror of
https://github.com/expo/gl-react-native.git
synced 2026-11-15 17:34:35 -10:00
- format: "base64" || "file" - type: "png" || "jpeg"/"jpg" || "webm" (android only) - quality: from 0 to 1 (iOS support only with type=jpg/jpeg) - filePath: for format=="file" you must provide a file path (you can use react-native-fs to get directory constants)
39 lines
888 B
Objective-C
39 lines
888 B
Objective-C
#import "CaptureConfig.h"
|
|
|
|
@implementation CaptureConfig
|
|
|
|
-(instancetype)initWithFormat: (NSString *)format
|
|
withType: (NSString *)type
|
|
withQuality: (NSNumber *)quality
|
|
withFilePath: (NSString *)filePath
|
|
{
|
|
if ((self = [super init])) {
|
|
self.format = format;
|
|
self.type = type;
|
|
self.quality = quality;
|
|
self.filePath = filePath;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
|
|
- (bool) isEqualToCaptureConfig: (CaptureConfig *)other
|
|
{
|
|
return [self.format isEqualToString:other.format] &&
|
|
[self.type isEqualToString:other.type] &&
|
|
[self.quality isEqualToNumber:other.quality] &&
|
|
[self.filePath isEqualToString:other.filePath];
|
|
}
|
|
|
|
- (NSDictionary *) dictionary
|
|
{
|
|
return @{
|
|
@"format": self.format,
|
|
@"type": self.type,
|
|
@"quality": self.quality,
|
|
@"filePath": self.filePath
|
|
};
|
|
}
|
|
|
|
@end
|