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

# init(cgRect:)

Initialize a Core Image vector object 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 initialized 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

### Initializing a Vector

- [init(values:count:)](coreimage/civector/init(values:count:).md)
- [init(x:)](coreimage/civector/init(x:).md)
- [init(x:y:)](coreimage/civector/init(x:y:)-4grr.md)
- [init(x:y:z:)](coreimage/civector/init(x:y:z:)-zais.md)
- [init(x:y:z:w:)](coreimage/civector/init(x:y:z:w:)-75emo.md)
- [init(string:)](coreimage/civector/init(string:).md)
- [init(cgAffineTransform:)](coreimage/civector/init(cgaffinetransform:)-6o8gl.md)
- [init(cgPoint:)](coreimage/civector/init(cgpoint:)-8cf9j.md)
