PhotoEditRenderer
@objc(PESDKPhotoEditRenderer) open class PhotoEditRenderer: NSObject
A PhotoEditRenderer
takes a CIImage
and a PhotoEditModel
as input and takes care of
applying all necessary effects and filters to the image. The output image can then be rendered
into an EAGLContext
or converted into a CGImage
instance.
-
The input image.
Declaration
Swift
open var originalImage: CIImage?
-
The photo edit model that describes all effects that should be applied to the input image.
Declaration
Swift
open var photoEditModel = PhotoEditModel()
-
The render mode describes which effects should be applied to the input image.
Declaration
Swift
open var renderMode = PESDKRenderMode.all
-
A
CIImage
instance with all effects and filters applied to it.Declaration
Swift
open var outputImage: CIImage
-
The size of the output image.
Declaration
Swift
open var outputImageSize: CGSize
-
Applies all necessary filters and effects to the input image and converts it to an instance of
CGImage
.Declaration
Swift
open func newOutputImage() -> CGImage
Return Value
A newly created instance of
CGImage
. -
Same as
newOutputImage()
but asynchronously.Declaration
Swift
open func createOutputImage(with completion: @escaping (_ outputImage: CGImage) -> Void)
Parameters
completion
A completion handler that receives the newly created instance of
CGImage
once rendering is complete. -
Applies all necessary filters and effects to the input image and converts it to an instance of
NSData
with the given compression quality.Declaration
Swift
open func generateOutputImageData(withCompressionQuality compressionQuality: CGFloat, metadataSourceImageURL: URL?, completionHandler: @escaping (_ outputImageData: Data?, _ imageWidth: CGFloat, _ imageHeight: CGFloat) -> Void)
Parameters
compressionQuality
The compression quality to apply.
metadataSourceImageURL
An url to the original image of which the metadata should be copied to the new image.
completionHandler
A completion handler that receives the newly created instance of
NSData
once rendering is complete. -
Draws the output image into the given
EAGLContext
.Declaration
Swift
open func drawOutputImage(in context: EAGLContext, to rect: CGRect, viewportWidth: Int, viewportHeight: Int)
Parameters
context
An instance of
EAGLContext
to draw into.rect
The
CGRect
in which the output image should be drawn.viewportWidth
The width of the view that displays the framebuffer’s content.
viewportHeight
The height of the view that displays the framebuffer’s content.
-
The photo edit model that describes all effects that should be applied to the input image.
Declaration
Swift
public var objcPhotoEditModel: _ObjCPhotoEditModel