Files
Gaëtan Renaudeau d202a1ff6f Implement options for captureFrame
- 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)
2015-12-31 14:07:02 +01:00

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