UIImage
Undocumented
-
Creates a lower resolution version of an image.
Declaration
Swift
func downsample(withMaxDimension dimension: CGFloat) -> UIImage
Parameters
dimension
The maximum dimension of the image.
Return Value
A lower resolution version of an image.
-
Resizes an image to a given size with a given interpolation quality.
Declaration
Swift
func resizedImage(to newSize: CGSize, interpolationQuality quality: CGInterpolationQuality) -> UIImage
Parameters
newSize
The size of the new image.
quality
The interpolation quality.
Return Value
A resized image.
-
Resizes an image to a given size with a given interpolation quality, applies a transform and optionally draws the image transposed.
Declaration
Swift
func resizedImage(to newSize: CGSize, transform: CGAffineTransform, drawTransposed transpose: Bool, interpolationQuality quality: CGInterpolationQuality) -> UIImage
Parameters
newSize
The size of the new image.
transform
The transform to apply to the image.
transpose
Set to
true
if the image should be drawn transposed,false
otherweise.quality
The interpolation quality.
Return Value
A resized and transformed image.
-
Returns a copy of the image, taking into account its orientation
Declaration
Swift
@objc(pesdk_normalizedImage) public var normalizedImage: UIImage
-
Returns a rescaled copy of the image, taking into account its orientation
discussion: The image will be scaled disproportionately if necessary to fit the bounds specified by the parameter.
Declaration
Swift
@objc(pesdk_normalizedImageOfSize:) public func normalizedImage(of size: CGSize) -> UIImage
Parameters
size
The size of the rescaled image.
Return Value
The rescaled image.
-
Returns a copy of the image, that has
UIEdgeInsets
set, based on the informations give within a 9 patch image.Declaration
Swift
@objc(pesdk_resizableImageFrom9Patch:) public func resizableImageFrom9Patch(_ image: UIImage) -> UIImage
Parameters
image
An image must be a standard 9 patch image.
Return Value
An image that is rescaleable based on the information given by the input image.
-
Draws the receiver’s in the given rect with the given content mode.
Declaration
Swift
@objc(pesdk_drawInRect:withContentMode:) public func draw(in rect: CGRect, with contentMode: UIViewContentMode)
Parameters
rect
The rect to draw into.
contentMode
The content mode to use for drawing.
-
Returns a colored version of the image.
Declaration
Swift
func image(withTint tint: UIColor) -> UIImage
Parameters
tint
The color to colorize the image.
Return Value
The colored image.