Inherits from SPFragmentFilter : NSObject
Declared in SPBlurFilter.h

Overview

The SPBlurFilter applies a gaussian blur to an object. The strength of the blur can be set for x- and y-axis separately (always relative to the stage).

A blur filter can also be set up as a drop shadow or glow filter. Use the respective static methods to create such a filter.

For each blur direction, the number of required passes is ceil(blur). blur = 0.5: 1 pass blur = 1.0: 1 pass blur = 1.5: 2 passes blur = 2.0: 2 passes etc.

Tasks

Initialization

Drop Shadow

Glow

Methods

  • – setUniformColor:

    The current uniform color will replace the RGB values of the input color. Pass NO to deactivate the uniform color.

  • – setUniformColor:color:

    The passed color will replace the RGB values of the input color. Pass NO as the first parameter to deactivate the uniform color.

  • – setUniformColor:color:alpha:

    A uniform color will replace the RGB values of the input color, while the alpha value will be multiplied with the given factor. Pass NO as the first parameter to deactivate the uniform color.

Properties

  •   blurX

    The blur factor in x-direction (stage coordinates).

    property
  •   blurY

    The blur factor in y-direction (stage coordinates).

    property

Properties

blurX

The blur factor in x-direction (stage coordinates).

@property (nonatomic, assign) float blurX

Discussion

The blur factor in x-direction (stage coordinates).

Declared In

SPBlurFilter.h

blurY

The blur factor in y-direction (stage coordinates).

@property (nonatomic, assign) float blurY

Discussion

The blur factor in y-direction (stage coordinates).

Declared In

SPBlurFilter.h

Class Methods

blurFilter

Factory method.

+ (instancetype)blurFilter

Discussion

Factory method.

Declared In

SPBlurFilter.h

blurFilterWithBlur:

Factory method.

+ (instancetype)blurFilterWithBlur:(float)blur

Discussion

Factory method.

Declared In

SPBlurFilter.h

blurFilterWithBlur:resolution:

Factory method.

+ (instancetype)blurFilterWithBlur:(float)blur resolution:(float)resolution

Discussion

Factory method.

Declared In

SPBlurFilter.h

dropShadow

Creates a black drop shadow with a distance of 4.0 at a 45 degree angle.

+ (instancetype)dropShadow

Discussion

Creates a black drop shadow with a distance of 4.0 at a 45 degree angle.

Declared In

SPBlurFilter.h

dropShadowWithDistance:

Creates a black drop shadow with a specified distance at a 45 degree angle.

+ (instancetype)dropShadowWithDistance:(float)distance

Discussion

Creates a black drop shadow with a specified distance at a 45 degree angle.

Declared In

SPBlurFilter.h

dropShadowWithDistance:angle:

Creates a black drop shadow with a specified distance and angle.

+ (instancetype)dropShadowWithDistance:(float)distance angle:(float)angle

Discussion

Creates a black drop shadow with a specified distance and angle.

Declared In

SPBlurFilter.h

dropShadowWithDistance:angle:color:

Creates a drop shadow with a specified distance, angle and color.

+ (instancetype)dropShadowWithDistance:(float)distance angle:(float)angle color:(uint)color

Discussion

Creates a drop shadow with a specified distance, angle and color.

Declared In

SPBlurFilter.h

dropShadowWithDistance:angle:color:alpha:

Creates a drop shadow with a specified distance, angle, color and alpha.

+ (instancetype)dropShadowWithDistance:(float)distance angle:(float)angle color:(uint)color alpha:(float)alpha

Discussion

Creates a drop shadow with a specified distance, angle, color and alpha.

Declared In

SPBlurFilter.h

dropShadowWithDistance:angle:color:alpha:blur:

Creates a drop shadow with a specified distance, angle, color, alpha and blur.

+ (instancetype)dropShadowWithDistance:(float)distance angle:(float)angle color:(uint)color alpha:(float)alpha blur:(float)blur

Discussion

Creates a drop shadow with a specified distance, angle, color, alpha and blur.

Declared In

SPBlurFilter.h

dropShadowWithDistance:angle:color:alpha:blur:resolution:

Creates a drop shadow with a specified distance, angle, color, alpha, blur and resolution.

+ (instancetype)dropShadowWithDistance:(float)distance angle:(float)angle color:(uint)color alpha:(float)alpha blur:(float)blur resolution:(float)resolution

Discussion

Creates a drop shadow with a specified distance, angle, color, alpha, blur and resolution.

Declared In

SPBlurFilter.h

glow

Creates a yellow glow.

+ (instancetype)glow

Discussion

Creates a yellow glow.

Declared In

SPBlurFilter.h

glowWithColor:

Creates a glow with a specified color.

+ (instancetype)glowWithColor:(uint)color

Discussion

Creates a glow with a specified color.

Declared In

SPBlurFilter.h

glowWithColor:alpha:

Creates a glow with a specified color and alpha.

+ (instancetype)glowWithColor:(uint)color alpha:(float)alpha

Discussion

Creates a glow with a specified color and alpha.

Declared In

SPBlurFilter.h

glowWithColor:alpha:blur:

Creates a glow with a specified color, alpha and blur.

+ (instancetype)glowWithColor:(uint)color alpha:(float)alpha blur:(float)blur

Discussion

Creates a glow with a specified color, alpha and blur.

Declared In

SPBlurFilter.h

glowWithColor:alpha:blur:resolution:

Creates a glow with a specified color, alpha, blur and resolution.

+ (instancetype)glowWithColor:(uint)color alpha:(float)alpha blur:(float)blur resolution:(float)resolution

Discussion

Creates a glow with a specified color, alpha, blur and resolution.

Declared In

SPBlurFilter.h

Instance Methods

init

Initializes a blur filter with a blur and resolution of 1.0f.

- (instancetype)init

Discussion

Initializes a blur filter with a blur and resolution of 1.0f.

Declared In

SPBlurFilter.h

initWithBlur:

Initializes a blur filter with the specified blur and a resolution of 1.0f.

- (instancetype)initWithBlur:(float)blur

Discussion

Initializes a blur filter with the specified blur and a resolution of 1.0f.

Declared In

SPBlurFilter.h

initWithBlur:resolution:

Initializes a blur filter with the specified blur and a resolution. Designated Initializer.

- (instancetype)initWithBlur:(float)blur resolution:(float)resolution

Discussion

Initializes a blur filter with the specified blur and a resolution. Designated Initializer.

Declared In

SPBlurFilter.h

setUniformColor:

The current uniform color will replace the RGB values of the input color. Pass NO to deactivate the uniform color.

- (void)setUniformColor:(BOOL)enable

Discussion

The current uniform color will replace the RGB values of the input color. Pass NO to deactivate the uniform color.

Declared In

SPBlurFilter.h

setUniformColor:color:

The passed color will replace the RGB values of the input color. Pass NO as the first parameter to deactivate the uniform color.

- (void)setUniformColor:(BOOL)enable color:(uint)color

Discussion

The passed color will replace the RGB values of the input color. Pass NO as the first parameter to deactivate the uniform color.

Declared In

SPBlurFilter.h

setUniformColor:color:alpha:

A uniform color will replace the RGB values of the input color, while the alpha value will be multiplied with the given factor. Pass NO as the first parameter to deactivate the uniform color.

- (void)setUniformColor:(BOOL)enable color:(uint)color alpha:(float)alpha

Discussion

A uniform color will replace the RGB values of the input color, while the alpha value will be multiplied with the given factor. Pass NO as the first parameter to deactivate the uniform color.

Declared In

SPBlurFilter.h