Mac Developer Library

Developer

Core Image Reference Collection CIImageAccumulator Class Reference

Options
Deployment Target:

On This Page
Language:

CIImageAccumulator

The CIImageAccumulator class enables feedback-based image processing for such things as iterative painting operations or fluid dynamics simulations. You use CIImageAccumulator objects in conjunction with other Core Image classes, such as CIFilter, CIImage, CIVector, and CIContext, to take advantage of the built-in Core Image filters when processing images.

  • Creates an image accumulator with the specified extent and pixel format.

    Declaration

    Objective-C

    + (instancetype)imageAccumulatorWithExtent:(CGRect)extent format:(CIFormat)format

    Parameters

    extent

    A rectangle that specifies the x-value of the rectangle origin, the y-value of the rectangle origin, and the width and height.

    format

    The format and size of each pixel. You must supply a pixel format constant, such as kCIFormatARGB8 (32 bit-per-pixel, fixed-point pixel format) or kCIFormatRGBAf (128 bit-per-pixel, floating-point pixel format). See CIImage Class Reference for more information about pixel format constants.

    Return Value

    The image accumulator object.

    Availability

    OS X v10.4 and later.

  • Creates an image accumulator with the specified extent, pixel format, and color space.

    Declaration

    Objective-C

    + (instancetype)imageAccumulatorWithExtent:(CGRect)extent format:(CIFormat)format colorSpace:(CGColorSpaceRef)colorSpace

    Parameters

    extent

    A rectangle that specifies the x-value of the rectangle origin, the y-value of the rectangle origin, and the width and height.

    format

    The format and size of each pixel. You must supply a pixel format constant, such as kCIFormatARGB8 (32 bit-per-pixel, fixed-point pixel format) or kCIFormatRGBAf (128 bit-per-pixel, floating-point pixel format). See CIImage Class Reference for more information about pixel format constants.

    colorSpace

    A CGColorSpaceRef object describing the color space for the image accumulator.

    Return Value

    The image accumulator object.

    Availability

    OS X v10.7 and later.

  • Initializes an image accumulator with the specified extent and pixel format.

    Declaration

    Swift

    init(extent extent: CGRect, format format: CIFormat)

    Objective-C

    - (instancetype)initWithExtent:(CGRect)extent format:(CIFormat)format

    Parameters

    extent

    A rectangle that specifies the x-value of the rectangle origin, the y-value of the rectangle origin, and the width and height.

    format

    The format and size of each pixel. You must supply a pixel format constant, such askCIFormatARGB8 (32 bit-per-pixel, fixed-point pixel format) or kCIFormatRGBAf (128 bit-per-pixel, floating-point pixel format). See CIImage Class Reference for more information about pixel format constants.

    Return Value

    The initialized image accumulator object.

    Availability

    OS X v10.4 and later.

  • Initializes an image accumulator with the specified extent, pixel format, and color space.

    Declaration

    Swift

    init(extent extent: CGRect, format format: CIFormat, colorSpace colorSpace: CGColorSpace)

    Objective-C

    - (instancetype)initWithExtent:(CGRect)extent format:(CIFormat)format colorSpace:(CGColorSpaceRef)colorSpace

    Parameters

    extent

    A rectangle that specifies the x-value of the rectangle origin, the y-value of the rectangle origin, and the width and height.

    format

    The format and size of each pixel. You must supply a pixel format constant, such askCIFormatARGB8 (32 bit-per-pixel, fixed-point pixel format) or kCIFormatRGBAf (128 bit-per-pixel, floating-point pixel format). See CIImage Class Reference for more information about pixel format constants.

    colorSpace

    A CGColorSpaceRef object describing the color space for the image accumulator.

    Return Value

    The initialized image accumulator object.

    Availability

    OS X v10.7 and later.

  • Sets the contents of the image accumulator to the contents of the specified image object.

    Declaration

    Swift

    func setImage(_ image: CIImage)

    Objective-C

    - (void)setImage:(CIImage *)im

    Parameters

    im

    The image object whose contents you want to assign to the image accumulator.

    Availability

    OS X v10.4 and later.

  • Updates an image accumulator with a subregion of an image object.

    Declaration

    Swift

    func setImage(_ image: CIImage, dirtyRect dirtyRect: CGRect)

    Objective-C

    - (void)setImage:(CIImage *)im dirtyRect:(CGRect)r

    Parameters

    im

    The image object whose contents you want to assign to the image accumulator.

    r

    A rectangle that defines the subregion of the image object that’s changed since the last time you updated the image accumulator. You must guarantee that the new contents differ from the old only within the region specified by the this argument.

    Discussion

    For additional details on using this method, see “Imaging Dynamical Systems” in Core Image Programming Guide.

    Availability

    OS X v10.4 and later.

    See Also

    – setImage:

  • The extent of the image associated with the image accumulator. (read-only)

    Declaration

    Swift

    var extent: CGRect { get }

    Objective-C

    @property(readonly) CGRect extent

    Discussion

    Extent is a rectangle that specifies the size of the image associated with the image accumulator. This rectangle is the size of the complete region of the working coordinate space, and is a fixed area. It specifies the x-value of the rectangle origin, the y-value of the rectangle origin, and the width and height.

    Availability

    Available in OS X v10.4 and later.

  • The pixel format of the image accumulator. (read-only)

    Declaration

    Swift

    var format: CIFormat { get }

    Objective-C

    @property(readonly) CIFormat format

    Discussion

    For applicable values, see Pixel Formats.

    Availability

    Available in OS X v10.4 and later.

  • Returns the current contents of the image accumulator.

    Declaration

    Swift

    func image() -> CIImage

    Objective-C

    - (CIImage *)image

    Return Value

    The image object that represents the current contents of the image accumulator.

    Availability

    OS X v10.4 and later.

  • Resets the accumulator, discarding any pending updates and the current content.

    Declaration

    Swift

    func clear()

    Objective-C

    - (void)clear

    Availability

    Available in OS X v10.5 and later.