PhotoEditModel
@available(iOS 9.0, *)
public struct PhotoEditModel : Equatable
extension PhotoEditModel: ObjectiveCBridgeable
A PhotoEditModel
holds information about any modification that should be applied to an image.
-
Information about the adjustments that should be applied to an image.
Declaration
Swift
public var adjustmentModel: AdjustmentModel
-
Information about the effect that should be applied to an image.
Declaration
Swift
public var effectFilterModel: EffectFilterModel
-
Information about the focus that should be applied to an image.
Declaration
Swift
public var focusModel: FocusModel
-
Information about the overlay that should be applied to an image.
Declaration
Swift
public var overlayModel: OverlayModel
-
Information about the sprites that should be added to an image.
Declaration
Swift
public var spriteModels: [SpriteModel]
-
Information about the transform that should be applied to an image.
Declaration
Swift
public var transformModel: TransformModel
-
Information about the trim that should be applied to a video.
Declaration
Swift
public var trimModel: TrimModel
-
Whether auto enhancement is enabled for an image.
Declaration
Swift
public var isAutoEnhancementEnabled: Bool
-
Deserializes a
PhotoEditModel
using the given data. If the serialized data does not contain animage
object, a reference size must be provided. If there are serialized input dimensions but a reference size is passed regardless, the reference size takes precedence over the deserialized size.Declaration
Swift
public init?(serializedData data: Data, referenceSize: CGSize?, assetCatalog: AssetCatalog)
Parameters
data
The data to deserialize.
referenceSize
A size that the deserialized data should refer to when denormalizing normalized values.
assetCatalog
If the deserialized data contains embedded personal assets they will be added to this
AssetCatalog
. -
Deserializes a
PhotoEditModel
using the given data. If the serialized data does not contain animage
object, a reference size must be provided. If there are serialized input dimensions but a reference size is passed regardless, the reference size takes precedence over the deserialized size. If the deserialized data contains embedded personal assets they will be added toAssetCatalog.shared
.Declaration
Swift
public init?(serializedData data: Data, referenceSize: CGSize?)
Parameters
data
The data to deserialize.
referenceSize
A size that the deserialized data should refer to when denormalizing normalized values.
-
Deserializes a
PhotoEditModel
using the given data. If the serialized data does not contain animage
object, a reference size larger thanCGSize.zero
must be provided. If there are serialized input dimensions but a reference size larger thanCGSize.zero
is passed regardless, the reference size takes precedence over the deserialized size. If the deserialized data contains embedded personal assets they will be added toAssetCatalog.shared
.Declaration
Swift
public init?(serializedData data: Data, referenceSize: CGSize)
Parameters
data
The data to deserialize.
referenceSize
A size that the deserialized data should refer to when denormalizing normalized values or
CGSize.zero
.
-
Searches for a
SpriteModel
with the givenUUID
.Declaration
Swift
public func spriteModel(with uuid: UUID) -> (Int, SpriteModel)?
Parameters
uuid
The
UUID
of the sprite model to search for.Return Value
A tuple with the index of the sprite model within the sprite model array and the sprite model if it is found,
nil
otherwise.
-
Serializes this model into a storable representation by encoding all currently applied tools.
If the model contains embedded personal assets they will be sourced from
AssetCatalog.shared
and downloaded if necessary. If possible useserialized(with photo: Photo, includeImageData: Bool, assetCatalog: AssetCatalog, assetManager: AssetManager)
instead and provide theAssetManager
so that cached data can be used if available.Declaration
Swift
public func serialized(with photo: Photo, includeImageData: Bool) -> Data?
Parameters
photo
A photo that this serialization references. This is needed to preserve certain aspect ratios.
includeImageData
Whether to also include the image data as a base64 encoded JPEG in the serialized model.
Return Value
The serialized model as bytes or nil, if the serialization failed.
-
Serializes this model into a storable representation by encoding all currently applied tools.
Declaration
Swift
public func serialized(with photo: Photo, includeImageData: Bool, assetCatalog: AssetCatalog, assetManager: AssetManager) -> Data?
Parameters
photo
A photo that this serialization references. This is needed to preserve certain aspect ratios.
includeImageData
Whether to also include the image data as a base64 encoded JPEG in the serialized model.
assetCatalog
The
AssetCatalog
that is used to find personal assets that need to be embedded in the serialization.assetManager
The
AssetManager
that is used to find personal asset data that needs to be embedded in the serialization.Return Value
The serialized model as bytes or nil, if the serialization failed.