CIImage Class

Definition

Represents a set of instructions to create an image for use by CoreImage.

[Foundation.Register("CIImage", true)]
public class CIImage : Foundation.NSObject, Foundation.INSCopying, Foundation.INSSecureCoding, IDisposable
type CIImage = class
    inherit NSObject
    interface INSCoding
    interface INativeObject
    interface IDisposable
    interface INSCopying
    interface INSSecureCoding
Inheritance
CIImage
Attributes
Implements

Remarks

Unlike CoreGraphics images (CGImage) that are objects that hold the actual image data to be processed, CIImages represents a set of instructions to obtain an image. These recipes are used during the CoreImage filtering, analysis or rendering pipeline to actually create the bitmap representation.

CIImages are either the result of loading an image from disk, an NSData array, a CoreVideo buffer a CoreGraphics image, or the result of processing an image pipeline by CoreImage.

CIImages for example are used when chaining various filters (CIFilter) together and only their abstract representation is passed between the output of one filter and the input to another one. The image might not even reside in the main memory, it could reside entirely on the GPU space as an intermediate step between two filters.

Auto Enhancement Filters

The GetAutoAdjustmentFilters(CIAutoAdjustmentFilterOptions) method can be used to obtain a list of CIImage filters that can be used to correct various problems found in photos.

These typically include:

You can configure which kind of filters you want to get or configure by setting the properties of an CIAutoAdjustmentFilterOptions instance and then calling the appropriate method.


void PrepareFixes (CIImage img)
{
    var opt = new CIAutoAdjustmentFilterOptions () {
    	RedEye = true,
    	AutoAdjustCrop = true
    };
    foreach (var filter in img.GetAutoAdjustmentFilters (opt)) {
    	filter.Image = img;
    	img = filter.OutputImage;
    }
}

Constructors

CIImage(AVDepthData)
CIImage(AVDepthData, NSDictionary)
CIImage(AVPortraitEffectsMatte)
CIImage(AVPortraitEffectsMatte, NSDictionary)
CIImage(CGImage)

Initializes a CoreImage Image from a CoreGraphics bitmap representation

CIImage(CGImage, CIImageInitializationOptionsWithMetadata)

Initializes a CoreImage Image from a CoreGraphics bitmap representation

CIImage(CGImage, NSDictionary)

Initializes a CoreImage Image from a CoreGraphics bitmap representation

CIImage(CGLayer)
CIImage(CGLayer, CIImageInitializationOptions)
CIImage(CGLayer, NSDictionary)
CIImage(CIColor)

Creates an image with infinite dimensions that is filled with the specified color.

CIImage(CVImageBuffer)

Initializes a CoreImage image from the contents of the specified CoreVideo image buffer.

CIImage(CVImageBuffer, CIImageInitializationOptions)

Initializes a CoreImage image from the contents of the specified CoreVideo image buffer.

CIImage(CVImageBuffer, NSDictionary)
CIImage(CVImageBuffer, NSDictionary<NSString,NSObject>)

Constructs a CIImage using the options in dict.

CIImage(CVPixelBuffer)

Constructs a CIImage with the supplied buffer data.

CIImage(CVPixelBuffer, CIImageInitializationOptions)

Constructs a CIImage using options.

CIImage(CVPixelBuffer, NSDictionary)

Constructs a CIImage from the data in buffer, applying the options specified in dict.

CIImage(ICIImageProvider, nuint, nuint, CIFormat, CGColorSpace, CIImageProviderOptions)
CIImage(IMTLTexture, NSDictionary)

Constructs a CIImage using the options.

CIImage(Int32, CGSize, Boolean, CGColorSpace)
CIImage(IntPtr)

A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

CIImage(IOSurface)
CIImage(IOSurface, CIImageInitializationOptions)
CIImage(IOSurface, NSDictionary)
CIImage(NSCoder)

A constructor that initializes the object from the data stored in the unarchiver object.

CIImage(NSData)

Creates a new CIImage from the specified data. The image data must be premultiplied.

CIImage(NSData, CIImageInitializationOptionsWithMetadata)

Creates a new CIImage from the specified data. The image data must be premultiplied.

CIImage(NSData, nint, CGSize, Int32, CGColorSpace)
CIImage(NSData, NSDictionary)

Creates a new CIImage from the specified data. The image data must be premultiplied.

CIImage(NSImageRep)
CIImage(NSObjectFlag)

