<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/ImageRotator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents12ImageRotatorV"
  },
  "title" : "ImageRotator"
}
-->

# ImageRotator

An image rotating transformer.

```
struct ImageRotator
```

## Topics

### Creating the transformer

[`init(angle: Double)`](/documentation/CreateMLComponents/ImageRotator/init(angle:))

Creates a transformer that rotates an image by a specified angle.

### Getting the angle

[`var angle: Double`](/documentation/CreateMLComponents/ImageRotator/angle)

The angle, in radians, by which to rotate the coordinate space of the specified context. Positive values rotate
counterclockwise and negative values rotate clockwise.

### Performing the transformation

[`func applied(to: CIImage, eventHandler: EventHandler?) -> CIImage`](/documentation/CreateMLComponents/ImageRotator/applied(to:eventHandler:))

Rotates the image and then scales and crops the rotated image to fit the extent of the input image.

## Relationships

### Conforms To

[`Transformer`](/documentation/CreateMLComponents/Transformer)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)