PhotoEditModel
@available(iOS 9.0, *)
public struct PhotoEditModel : Equatable
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 photo 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
-
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 do not contain animage
object, a separate image must be provided. If there are serialized input dimensions, but an image is passed, the passed images dimensions will always take precedence over any deserialized dimensions.Declaration
Swift
public init?(deserializedFrom data: Data, toImage image: UIImage?)
-
Serializes this model into a storable representation by encoding all currently applied tools.
Declaration
Swift
@available(*, deprecated, message: "Use `serialized(with:includeImageData:﹚` instead.") public func serialized(with image: UIImage) -> Data?
Parameters
image
A reference image to restore the full state upon deserialization.
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) -> 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.
-
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.