Constructor to call on derived classes to skip initialization and merely allocate the object.

CIImage(NSUrl)

Initializes a CoreImage image from the contents of the file pointed by the specified url.

CIImage(NSUrl, CIImageInitializationOptions)

Initializes a CoreImage image from the contents of the file pointed by the specified url.

CIImage(NSUrl, NSDictionary)

Initializes a CoreImage image from the contents of the file pointed by the specified url.

CIImage(UIImage)

Initializes a CoreImage image from a UIKit image.

CIImage(UIImage, CIImageInitializationOptions)

Initializes a CoreImage image from a UIKit image.

CIImage(UIImage, NSDictionary)

Initializes a CoreImage image from a UIKit image.

Properties

CGImage

Copies the CIImage into a new CGImage.

Class (Inherited from NSObject)
ClassHandle

The handle for this class.

ColorSpace
DebugDescription

A developer-meaningful description of this object.

(Inherited from NSObject)
Definition
DepthData
Description

Description of the object, the Objective-C version of ToString.

(Inherited from NSObject)
EmptyImage

The empty image.

Extent

Returns the extent of the image.

FormatA16

Represents the value associated with the constant kCIFormatA16.

FormatA8

Represents the value associated with the constant kCIFormatA8.

FormatABGR8

Represents the value associated with the constant kCIFormatABGR8.

FormatAf

Represents the value associated with the constant kCIFormatAf.

FormatAh

Represents the value associated with the constant kCIFormatAh.

FormatARGB8

Represents the value associated with the constant kCIFormatARGB8

FormatBGRA8

Represents the value associated with the constant kCIFormatBGRA8

FormatL16
FormatL8
FormatLA16
FormatLA8
FormatLAf
FormatLAh
FormatLf
FormatLh
FormatR16

Represents the value associated with the constant kCIFormatR16.

FormatR8

Represents the value associated with the constant kCIFormatR8.

FormatRf

Represents the value associated with the constant kCIFormatRf.

FormatRG16

Represents the value associated with the constant kCIFormatRG16.

FormatRG8

Represents the value associated with the constant kCIFormatRG8.

FormatRGBA16
FormatRGBA8

Represents the value associated with the constant kCIFormatRGBA8

FormatRGBAf

Represents the value associated with the constant kCIFormatRGBAf

FormatRGBAh

Represents the value associated with the constant kCIFormatRGBAh

FormatRGf

Represents the value associated with the constant kCIFormatRGf.

FormatRGh

Represents the value associated with the constant kCIFormatRGh.

FormatRh

Represents the value associated with the constant kCIFormatRh.

Handle

Handle (pointer) to the unmanaged object representation.

(Inherited from NSObject)
IsDirectBinding (Inherited from NSObject)
IsProxy (Inherited from NSObject)
PixelBuffer

The image data, as a CVPixelBuffer.

PortraitEffectsMatte
Properties

Gets a collection of metadata for this CIImage.

RetainCount

Returns the current Objective-C retain count for the object.

(Inherited from NSObject)
Self (Inherited from NSObject)
Superclass (Inherited from NSObject)
SuperHandle

Handle used to represent the methods in the base class for this NSObject.

(Inherited from NSObject)
Url

If not null, the URL from which the image was loaded.

Zone (Inherited from NSObject)

Methods

AddObserver(NSObject, NSString, NSKeyValueObservingOptions, IntPtr)

Registers an object for being observed externally (using NSString keyPath).   Observed changes are dispatched to the observer’s object ObserveValue(NSString, NSObject, NSDictionary, IntPtr) method.

(Inherited from NSObject)
AddObserver(NSObject, String, NSKeyValueObservingOptions, IntPtr)

Registers an object for being observed externally (using string keyPath).   Observed changes are dispatched to the observer’s object ObserveValue(NSString, NSObject, NSDictionary, IntPtr) method.

(Inherited from NSObject)
AddObserver(NSString, NSKeyValueObservingOptions, Action<NSObservedChange>)

Registers an object for being observed externally using an arbitrary method.

(Inherited from NSObject)
AddObserver(String, NSKeyValueObservingOptions, Action<NSObservedChange>)

Registers an object for being observed externally using an arbitrary method.

(Inherited from NSObject)
AwakeFromNib()

Called after the object has been loaded from the nib file. Overriders must call base.AwakeFromNib().

