<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIVector/init(cgRect:)-3undj",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIVector(cm)vectorWithCGRect:"
  },
  "title" : "init(cgRect:)"
}
-->

# init(cgRect:)

Create a Core Image vector object that is initialized with four values provided by a `CGRect` structure.

```
convenience init(cgRect r: CGRect)
```

## Parameters

`r`

The `CGRect` structure.

## Return Value


An autoreleased [`CIVector`](/documentation/CoreImage/CIVector) object of length 4.

## Discussion

The `CGRect` structure’s `x`, `y`, `height` and `width` values
are stored in the vector’s four values.

---

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)