Inherits from | |
Conforms to | |
Framework | Library/Frameworks/QuartzCore.framework |
Availability | Mac OS X v10.4 and later |
Companion guide | |
Declared in | CIVector.h |
Related sample code |
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.
+ vectorWithValues:count:
+ vectorWithX:
+ vectorWithX:Y:
+ vectorWithX:Y:Z:
+ vectorWithX:Y:Z:W:
+ vectorWithString:
– initWithValues:count:
– initWithX:
– initWithX:Y:
– initWithX:Y:Z:
– initWithX:Y:Z:W:
– initWithString:
Creates and returns a vector that is initialized with values provided in a string representation.
+ (CIVector *)vectorWithString:(NSString *)representation
A string that is in one of the formats returned by the stringRepresentation
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
CIVector.h
Creates and returns a vector that is initialized with the specified values.
+ (CIVector *)vectorWithValues:(const CGFloat *)values count:(size_t)count
The values to initialize the vector with.
The number of values in the vector.
A vector initialized with the provided values.
CIVector.h
Creates and returns a vector that is initialized with one value.
+ (CIVector *)vectorWithX:(CGFloat)x
The value to initialize the vector with.
A vector initialized with the specified value.
CIVector.h
Creates and returns a vector that is initialized with two values.
+ (CIVector *)vectorWithX:(CGFloat)x Y:(CGFloat)y
The value for the first position in the vector.
The value for the second position in the vector.
A vector initialized with the specified values.
CIVector.h
Creates and returns a vector that is initialized with three values.
+ (CIVector *)vectorWithX:(CGFloat)x Y:(CGFloat)y Z:(CGFloat)z
The value for the first position in the vector.
The value for the second position in the vector.
The value for the third position in the vector.
A vector initialized with the specified values.
CIVector.h
Creates and returns a vector that is initialized with four values.
+ (CIVector *)vectorWithX:(CGFloat)x Y:(CGFloat)y Z:(CGFloat)z W:(CGFloat)w
The value for the first position in the vector.
The value for the second position in the vector.
The value for the third position in the vector.
The value for the fourth position in the vector.
A vector initialized with the specified values.
CIVector.h
Returns the number of items in a vector.
- (size_t)count
The number of items in the vector.
CIVector.h
Initializes a vector with values provided in a string representation.
- (id)initWithString:(NSString *)representation;
A string that is in one of the formats returned by the stringRepresentation
method.
CIVector.h
Initializes a vector with the provided values.
- (id)initWithValues:(const CGFloat *)values count:(size_t)count
The values to initialize the vector with.
The number of values specified by the values
argument.
CIVector.h
Initializes the first position of a vector with the provided values.
- (id)initWithX:(CGFloat)x
The initialization value.
CIVector.h
Initializes the first two positions of a vector with the provided values.
- (id)initWithX:(CGFloat)x Y:(CGFloat)y
The initialization value for the first position.
The initialization value for the second position.
CIVector.h
Initializes the first three positions of a vector with the provided values.
- (id)initWithX:(CGFloat)x Y:(CGFloat)y Z:(CGFloat)z
The initialization value for the first position.
The initialization value for the second position.
The initialization value for the third position.
CIVector.h
Initializes four positions of a vector with the provided values.
- (id)initWithX:(CGFloat)x Y:(CGFloat)y Z:(CGFloat)z W:(CGFloat)w
The initialization value for the first position.
The initialization value for the second position.
The initialization value for the third position.
The initialization value for the fourth position.
CIVector.h
Returns a string representation for a vector.
- (NSString *)stringRepresentation
A string object.
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
CIVector.h
Returns a value from a specific position in a vector.
- (CGFloat)valueAtIndex:(size_t)index
The position in the vector of the value that you want to retrieve.
The value retrieved from the vector or 0
if the position is undefined.
The numbering of elements in a vector begins with zero.
CIVector.h
Returns the value located in the fourth position in a vector.
- (CGFloat)W
The value retrieved from the vector.
CIVector.h
Returns the value located in the first position in a vector.
- (CGFloat)X
The value retrieved from the vector.
CIVector.h
Returns the value located in the second position in a vector.
- (CGFloat)Y
The value retrieved from the vector.
CIVector.h
Returns the value located in the third position in a vector.
- (CGFloat)Z
The value retrieved from the vector.
CIVector.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-12-07)