(Inherited from NSObject)
BeginInvokeOnMainThread(Action) (Inherited from NSObject)
BeginInvokeOnMainThread(Selector, NSObject)

Invokes asynchrously the specified code on the main UI thread.

(Inherited from NSObject)
Bind(NSString, NSObject, String, NSDictionary) (Inherited from NSObject)
Bind(String, NSObject, String, NSDictionary) (Inherited from NSObject)
BindingInfo(String) (Inherited from NSObject)
BindingOptionDescriptions(String) (Inherited from NSObject)
BindingValueClass(String) (Inherited from NSObject)
CommitEditing() (Inherited from NSObject)
CommitEditing(NSObject, Selector, IntPtr) (Inherited from NSObject)
ConformsToProtocol(IntPtr)

Invoked to determine if this object implements the specified protocol.

(Inherited from NSObject)
Copy()

Performs a copy of the underlying Objective-C object.

(Inherited from NSObject)
Copy(NSZone)

Performs a copy of the underlying Objective-C object.

CreateByApplyingGaussianBlur(Double)

Creates a new CIImage by applying a Gaussian blur with the provided sigma.

CreateByApplyingOrientation(CGImagePropertyOrientation)
CreateByClamping(CGRect)

Creates a new CIImage of infinite extent by cropping this CIImage to the rect and then extending the pixels at the edges to infinity.

CreateByClampingToExtent()

Creates a new image by clamping the current image to the rectangle that is defined by its Extent property.

CreateByColorMatchingColorSpaceToWorkingSpace(CGColorSpace)

Creates a new CGImage by matching colors from colorSpace into the working color space.

CreateByColorMatchingWorkingSpaceToColorSpace(CGColorSpace)

Creates a new CGImage by matching colors from the working space into colors in the specified colorSpace.

CreateByCompositingOverImage(CIImage)

Creates a new image by compositing this CIImage over dest.

CreateByFiltering(String)
CreateByFiltering(String, NSDictionary)

Creates a new image by applying filterName to this CIImage.

CreateByInsertingIntermediate()
CreateByInsertingIntermediate(Boolean)
CreateByPremultiplyingAlpha()

Creates a new image whose RGB values are created by multiplying this image's RGB values by this image's alpha value.

CreateBySamplingLinear()
CreateBySamplingNearest()
CreateBySettingAlphaOne(CGRect)

Creates a new image by copying this, setting the alpha of pixels within extent to 1.0 and setting those outside to 0.0.

CreateBySettingProperties(NSDictionary)

Creates a new CIImage by copying this, and applying the properties.

CreateByUnpremultiplyingAlpha()

Creates a new image whose RGB values are created by dividing this image's RGB values by this image's alpha value.

CreateWithOrientation(CIImageOrientation)

Creates a new image by applying the orientation to this CIImage.

DangerousAutorelease() (Inherited from NSObject)
DangerousRelease() (Inherited from NSObject)
DangerousRetain() (Inherited from NSObject)
DidChange(NSKeyValueChange, NSIndexSet, NSString)

Indicates a change occurred to the indexes for a to-many relationship.

(Inherited from NSObject)
DidChange(NSString, NSKeyValueSetMutationKind, NSSet) (Inherited from NSObject)
DidChangeValue(String)

Indicates that a change occurred on the specified key.

(Inherited from NSObject)
Dispose()

Releases the resources used by the NSObject object.

(Inherited from NSObject)
Dispose(Boolean)

Releases the resources used by the NSObject object.

(Inherited from NSObject)
DoesNotRecognizeSelector(Selector)

Indicates that this object does not recognize the specified selector.

(Inherited from NSObject)
Draw(CGPoint, CGRect, NSCompositingOperation, nfloat)
Draw(CGRect, CGRect, NSCompositingOperation, nfloat)
EncodeTo(NSCoder)

Encodes the state of the object on the provided encoder

Equals(NSObject) (Inherited from NSObject)
Equals(Object) (Inherited from NSObject)
ExposedBindings() (Inherited from NSObject)
FromCGImage(CGImage)

Creates an CIImage from a CGImage.

FromCGImage(CGImage, CGColorSpace)

Creates a CIImage in colorspace from a CGImage.

FromCGImage(CGImage, CIImageInitializationOptionsWithMetadata)

Creates a CIImage from a CGImage with the specified options.

FromCGImage(CGImage, NSDictionary)

Creates a CIImage from a CGImage with the specified metadata, d.

