SBSDKLensCameraProperties
@interface SBSDKLensCameraProperties : NSObject
Encapsulates lens and camera properties. Can be used with polygonal image cropping to achieve a very accurate aspect ratio of the resulting image. If created from image image metadata, uses a dictionary of some known devices to lookup the values.
-
The focal length of the lens used to capture an image in millimeters. Readonly.
Declaration
Objective-C
@property (nonatomic, readonly) double focalLength;
Swift
var focalLength: Double { get }
-
The 35mm equivalent focal length of the lens used to capture an image in millimeters. Readonly.
Declaration
Objective-C
@property (nonatomic, readonly) double focalLength35mm;
Swift
var focalLength35mm: Double { get }
-
The crop factor of the lens/sensor used to capture an image compared to 35mm full frame sensor. Readonly.
Declaration
Objective-C
@property (nonatomic, readonly) double cropFactor;
Swift
var cropFactor: Double { get }
-
The diagonal of the sensor area in millimeters. Readonly.
Declaration
Objective-C
@property (nonatomic, readonly) double sensorDiagonal;
Swift
var sensorDiagonal: Double { get }
-
The aspect ratio of the sensor. Usually is 4/3. Readonly.
Declaration
Objective-C
@property (nonatomic, readonly) double sensorAspectRatio;
Swift
var sensorAspectRatio: Double { get }
-
The width and height of the sensor in millimeters. Readonly.
Declaration
Objective-C
@property (nonatomic, readonly) CGSize sensorSize;
Swift
var sensorSize: CGSize { get }
-
Manufacturer of the lens. Optional.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *lensMaker;
Swift
var lensMaker: String? { get }
-
Model name of the lens. Optional.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *lensModel;
Swift
var lensModel: String? { get }
-
Initializer from image metadata. Does device dictionary lookup.
Declaration
Objective-C
+ (nullable SBSDKLensCameraProperties *)propertiesFromMetadata: (nullable SBSDKImageMetadata *)metadata;
Swift
/*not inherited*/ init?(from metadata: SBSDKImageMetadata?)
Parameters
metadata
The image metadata object that is used to extract lens and sensor properties from.
Return Value
Nil, if metadata does not contain sufficient information about lens and sensor or if for the lens model metadata entry there is no information available in the lookup dictionary.
-
Designated initializer. Does no device dictionary lookup.
- - parameter: focalLength Focal length of the lens in millimeters. Caution: NOT the 35mm equivalent.
- - parameter: sensorSize Width and height of the cameras image sensor.
- - returns: Nil, if focalLength or sensorSize contain values <= 0.
Declaration
Objective-C
- (nonnull instancetype)initWithFocalLength:(double)focalLength sensorSize:(CGSize)sensorSize;
Swift
init(focalLength: Double, sensorSize: CGSize)