<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIVector/init(cgRect:)-6bolw",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIVector(im)initWithCGRect:"
  },
  "title" : "init(cgRect:)"
}
-->

# init(cgRect:)

Initialize a Core Image vector object with four values provided by a `CGRect` structure.

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

## Parameters

`r`

The `CGRect` structure.

## Return Value


An initialized [`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)