Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

CISampler Class Reference

Inherits from
Conforms to
Framework
Library/Frameworks/QuartzCore.framework
Availability
Mac OS X v10.4 and later
Companion guide
Declared in
CISampler.h

Overview

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.

Tasks

Creating a Sampler

Initializing a Sampler

Getting Information About the Sampler Object

Class Methods

samplerWithImage:

Creates and returns a sampler that references an image.

+ (CISampler *)samplerWithImage:(CIImage *)im

Parameters
im

The image that you want the sampler to reference.

Return Value

A sampler object that references the image specified by the im argument.

Availability
See Also
Declared In
CISampler.h

samplerWithImage:keysAndValues:

Creates and returns a sampler that references an image using options specified as key-value pairs.

+ (CISampler *)samplerWithImage:(CIImage *)im keysAndValues:key0, ...

Parameters
im

The image that you want the sampler to reference.

key0

A list of key-value pairs that represent options. Each key needs to be followed by that appropriate value. You can supply one or more key-value pairs. Use nil to specify the end of the key-value options. See “Sampler Option Keys”.

Return Value

A sampler that references the image specified by the im argument and uses the specified options.

Availability
See Also
Declared In
CISampler.h

samplerWithImage:options:

Creates and returns a sampler that references an image using options specified in a dictionary.

+ (CISampler *)samplerWithImage:(CIImage *)im options:(NSDictionary *)dict

Parameters
im

The image that you want the sampler to reference.

dict

A dictionary that contains options specified as key-value pairs. See “Sampler Option Keys”.

Return Value

A sampler that references the image specified by the im argument and uses the options specified in the dictionary.

Availability
See Also
Declared In
CISampler.h

Instance Methods

definition

Gets the domain of definition (DOD) of the sampler.

- (CIFilterShape *)definition

Return Value

The filter shape object that contains the DOD.

Discussion

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

Availability
Declared In
CISampler.h

extent

Gets the rectangle that specifies the extent of the sampler.

- (CGRect)extent

Return Value

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

Availability
Declared In
CISampler.h

initWithImage:

Initializes a sampler with an image object.

- (id)initWithImage:(CIImage *)im

Parameters
im

The image object to initialize the sampler with.

Availability
See Also
Declared In
CISampler.h

initWithImage:keysAndValues:

Initializes the sampler with an image object using options specified as key-value pairs.

- (id)initWithImage:(CIImage *)im keysAndValues:key0, ...

Parameters
im

The image object to initialize the sampler with.

key0

A list of key-value pairs that represent options. Each key needs to be followed by that appropriate value. You can supply one or more key-value pairs. Use nil to specify the end of the key-value options. See “Sampler Option Keys”.

Availability
See Also
Declared In
CISampler.h

initWithImage:options:

Initializes the sampler with an image object using options specified in a dictionary.

- (id)initWithImage:(CIImage *)im options:(NSDictionary *)dict

Parameters
im

The image to initialize the sampler with.

dict

A dictionary that contains options specified as key-value pairs. See “Sampler Option Keys”.

Availability
See Also
Declared In
CISampler.h

Constants

Sampler Option Keys

Keys for creating a sampler.

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

Constants
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.

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.

kCISamplerFilterMode

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

Declared In
CISampler.h

Sampler Option Values

Values for sampler option keys.

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

Constants
kCISamplerWrapBlack

Pixels are transparent black.

kCISamplerWrapClamp

Coordinates are clamped to the extent.

kCISamplerFilterNearest

Nearest neighbor sampling.

kCISamplerFilterLinear

Bilinear interpolation.

Declared In
CISampler.h

Next Page > Hide TOC


Last updated: 2006-12-07




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice