meshGenerator()
Generates a pattern made from an array of line segments.
Declaration
class func meshGenerator() -> any CIFilter & CIMeshGeneratorReturn Value
The generated image.
Discussion
This method generates a mesh generator image. The effect uses an array of line segments to create the resulting image.
The mesh generator filter uses the following properties:
inputMeshAn
arrayof line segments stored as an array of CIVector, each containing a start point and end point.colorA CIColor representing the color used to make the mesh.
widthA
floatrepresenting the width of the line segments as an NSNumber
The following code creates a filter that generates a green star made from mesh segments:
func mesh(mesh: NSdata) -> CIImage {
let meshGenerator = CIFilter.meshGenerator()
meshGenerator.color = CIColor.green
meshGenerator.width = 3
meshGenerator.inputmesh = mesh
return meshGenerator.outputImage!
}[Image]
See Also
Filters
attributedTextImageGenerator()aztecCodeGenerator()barcodeGenerator()blurredRectangleGenerator()checkerboardGenerator()code128BarcodeGenerator()lenticularHaloGenerator()pdf417BarcodeGenerator()qrCodeGenerator()randomGenerator()roundedRectangleGenerator()roundedRectangleStrokeGenerator()starShineGenerator()stripesGenerator()sunbeamsGenerator()