FromData(NSData)

Creates a new image from the specified data.

FromData(NSData, CIImageInitializationOptionsWithMetadata)

Creates a new image from the specified data and options.

FromData(NSData, nint, CGSize, CIFormat, CGColorSpace)
FromData(NSData, NSDictionary)

Creates a new image from the specified data and d options dictionary.

FromDepthData(AVDepthData)
FromDepthData(AVDepthData, NSDictionary)
FromImageBuffer(CVImageBuffer)

Creates a new CIImage based on the data in the imageBuffer.

FromImageBuffer(CVImageBuffer, CIImageInitializationOptions)

Creates a new CIImage based on the data in the imageBuffer and with the specified options.

FromImageBuffer(CVImageBuffer, NSDictionary)
FromImageBuffer(CVImageBuffer, NSDictionary<NSString,NSObject>)

Creates a new CIImage based on the data in imageBuffer and applying the options in dict.

FromImageBuffer(CVPixelBuffer)

Creates a new image from the data that is contained in buffer.

FromImageBuffer(CVPixelBuffer, CIImageInitializationOptions)

Creates a new image from the data that is contained in buffer by using the specified options.

FromImageBuffer(CVPixelBuffer, NSDictionary)

Creates a new image from the data that is contained in buffer by using the options that are specified in dict.

FromLayer(CGLayer)
FromLayer(CGLayer, NSDictionary)
FromMetalTexture(IMTLTexture, NSDictionary<NSString,NSObject>)

Creates a new CIImage from texture, applying the creation options specified in options.

FromPortraitEffectsMatte(AVPortraitEffectsMatte)
FromPortraitEffectsMatte(AVPortraitEffectsMatte, NSDictionary)
FromProvider(ICIImageProvider, nuint, nuint, CIFormat, CGColorSpace, CIImageProviderOptions)
FromSurface(IOSurface)
FromSurface(IOSurface, CIImageInitializationOptions)
FromSurface(IOSurface, NSDictionary)
FromUrl(NSUrl)

Creates a new CIImage from url.

FromUrl(NSUrl, CIImageInitializationOptions)

Creates a new CIImage from url by using the the specified options.

FromUrl(NSUrl, NSDictionary)

Creates a new CIImage from url by using the options that are specified in d.

GetAutoAdjustmentFilters()

Gets the filters that are required to perform some common image correction steps to an image.

GetAutoAdjustmentFilters(CIAutoAdjustmentFilterOptions)

Gets the filters requires to perform some common image correction steps to an image.

GetBindingInfo(NSString) (Inherited from NSObject)
GetBindingOptionDescriptions(NSString) (Inherited from NSObject)
GetBindingValueClass(NSString) (Inherited from NSObject)
GetDictionaryOfValuesFromKeys(NSString[])

Retrieves the values of the specified keys.

(Inherited from NSObject)
GetHashCode()

Generates a hash code for the current instance.

(Inherited from NSObject)
GetImageTransform(CGImagePropertyOrientation)
GetImageTransform(CIImageOrientation)

Gets a transformation that results in orientation.

GetMethodForSelector(Selector) (Inherited from NSObject)
GetNativeField(String) (Inherited from NSObject)
GetNativeHash() (Inherited from NSObject)
GetRegionOfInterest(CIImage, CGRect)

Gets a rectangle that describes the region in im, an image in the transformation list, that corresponds to r in this CIImage.

ImageByApplyingTransform(CGAffineTransform)

Returns a new image that results from applying the affine transform matrix to this CIImage.

ImageByCroppingToRect(CGRect)

Creates a new image by cropping this CIImage to the rectangle r.

ImageWithColor(CIColor)

Creates a new single-color image.

ImageWithTexture(UInt32, CGSize, Boolean, CGColorSpace)
Init() (Inherited from NSObject)
InitializeHandle(IntPtr) (Inherited from NSObject)
InitializeHandle(IntPtr, String) (Inherited from NSObject)
Invoke(Action, Double) (Inherited from NSObject)
Invoke(Action, TimeSpan) (Inherited from NSObject)
InvokeOnMainThread(Action) (Inherited from NSObject)
InvokeOnMainThread(Selector, NSObject)

Invokes synchrously the specified code on the main UI thread.

(Inherited from NSObject)
IsEqual(NSObject) (Inherited from NSObject)
IsKindOfClass(Class) (Inherited from NSObject)
IsMemberOfClass(Class) (Inherited from NSObject)
MarkDirty()

