---
title: "init(cgRect:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/civector/init(cgrect:)-3undj"
---

# init(cgRect:)

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

## Declaration

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

## Parameters

- `r`: The CGRect structure.

## Return Value

Return Value  An autoreleased CIVector object of length 4.

## Discussion

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

## See Also

### Creating a Vector

- [init(cgAffineTransform:)](coreimage/civector/init(cgaffinetransform:)-59e4k.md)
- [init(cgPoint:)](coreimage/civector/init(cgpoint:)-3mobm.md)
