Class: CIContext
Overview
Class Method Summary (collapse)
-
+ contextWithEAGLContext:
Creates a Core Image context from an EAGL context.
-
+ contextWithEAGLContext:options:
Creates a Core Image context from an EAGL context using the specified options.
-
+ contextWithOptions:
Creates a CPU-based Core Image context using the specified options.
Instance Method Summary (collapse)
-
- createCGImage:fromRect:
Creates a Quartz 2D image from a region of a Core Image image object.
-
- createCGImage:fromRect:format:colorSpace:
Creates a Quartz 2D image from a region of a Core Image image object.
-
- drawImage:inRect:fromRect:
Renders a region of an image to a rectangle in the context destination.
-
- inputImageMaximumSize
Returns the maximum size allowed for any image rendered into the context.
-
- outputImageMaximumSize
Returns the maximum size allowed for any image created by the context.
-
- render:toBitmap:rowBytes:bounds:format:colorSpace:
Renders to the given bitmap.
-
- render:toCVPixelBuffer:
Renders an image into a pixel buffer.
-
- render:toCVPixelBuffer:bounds:colorSpace:
Renders a region of an image into a pixel buffer.
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
+ (CIContext) contextWithEAGLContext(eaglContext)
Creates a Core Image context from an EAGL context. The OpenGL ES context must support OpenGL ES 2.0. All drawing performed using the drawImage:atPoint:fromRect: method or the drawImage:inRect:fromRect: method is rendered directly into the context.
+ (CIContext) contextWithEAGLContext(eaglContext, options:dict)
Creates a Core Image context from an EAGL context using the specified options. The OpenGL ES context must support OpenGL ES 2.0. All drawing performed using the drawImage:atPoint:fromRect: method or the drawImage:inRect:fromRect: method is rendered directly into the context.You should use this method if you want to get real-time performance on a device. One of the advantages of using an EAGL context is that the rendered image stays on the GPU and does not get copied to CPU memory.
+ (CIContext) contextWithOptions(dict)
Creates a CPU-based Core Image context using the specified options. You can create a CPU-based context by providing the key kCIContextUseSoftwareRenderer. A CPU-based context supports larger input and output images than a GPU-based context. It also allows your app to perform processing in the background, such as when saving the rendered output to the Photo Library.GPU rendering is faster than CPU rendering, but the resulting image is not displayed on the device until after is it copied to CPU memory and converted to another image type, such as a UIImage object.
Instance Method Details
- (CGImageRef) createCGImage(im, fromRect:r)
Creates a Quartz 2D image from a region of a Core Image image object. Renders a region of an image into a temporary buffer using the context, then creates and returns a Quartz 2D image with the results.
- (CGImageRef) createCGImage(im, fromRect:r, format:f, colorSpace:cs)
Creates a Quartz 2D image from a region of a Core Image image object. Renders a region of an image into a temporary buffer using the context, then creates and returns a Quartz 2D image with the results.
- (Object) drawImage(im, inRect:dest, fromRect:src)
Renders a region of an image to a rectangle in the context destination. On iOS, this method draws the CIImage object into a renderbuffer for the OpenGL ES context. Use this method only if the CIContext object is created with contextWithEAGLContext: and if you are rendering to a CAEAGLayer.On OS X, you need to be aware of whether the CIContext object is created with a CGContextRef or a CGLContext object. If you create the CIContext object with a CGContextRef, the dimensions of the destination rectangle are in points. If you create the CIContext object with a CGLContext object, the dimensions are in pixels.On iOS 5, this method is synchronous. On iOS 6, this method is asynchronous. For apps linked on iOS 5, this method will continue to be synchronous.
- (CGSize) inputImageMaximumSize
Returns the maximum size allowed for any image rendered into the context. Some contexts limit the maximum size of an image that can be rendered into them. For example, the maximum size might reflect a limitation in the underlying graphics hardware.
- (CGSize) outputImageMaximumSize
Returns the maximum size allowed for any image created by the context. Some contexts limit the maximum size of an image that can be created by them. For example, the maximum size might reflect a limitation in the underlying graphics hardware.
- (Object) render(im, toBitmap:data, rowBytes:rb, bounds:r, format:f, colorSpace:cs)
Renders to the given bitmap.
- (Object) render(image, toCVPixelBuffer:buffer)
Renders an image into a pixel buffer.
- (Object) render(image, toCVPixelBuffer:buffer, bounds:r, colorSpace:cs)
Renders a region of an image into a pixel buffer.