Affine Tile Spatial Photo Filter

This filter applies an affine transform to an image and then tiles the transformed image. It is often used to create repeating patterns or textures.

Affine Tile
Tap on the image above and select 'View Spatial Photo' (only works in Vision Pro Safari).

Parameters

  • Transform: The affine transform to be applied to the image. This parameter controls the transformation matrix used to warp the image.

PIPELINE Node Source Code

CIFilter : CIAffineTile


override func getCIFilter(_ ciImage: CIImage)->CIFilter
{
        var affineTileFilter: CIFilter
        if affineTileCIFilter != nil {
            affineTileFilter = affineTileCIFilter!
        } else {
            affineTileFilter = CIFilter(name: type)!
            affineTileCIFilter=affineTileFilter
        }
                            
        affineTileFilter.setValue(ciImage, forKey: kCIInputImageKey)
        let transform=CGAffineTransform(a:a,b:b,c:c,d:d,tx:tx,ty:ty)
        affineTileFilter.setValue(transform, forKey: kCIInputTransformKey)
                            
        if cropToFormat{
            super.setCIFilterAndCropImage(inputImage: affineTileFilter.outputImage!)
            return ciFilter!
        }
        else{
            ciFilter=affineTileFilter
            return ciFilter!
        }
}