Mac Developer Library

Developer

Core Image Reference Collection CIFilterShape Class Reference

Options
Deployment Target:

On This Page
Language:

CIFilterShape

The CIFilterShape class describes the bounding shape of a filter and the domain of definition (DOD) of a filter operation. You use CIFilterShape objects in conjunction with Core Image classes, such as CIFilter, CIKernel, and CISampler, to create custom filters.

  • Creates a filter shape object and initializes it with a rectangle.

    Declaration

    Objective-C

    + (instancetype)shapeWithRect:(CGRect)r

    Parameters

    r

    A rectangle. The filter shape object will contain the smallest integral rectangle specified by this argument.

    Availability

    OS X v10.4 and later.

  • Initializes a filter shape object with a rectangle.

    Declaration

    Swift

    init(rect r: CGRect)

    Objective-C

    - (instancetype)initWithRect:(CGRect)r

    Parameters

    r

    A rectangle. Core Image uses the rectangle specified by integer parts of the values in the CGRect data structure.

    Return Value

    An initialized CIFilterShape object, or nil if the method fails.

    Availability

    OS X v10.4 and later.

  • The extent of the filter shape. (read-only)

    Declaration

    Swift

    var extent: CGRect { get }

    Objective-C

    @property(readonly) CGRect extent

    Discussion

    Extent is a rectangle that describes the filter shape in the working coordinate space with a fixed area.

    Availability

    Available in OS X v10.11 and later.

  • Modifies a filter shape object so that it is inset by the specified x and y values.

    Declaration

    Swift

    func insetByX(_ dx: Int32, y dy: Int32) -> CIFilterShape

    Objective-C

    - (CIFilterShape *)insetByX:(int)dx Y:(int)dy

    Parameters

    dx

    A value that specifies an inset in the x direction.

    dy

    A value that specifies an inset in the y direction.

    Availability

    OS X v10.4 and later.

  • Creates a filter shape object that represents the intersection of the current filter shape and the specified filter shape object.

    Declaration

    Swift

    func intersectWith(_ s2: CIFilterShape) -> CIFilterShape

    Objective-C

    - (CIFilterShape *)intersectWith:(CIFilterShape *)s2

    Parameters

    s2

    A filter shape object.

    Return Value

    The filter shape object that results from the intersection.

    Availability

    OS X v10.4 and later.

  • Creates a filter shape that represents the intersection of the current filter shape and a rectangle.

    Declaration

    Swift

    func intersectWithRect(_ r: CGRect) -> CIFilterShape

    Objective-C

    - (CIFilterShape *)intersectWithRect:(CGRect)rect

    Parameters

    rect

    A rectangle. Core Image uses the rectangle specified by integer parts of the width and height.

    Return Value

    The filter shape that results from the intersection

    Availability

    OS X v10.4 and later.

  • Creates a filter shape that results from applying a transform to the current filter shape.

    Declaration

    Swift

    func transformBy(_ m: CGAffineTransform, interior flag: Bool) -> CIFilterShape

    Objective-C

    - (CIFilterShape *)transformBy:(CGAffineTransform)m interior:(BOOL)flag

    Parameters

    m

    A transform.

    flag

    NOfalse specifies that the new filter shape object can contain all the pixels in the transformed shape (and possibly some that are outside the transformed shape). YEStrue specifies that the new filter shape object can contain a subset of the pixels in the transformed shape (but none of those outside the transformed shape).

    Return Value

    The transformed filter shape object.

    Availability

    OS X v10.4 and later.

  • Creates a filter shape that results from the union of the current filter shape and another filter shape object.

    Declaration

    Swift

    func unionWith(_ s2: CIFilterShape) -> CIFilterShape

    Objective-C

    - (CIFilterShape *)unionWith:(CIFilterShape *)s2

    Parameters

    s2

    A filter shape object.

    Return Value

    The filter shape object that results from the union.

    Availability

    OS X v10.4 and later.

  • Creates a filter shape that results from the union of the current filter shape and a rectangle.

    Declaration

    Swift

    func unionWithRect(_ r: CGRect) -> CIFilterShape

    Objective-C

    - (CIFilterShape *)unionWithRect:(CGRect)rect

    Parameters

    rect

    A rectangle. Core Image uses the rectangle specified by integer parts of the width and height.

    Availability

    OS X v10.4 and later.

    See Also

    – unionWith: