Mac Developer Library

Developer

QuartzCore Framework Reference CISampler Class Reference

Options
Deployment Target:

On This Page
Language:

CISampler

The CISampler class retrieves samples of images for processing by a CIKernel object. A CISampler object defines a coordinate transform, and modes for interpolation and wrapping. You use CISampler objects in conjunction with other Core Image classes, such as CIFilter, CIKernel, and CIFilterShape, to create custom filters.

Inheritance


Conforms To


Import Statement


import QuartzCore @import QuartzCore;

Availability


OS X v10.4 and later
  • Gets the domain of definition (DOD) of the sampler.

    Declaration

    Swift

    func definition() -> CIFilterShape!

    Objective-C

    - (CIFilterShape *)definition

    Return Value

    The filter shape object that contains the DOD.

    Discussion

    The DOD contains all nontransparent pixels produced by referencing the sampler.

    Import Statement

    import QuartzCore

    Availability

    OS X v10.4 and later.

  • Gets the rectangle that specifies the extent of the sampler.

    Declaration

    Swift

    func extent() -> CGRect

    Objective-C

    - (CGRect)extent

    Return Value

    The rectangle that specifies the area outside which the wrap mode set for the sampler is invoked.

    Import Statement

    import QuartzCore

    Availability

    OS X v10.4 and later.

  • Keys for creating a sampler.

    Declaration

    Swift

    var kCISamplerAffineMatrix: NSString! var kCISamplerWrapMode: NSString! var kCISamplerFilterMode: NSString! var kCISamplerColorSpace: NSString!

    Objective-C

    extern NSString *kCISamplerAffineMatrix; extern NSString *kCISamplerWrapMode; extern NSString *kCISamplerFilterMode extern NSString *kCISamplerColorSpace

    Constants

    • kCISamplerAffineMatrix

      kCISamplerAffineMatrix

      The key for an affine matrix. The associated value is an NSArray object ([a b c d tx ty]) that defines the transformation to apply to the sampler.

      Available in OS X v10.4 and later.

    • kCISamplerWrapMode

      kCISamplerWrapMode

      The key for the sampler wrap mode. The wrap mode specifies how Core Image produces pixels that are outside the extent of the sample. Possible values are kCISamplerWrapBlack and kCISamplerWrapClamp.

      Available in OS X v10.4 and later.

    • kCISamplerFilterMode

      kCISamplerFilterMode

      The key for the filtering to use when sampling the image. Possible values are kCISamplerFilterNearest and kCISamplerFilterLinear.

      Available in OS X v10.4 and later.

    • kCISamplerColorSpace

      kCISamplerColorSpace

      The key for the color space to use when sampling the image. The associated value must be an RGB CGColorSpaceRef object. Using this option specifies that samples should be converted to this color space before being passed to a kernel. If not specified, samples will be passed to the kernel in the working color space of the Core Image context used to render the image.

      Available in OS X v10.4 and later.

    Import Statement

  • Values for sampler option keys.

    Declaration

    Swift

    var kCISamplerWrapBlack: NSString! var kCISamplerWrapClamp: NSString! var kCISamplerFilterNearest: NSString! var kCISamplerFilterLinear: NSString!

    Objective-C

    extern NSString *kCISamplerWrapBlack; extern NSString *kCISamplerWrapClamp; extern NSString *kCISamplerFilterNearest; extern NSString *kCISamplerFilterLinear;

    Constants

    • kCISamplerWrapBlack

      kCISamplerWrapBlack

      Pixels are transparent black.

      Available in OS X v10.4 and later.

    • kCISamplerWrapClamp

      kCISamplerWrapClamp

      Coordinates are clamped to the extent.

      Available in OS X v10.4 and later.

    • kCISamplerFilterNearest

      kCISamplerFilterNearest

      Nearest neighbor sampling.

      Available in OS X v10.4 and later.

    • kCISamplerFilterLinear

      kCISamplerFilterLinear

      Bilinear interpolation.

      Available in OS X v10.4 and later.

    Import Statement