<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIVector",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIVector"
  },
  "title" : "CIVector"
}
-->

# CIVector

The Core Image class that defines a vector object.

```
class CIVector
```

## Overview

A `CIVector` can store one or more `CGFloat` in one object. They can store a group of float values
for a variety of different uses such as coordinate points, direction vectors, geometric rectangles,
transform matrices, convolution weights, or just a list a parameter values.

You use `CIVector` objects in conjunction with other Core Image classes, such as [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class)
and [`CIKernel`](/documentation/CoreImage/CIKernel).  Many of the built-in Core Image filters have one or more `CIVector` inputs that
you can set to affect the filter’s behavior.

## Topics

### Creating a Vector

[`+  vectorWithValues:count:`](/documentation/CoreImage/CIVector/vectorWithValues:count:)

Create a Core Image vector object that is initialized with the specified values.

[`+  vectorWithX:`](/documentation/CoreImage/CIVector/vectorWithX:)

Create a Core Image vector object that is initialized with one value.

[`+  vectorWithX:Y:`](/documentation/CoreImage/CIVector/vectorWithX:Y:)

Create a Core Image vector object that is initialized with two values.

[`+  vectorWithX:Y:Z:`](/documentation/CoreImage/CIVector/vectorWithX:Y:Z:)

Create a Core Image vector object that is initialized with three values.

[`+  vectorWithX:Y:Z:W:`](/documentation/CoreImage/CIVector/vectorWithX:Y:Z:W:)

Create a Core Image vector object that is initialized with four values.

[`+  vectorWithString:`](/documentation/CoreImage/CIVector/vectorWithString:)

Create a Core Image vector object with values provided in a string representation.

[`+  vectorWithCGAffineTransform:`](/documentation/CoreImage/CIVector/init(cgAffineTransform:)-59e4k)

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

[`+  vectorWithCGPoint:`](/documentation/CoreImage/CIVector/init(cgPoint:)-3mobm)

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

[`+  vectorWithCGRect:`](/documentation/CoreImage/CIVector/init(cgRect:)-3undj)

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

### Initializing a Vector

[`-  initWithValues:count:`](/documentation/CoreImage/CIVector/init(values:count:))

Initialize a Core Image vector object with the specified the values.

[`-  initWithX:`](/documentation/CoreImage/CIVector/init(x:))

Initialize a Core Image vector object with one value.

[`-  initWithX:Y:`](/documentation/CoreImage/CIVector/init(x:y:)-4grr)

Initialize a Core Image vector object with two values.

[`-  initWithX:Y:Z:`](/documentation/CoreImage/CIVector/init(x:y:z:)-zais)

Initialize a Core Image vector object with three values.

[`-  initWithX:Y:Z:W:`](/documentation/CoreImage/CIVector/init(x:y:z:w:)-75emo)

Initialize a Core Image vector object with four values.

[`-  initWithString:`](/documentation/CoreImage/CIVector/init(string:))

Initialize a Core Image vector object with values provided in a string representation.

[`-  initWithCGAffineTransform:`](/documentation/CoreImage/CIVector/init(cgAffineTransform:)-6o8gl)

Initialize a Core Image vector object with six values provided by a `CGAffineTransform` structure.

[`-  initWithCGPoint:`](/documentation/CoreImage/CIVector/init(cgPoint:)-8cf9j)

Initialize a Core Image vector object with two values provided by a `CGPoint` structure.

[`-  initWithCGRect:`](/documentation/CoreImage/CIVector/init(cgRect:)-6bolw)

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

### Getting Values From a Vector

[`-  valueAtIndex:`](/documentation/CoreImage/CIVector/value(at:))

Returns a value from a specific position in the vector.

[`count`](/documentation/CoreImage/CIVector/count)

The number of items in the vector.

[`X`](/documentation/CoreImage/CIVector/x)

The value located in the first position in the vector.

[`Y`](/documentation/CoreImage/CIVector/y)

The value located in the second position in the vector.

[`Z`](/documentation/CoreImage/CIVector/z)

The value located in the third position in the vector.

[`W`](/documentation/CoreImage/CIVector/w)

The value located in the forth position in the vector.

[`stringRepresentation`](/documentation/CoreImage/CIVector/stringRepresentation)

Returns a formatted string with all the values of a `CIVector`.

[`CGAffineTransformValue`](/documentation/CoreImage/CIVector/cgAffineTransformValue)

Returns the values in the vector as a `CGAffineTransformValue` structure.

[`CGPointValue`](/documentation/CoreImage/CIVector/cgPointValue)

Returns the values in the vector as a `CGPoint` structure.

[`CGRectValue`](/documentation/CoreImage/CIVector/cgRectValue)

Returns the values in the vector as a `CGRect` structure.

## Relationships

### Conforms To

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

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

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

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

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

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCoding`](/documentation/Foundation/NSCoding)

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

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

[`NSCopying`](/documentation/Foundation/NSCopying)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)