---
title: perspectiveRotate()
framework: coreimage
role: symbol
role_heading: Type Method
path: coreimage/cifilter-swift.class/perspectiverotate()
---

# perspectiveRotate()

Rotates an image in a 3D space.

## Declaration

```swift
class func perspectiveRotate() -> any CIFilter & CIPerspectiveRotate
```

## Return Value

Return Value The adjusted image.

## Discussion

Discussion This method applies the perspective rotate filter to an image. The effect rotates the image in 3D space to simulate the observer changing viewing position. The perspective rotate filter uses the following properties: The following code creates a filter that rotates the image: func perspectiveRotate(inputImage: CIImage) -> CIImage {     let perspectiveRotateFilter = CIFilter.perspectiveRotate()     perspectiveRotateFilter.inputImage = inputImage     perspectiveRotateFilter.pitch = 0     perspectiveRotateFilter.yaw = 0.1     perspectiveRotateFilter.roll = 0.3     perspectiveRotateFilter.focalLength = 18     return perspectiveRotateFilter.outputImage! }

## See Also

### Filters

- [bicubicScaleTransform()](coreimage/cifilter-swift.class/bicubicscaletransform().md)
- [edgePreserveUpsample()](coreimage/cifilter-swift.class/edgepreserveupsample().md)
- [keystoneCorrectionCombined()](coreimage/cifilter-swift.class/keystonecorrectioncombined().md)
- [keystoneCorrectionHorizontal()](coreimage/cifilter-swift.class/keystonecorrectionhorizontal().md)
- [keystoneCorrectionVertical()](coreimage/cifilter-swift.class/keystonecorrectionvertical().md)
- [lanczosScaleTransform()](coreimage/cifilter-swift.class/lanczosscaletransform().md)
- [perspectiveCorrection()](coreimage/cifilter-swift.class/perspectivecorrection().md)
- [perspectiveTransform()](coreimage/cifilter-swift.class/perspectivetransform().md)
- [perspectiveTransformWithExtent()](coreimage/cifilter-swift.class/perspectivetransformwithextent().md)
- [straighten()](coreimage/cifilter-swift.class/straighten().md)
