Contents

accordionFoldTransition()

Transitions by folding and crossfading an image to reveal the target image.

Declaration

class func accordionFoldTransition() -> any CIFilter & CIAccordionFoldTransition

Return Value

The transition image.

Discussion

This method applies the accordion fold transition filter to an image. The effect transitions from one image to another by unfolding and crossfading.

The accordion fold transition filter uses the following properties:

inputImage

The starting image with the type CIImage.

targetImage

The ending image with the type CIImage.

time

A float representing the parametric time of the transition from start (at time 0) to end (at time 1) as an NSNumber.

numberOfFolds

A float representing the number of accordion folds as a NSNumber.

foldShadowAmount

A float representing the strength of the shadow as a NSNumber.

The following code creates a filter that produces folds in the input image and fades to the target image:

func accordionFold(inputImage: CIImage, targetImage: CIImage) -> CIImage {
    let accordionFoldTransiton = CIFilter.accordionFoldTransition()
    accordionFoldTransiton.inputImage = inputImage
    accordionFoldTransiton.targetImage = targetImage
    accordionFoldTransiton.time = 0.5
    accordionFoldTransiton.numberOfFolds = 6
    accordionFoldTransiton.foldShadowAmount = 2
    return accordionFoldTransiton.outputImage!
}

[Image]

See Also

Filters