Orientation
@objc(PESDKOrientation)
public enum Orientation : Int
extension Orientation: CustomStringConvertible
Represents the orientation of an image and has the same meaning as the corresponding EXIF value.
-
Row 0 is at the top, column 0 is on the left.
Declaration
Swift
case normal = 1
-
Row 0 is at the top, column 0 is on the right.
Declaration
Swift
case flipX
-
Row 0 is at the bottom, column 0 is on the right.
Declaration
Swift
case rotate180
-
Row 0 is at the bottom, column 0 is on the left.
Declaration
Swift
case flipY
-
Row 0 is on the left, column 0 is at the top.
Declaration
Swift
case transverse
-
Row 0 is on the right, column 0 is at the top.
Declaration
Swift
case rotate90
-
Row 0 is on the right, column 0 is at the bottom.
Declaration
Swift
case transpose
-
Row 0 is on the left, column 0 is at the bottom.
Declaration
Swift
case rotate270
-
The corresponding EXIF value converted as
Int32
.Declaration
Swift
public var exifValue: Int32 { get }
-
Creates an
Orientation
that corresponds to the givenUIImageOrientation
.Declaration
Swift
public init(imageOrientation: UIImage.Orientation)
Parameters
imageOrientation
A
UIImageOrientation
.Return Value
A corresponding orientation.
-
Creates an orientation constructed by combining two existing orientations.
Declaration
Swift
public func concatenating(_ o2: Orientation) -> Orientation
Parameters
o2
The orientation to concatenate to this orientation.
Return Value
A new orientation.
-
Creates a new orientation that is between two other orientations.
Declaration
Swift
public func orientation(between o2: Orientation) -> Orientation
Parameters
o2
The second orientation.
Return Value
A new orientation.
-
The inverse orientation of the receiver.
Declaration
Swift
public var inversed: Orientation { get }
-
Creates a
CGAffineTransform
for an object of the given size that represents the receiver’s orientation.Declaration
Swift
public func transform(with size: CGSize) -> CGAffineTransform
Parameters
size
The size of the object. This is needed to calulcate the correct translations.
Return Value
A
CGAffineTransform
. -
Whether the orientation represents a mirrored orientation.
Declaration
Swift
public var isMirrored: Bool { get }
-
Calculate the components that make the current orientation.
Declaration
Swift
public func calculateOrientationParameters() -> (angle: Int, flippedHorizontally: Bool, flippedVertically: Bool)
Return Value
The angle and flipped states.