Class: CIVector

Inherits:
NSObject show all

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.

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Class Method Details

+ (CIVector) vectorWithCGAffineTransform(t)

Creates and returns a vector that is initialized with values provided by a CGAffineTransform structure. The six values that comprise the affine transform fill the first six positions of the resulting CIVector object.

Parameters:

Returns:

  • (CIVector)

    A vector initialized with the specified values.

+ (CIVector) vectorWithCGPoint(p)

Creates and returns a vector that is initialized with values provided by a CGPoint structure. The CGPoint structure’s X and Y values are stored in the vector’s X and Y properties.

Parameters:

  • p (CGPoint)

    A point.

Returns:

  • (CIVector)

    A vector initialized with the specified values.

+ (CIVector) vectorWithCGRect(r)

Creates and returns a vector that is initialized with values provided by a CGRect structure. The CGRect structure’s X, Y, height and width values are stored in the vector’s X, Y, Z and W properties.

Parameters:

Returns:

  • (CIVector)

    A vector initialized with the specified values.

+ (CIVector) vectorWithString(representation)

Creates and returns a vector that is initialized with values provided in a string representation. 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

Parameters:

  • representation (String)

    A string that is in one of the formats returned by the stringRepresentation method.

Returns:

+ (CIVector) vectorWithValues(values, count:count)

Creates and returns a vector that is initialized with the specified values.

Parameters:

  • values (const CGFloat)

    The values to initialize the vector with.

  • count (size_t)

    The number of values in the vector.

Returns:

  • (CIVector)

    A vector initialized with the provided values.

+ (CIVector) vectorWithX(x)

Creates and returns a vector that is initialized with one value.

Parameters:

  • x (Float)

    The value to initialize the vector with.

Returns:

  • (CIVector)

    A vector initialized with the specified value.

+ (CIVector) vectorWithX(x, Y:y)

Creates and returns a vector that is initialized with two values.

Parameters:

  • x (Float)

    The value for the first position in the vector.

  • y (Float)

    The value for the second position in the vector.

Returns:

  • (CIVector)

    A vector initialized with the specified values.

+ (CIVector) vectorWithX(x, Y:y, Z:z)

Creates and returns a vector that is initialized with three values.

Parameters:

  • x (Float)

    The value for the first position in the vector.

  • y (Float)

    The value for the second position in the vector.

  • z (Float)

    The value for the third position in the vector.

Returns:

  • (CIVector)

    A vector initialized with the specified values.

+ (CIVector) vectorWithX(x, Y:y, Z:z, W:w)

Creates and returns a vector that is initialized with four values.

Parameters:

  • x (Float)

    The value for the first position in the vector.

  • y (Float)

    The value for the second position in the vector.

  • z (Float)

    The value for the third position in the vector.

  • w (Float)

    The value for the fourth position in the vector.

Returns:

  • (CIVector)

    A vector initialized with the specified values.

Instance Method Details

- (CGAffineTransform) CGAffineTransformValue

Returns the values stored in the CIVector object as an affine transform. The first six values in the vector become the values that comprise the affine transform.

Returns:

- (CGPoint) CGPointValue

Returns the values stored in the CIVector object as a point. The vector’s X and Y property values become the CGPoint structure’s X and Y values.

Returns:

  • (CGPoint)

    A point.

- (CGRect) CGRectValue

Returns the values stored in the CIVector object as an rect. The vector’s X, Y, Z and W property values become the CGRect structure’s X, Y, height and width values.

Returns:

- (size_t) count

Returns the number of items in a vector.

Returns:

  • (size_t)

    The number of items in the vector.

- (Object) initWithCGAffineTransform(r)

Initializes a vector that is initialized with values provided by a CGAffineTransform structure. The six values that comprise the affine transform fill the first six positions of the resulting CIVector object.

Parameters:

Returns:

- (Object) initWithCGPoint(p)

Initializes a vector that is initialized with values provided by a CGPoint structure. The CGPoint structure’s X and Y values are stored in the vector’s X and Y properties.

Parameters:

  • p (CGPoint)

    A point.

Returns:

- (Object) initWithCGRect(r)

Initializes a vector that is initialized with values provided by a CGRect structure. The CGRect structure’s X, Y, height and width values are stored in the vector’s X, Y, Z and W properties.

Parameters:

Returns:

- (Object) initWithString(representation)

Initializes a vector with values provided in a string representation.

Parameters:

  • representation (String)

    A string that is in one of the formats returned by the stringRepresentation method.

Returns:

- (Object) initWithValues(values, count:count)

Initializes a vector with the provided values.

Parameters:

  • values (const CGFloat)

    The values to initialize the vector with.

  • count (size_t)

    The number of values specified by the values argument.

Returns:

- (Object) initWithX(x)

Initializes the first position of a vector with the provided values.

Parameters:

  • x (Float)

    The initialization value.

Returns:

- (Object) initWithX(x, Y:y)

Initializes the first two positions of a vector with the provided values.

Parameters:

  • x (Float)

    The initialization value for the first position.

  • y (Float)

    The initialization value for the second position.

Returns:

- (Object) initWithX(x, Y:y, Z:z)

Initializes the first three positions of a vector with the provided values.

Parameters:

  • x (Float)

    The initialization value for the first position.

  • y (Float)

    The initialization value for the second position.

  • z (Float)

    The initialization value for the third position.

Returns:

- (Object) initWithX(x, Y:y, Z:z, W:w)

Initializes four positions of a vector with the provided values.

Parameters:

  • x (Float)

    The initialization value for the first position.

  • y (Float)

    The initialization value for the second position.

  • z (Float)

    The initialization value for the third position.

  • w (Float)

    The initialization value for the fourth position.

Returns:

- (String) stringRepresentation

Returns a string representation for a vector. 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

Returns:

  • (String)

    A string object.

- (Float) valueAtIndex(index)

Returns a value from a specific position in a vector. The numbering of elements in a vector begins with zero.

Parameters:

  • index (size_t)

    The position in the vector of the value that you want to retrieve.

Returns:

  • (Float)

    The value retrieved from the vector or 0 if the position is undefined.

- (Float) W

Returns the value located in the fourth position in a vector.

Returns:

  • (Float)

    The value retrieved from the vector.

- (Float) X

Returns the value located in the first position in a vector.

Returns:

  • (Float)

    The value retrieved from the vector.

- (Float) Y

Returns the value located in the second position in a vector.

Returns:

  • (Float)

    The value retrieved from the vector.

- (Float) Z

Returns the value located in the third position in a vector.

Returns:

  • (Float)

    The value retrieved from the vector.