StampGenerator
@objc(PESDKStampGenerator) open class StampGenerator: NSObject
A StampGenerator
is responsible for generating a stamp image that is used by a brush to draw a stroke.
-
The size of the generated stamp.
Declaration
Swift
open var size: CGSize = CGSize(width: 512, height: 512)
-
The stamp image.
Declaration
Swift
open var stamp: UIImage
-
A lower resolution version of the stamp image. This is used for the brush preview.
Declaration
Swift
open var smallStamp: UIImage
-
The base dimension of the generated stamp image.
Declaration
Swift
open var baseDimension: CGFloat
-
The bounds of the generated stamp image.
Declaration
Swift
open var baseBounds: CGRect
-
The scale of the stamp image in respect to its base dimension.
Declaration
Swift
open var scale: CGFloat
-
The object that acts as the delegate of the stamp generator.
Declaration
Swift
open weak var delegate: GeneratorDelegate?
-
This method should by overriden by subclasses. This is where the actual stamp image should be generated using Core Graphics.
Declaration
Swift
open func renderStamp(in context: CGContext)
Parameters
context
The context to render into.
-
A helper method to generate a radial gradient image from white to black.
Declaration
Swift
open func radialFade(withHardness hardness: CGFloat) -> CGImage
Parameters
hardness
The hardness of the gradient.
Return Value
A radial gradient image from white to black.