Contents

hexagonalPixellate()

Creates an image made of a series of colorful hexagons.

Declaration

class func hexagonalPixellate() -> any CIFilter & CIHexagonalPixellate

Return Value

The modified image.

Discussion

This method applies the hexagonal pixelate filter to an image. The effect creates an image containing colored hexagons.

The hexagonal pixelate filter uses the following properties:

inputImage

An image with the type CIImage.

center

A set of coordinates marking the center of the image as a CGPoint.

scale

A float representing the scale of the hexagons as an NSNumber.

The following code creates a filter that results in an image made up of hexagons:

func hexagonalPixelate (inputImage: CIImage) -> CIImage {
    let hexagonalPixelateFilter = CIFilter.hexagonalPixellate()
    hexagonalPixelateFilter.inputImage = inputImage
    hexagonalPixelateFilter.center = CGPoint(x: 2016, y: 1512)
    hexagonalPixelateFilter.scale = 50
    return hexagonalPixelateFilter.outputImage!
}

[Image]

See Also

Filters