CIVector Class Reference
| Inherits from | |
| Conforms to | |
| Framework | Library/Frameworks/CoreImage.framework |
| Availability | Available in iOS 5.0 and later. |
| Companion guide | |
| Declared in | CIVector.h |
Overview
The CIVector class is used for coordinate values and direction vectors. You typically use a CIVector object to pass parameter values to Core Image filters. CIVector objects work in conjunction with other Core Image classes, such as CIFilter, CIContext, CIImage, and CIColor, to process images using the Core Image framework.
Tasks
Creating a Vector
-
+ vectorWithValues:count: -
+ vectorWithX: -
+ vectorWithX:Y: -
+ vectorWithX:Y:Z: -
+ vectorWithX:Y:Z:W: -
+ vectorWithString: -
+ vectorWithCGAffineTransform: -
+ vectorWithCGPoint: -
+ vectorWithCGRect:
Initializing a Vector
-
– initWithValues:count: -
– initWithX: -
– initWithX:Y: -
– initWithX:Y:Z: -
– initWithX:Y:Z:W: -
– initWithString: -
– initWithCGAffineTransform: -
– initWithCGPoint: -
– initWithCGRect:
Getting Values From a Vector
Class Methods
vectorWithCGAffineTransform:
Creates and returns a vector that is initialized with values provided by a CGAffineTransform structure.
Parameters
- t
A transform.
Return Value
A vector initialized with the specified values.
Discussion
The six values that comprise the affine transform fill the first six positions of the resulting CIVector object.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hvectorWithCGPoint:
Creates and returns a vector that is initialized with values provided by a CGPoint structure.
Parameters
- p
A point.
Return Value
A vector initialized with the specified values.
Discussion
The CGPoint structure’s X and Y values are stored in the vector’s X and Y properties.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hvectorWithCGRect:
Creates and returns a vector that is initialized with values provided by a CGRect structure.
Parameters
- r
A rect.
Return Value
A vector initialized with the specified values.
Discussion
The CGRect structure’s X, Y, height and width values are stored in the vector’s X, Y, Z and W properties.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hvectorWithString:
Creates and returns a vector that is initialized with values provided in a string representation.
Parameters
- representation
A string that is in one of the formats returned by the
stringRepresentationmethod.
Discussion
Some typical string representations for vectors are:
@"[1.0 0.5 0.3]"
which specifies a vec3 vector whose components are X = 1.0, Y = 0.5, and Z = 0.3
@"[10.0 23.0]
which specifies a vec2 vector show components are X = 10.0 and Y = 23.0
Availability
- Available in iOS 5.0 and later.
See Also
Declared In
CIVector.hvectorWithValues:count:
Creates and returns a vector that is initialized with the specified values.
Parameters
- values
The values to initialize the vector with.
- count
The number of values in the vector.
Return Value
A vector initialized with the provided values.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hvectorWithX:
Creates and returns a vector that is initialized with one value.
Parameters
- x
The value to initialize the vector with.
Return Value
A vector initialized with the specified value.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hvectorWithX:Y:
Creates and returns a vector that is initialized with two values.
Parameters
- x
The value for the first position in the vector.
- y
The value for the second position in the vector.
Return Value
A vector initialized with the specified values.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hvectorWithX:Y:Z:
Creates and returns a vector that is initialized with three values.
Parameters
- x
The value for the first position in the vector.
- y
The value for the second position in the vector.
- z
The value for the third position in the vector.
Return Value
A vector initialized with the specified values.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hvectorWithX:Y:Z:W:
Creates and returns a vector that is initialized with four values.
Parameters
- x
The value for the first position in the vector.
- y
The value for the second position in the vector.
- z
The value for the third position in the vector.
- w
The value for the fourth position in the vector.
Return Value
A vector initialized with the specified values.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hInstance Methods
CGAffineTransformValue
Returns the values stored in the CIVector object as an affine transform.
Return Value
A transform.
Discussion
The first six values in the vector become the values that comprise the affine transform.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hCGPointValue
Returns the values stored in the CIVector object as a point.
Return Value
A point.
Discussion
The vector’s X and Y property values become the CGPoint structure’s X and Y values.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hCGRectValue
Returns the values stored in the CIVector object as an rect.
Return Value
A rect.
Discussion
The vector’s X, Y, Z and W property values become the CGRect structure’s X, Y, height and width values.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hcount
Returns the number of items in a vector.
Return Value
The number of items in the vector.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hinitWithCGAffineTransform:
Initializes a vector that is initialized with values provided by a CGAffineTransform structure.
Parameters
- r
A transform.
Discussion
The six values that comprise the affine transform fill the first six positions of the resulting CIVector object.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hinitWithCGPoint:
Initializes a vector that is initialized with values provided by a CGPoint structure.
Parameters
- p
A point.
Discussion
The CGPoint structure’s X and Y values are stored in the vector’s X and Y properties.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hinitWithCGRect:
Initializes a vector that is initialized with values provided by a CGRect structure.
Parameters
- r
A rect.
Discussion
The CGRect structure’s X, Y, height and width values are stored in the vector’s X, Y, Z and W properties.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hinitWithString:
Initializes a vector with values provided in a string representation.
Parameters
- representation
A string that is in one of the formats returned by the
stringRepresentationmethod.
Availability
- Available in iOS 5.0 and later.
See Also
Declared In
CIVector.hinitWithValues:count:
Initializes a vector with the provided values.
Parameters
- values
The values to initialize the vector with.
- count
The number of values specified by the
valuesargument.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hinitWithX:
Initializes the first position of a vector with the provided values.
Parameters
- x
The initialization value.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hinitWithX:Y:
Initializes the first two positions of a vector with the provided values.
Parameters
- x
The initialization value for the first position.
- y
The initialization value for the second position.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hinitWithX:Y:Z:
Initializes the first three positions of a vector with the provided values.
Parameters
- x
The initialization value for the first position.
- y
The initialization value for the second position.
- z
The initialization value for the third position.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hinitWithX:Y:Z:W:
Initializes four positions of a vector with the provided values.
Parameters
- x
The initialization value for the first position.
- y
The initialization value for the second position.
- z
The initialization value for the third position.
- w
The initialization value for the fourth position.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hstringRepresentation
Returns a string representation for a vector.
Return Value
A string object.
Discussion
You convert the string representation returned by this method to a vector by supplying it as a parameter to the vectorWithString: method.
Some typical string representations for vectors are:
@"[1.0 0.5 0.3]"
which specifies a vec3 vector whose components are X = 1.0, Y = 0.5, and Z = 0.3
@"[10.0 23.0]
which specifies a vec2 vector show components are X = 10.0 and Y = 23.0
Availability
- Available in iOS 5.0 and later.
See Also
Declared In
CIVector.hvalueAtIndex:
Returns a value from a specific position in a vector.
Parameters
- index
The position in the vector of the value that you want to retrieve.
Return Value
The value retrieved from the vector or 0 if the position is undefined.
Discussion
The numbering of elements in a vector begins with zero.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hW
Returns the value located in the fourth position in a vector.
Return Value
The value retrieved from the vector.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hX
Returns the value located in the first position in a vector.
Return Value
The value retrieved from the vector.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hY
Returns the value located in the second position in a vector.
Return Value
The value retrieved from the vector.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.hZ
Returns the value located in the third position in a vector.
Return Value
The value retrieved from the vector.
Availability
- Available in iOS 5.0 and later.
Declared In
CIVector.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)