Promotes a regular peer object (IsDirectBinding is true) into a toggleref object.

(Inherited from NSObject)
MutableCopy()

Creates a mutable copy of the specified NSObject.

(Inherited from NSObject)
ObjectDidEndEditing(NSObject) (Inherited from NSObject)
ObserveValue(NSString, NSObject, NSDictionary, IntPtr)

Indicates that the value at the specified keyPath relative to this object has changed.

(Inherited from NSObject)
PerformSelector(Selector) (Inherited from NSObject)
PerformSelector(Selector, NSObject) (Inherited from NSObject)
PerformSelector(Selector, NSObject, Double)

Invokes the selector on the current instance and if the obj is not null, it passes this as its single parameter.

(Inherited from NSObject)
PerformSelector(Selector, NSObject, Double, NSString[]) (Inherited from NSObject)
PerformSelector(Selector, NSObject, NSObject) (Inherited from NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean) (Inherited from NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean, NSString[]) (Inherited from NSObject)
PrepareForInterfaceBuilder() (Inherited from NSObject)
RemoveObserver(NSObject, NSString)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath.

(Inherited from NSObject)
RemoveObserver(NSObject, NSString, IntPtr)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath and context.

(Inherited from NSObject)
RemoveObserver(NSObject, String)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath.

(Inherited from NSObject)
RemoveObserver(NSObject, String, IntPtr)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath and context.

(Inherited from NSObject)
RespondsToSelector(Selector)

Whether this object recognizes the specified selector.

(Inherited from NSObject)
SetNativeField(String, NSObject) (Inherited from NSObject)
SetNilValueForKey(NSString)

Sets the value of the specified key to null.

(Inherited from NSObject)
SetValueForKey(NSObject, NSString)

Sets the value of the property specified by the key to the specified value.

(Inherited from NSObject)
SetValueForKeyPath(IntPtr, NSString)

A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

(Inherited from NSObject)
SetValueForKeyPath(NSObject, NSString)

Sets the value of a property that can be reached using a keypath.

(Inherited from NSObject)
SetValueForUndefinedKey(NSObject, NSString)

Indicates an attempt to write a value to an undefined key. If not overridden, raises an NSUndefinedKeyException.

(Inherited from NSObject)
SetValuesForKeysWithDictionary(NSDictionary)

Sets the values of this NSObject to those in the specified dictionary.

(Inherited from NSObject)
ToString()

Returns a string representation of the value of the current instance.

(Inherited from NSObject)
Unbind(NSString) (Inherited from NSObject)
Unbind(String) (Inherited from NSObject)
ValueForKey(NSString)

Returns the value of the property associated with the specified key.

(Inherited from NSObject)
ValueForKeyPath(NSString)

Returns the value of a property that can be reached using a keypath.

(Inherited from NSObject)
ValueForUndefinedKey(NSString)

Indicates an attempt to read a value of an undefined key. If not overridden, raises an NSUndefinedKeyException.

(Inherited from NSObject)
WillChange(NSKeyValueChange, NSIndexSet, NSString)

Indicates that the values of the specified indices in the specified key are about to change.

(Inherited from NSObject)
WillChange(NSString, NSKeyValueSetMutationKind, NSSet) (Inherited from NSObject)
WillChangeValue(String)

Indicates that the value of the specified key is about to change.

(Inherited from NSObject)

Operators

Implicit(CGImage to CIImage)

Implicit constructor that wraps a CGImage as a CIImage.

Extension Methods

ObjectDidBeginEditing(NSObject, INSEditor)
ObjectDidEndEditing(NSObject, INSEditor)
GetValidModes(NSObject, NSFontPanel)
ValidateToolbarItem(NSObject, NSToolbarItem)
GetDebugDescription(INSObjectProtocol)
AcceptsPreviewPanelControl(NSObject, QLPreviewPanel)
BeginPreviewPanelControl(NSObject, QLPreviewPanel)
EndPreviewPanelControl(NSObject, QLPreviewPanel)
GetAccessibilityCustomRotors(NSObject)

Gets the array of UIAccessibilityCustomRotor objects appropriate for this object.

SetAccessibilityCustomRotors(NSObject, UIAccessibilityCustomRotor[])

Sets the array of UIAccessibilityCustomRotor objects appropriate for this object.

Applies to

See also