SPBlurFilter Class Reference
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
-
– initWithBlur:resolution:
Initializes a blur filter with the specified blur and a resolution. Designated Initializer.
-
– initWithBlur:
Initializes a blur filter with the specified blur and a resolution of 1.0f.
-
– init
Initializes a blur filter with a blur and resolution of 1.0f.
-
+ blurFilterWithBlur:resolution:
Factory method.
-
+ blurFilterWithBlur:
Factory method.
-
+ blurFilter
Factory method.
Drop Shadow
-
+ dropShadow
Creates a black drop shadow with a distance of 4.0 at a 45 degree angle.
-
+ dropShadowWithDistance:
Creates a black drop shadow with a specified distance at a 45 degree angle.
-
+ dropShadowWithDistance:angle:
Creates a black drop shadow with a specified distance and angle.
-
+ dropShadowWithDistance:angle:color:
Creates a drop shadow with a specified distance, angle and color.
-
+ dropShadowWithDistance:angle:color:alpha:
Creates a drop shadow with a specified distance, angle, color and alpha.
-
+ dropShadowWithDistance:angle:color:alpha:blur:
Creates a drop shadow with a specified distance, angle, color, alpha and blur.
-
+ dropShadowWithDistance:angle:color:alpha:blur:resolution:
Creates a drop shadow with a specified distance, angle, color, alpha, blur and resolution.
Glow
-
+ glow
Creates a yellow glow.
-
+ glowWithColor:
Creates a glow with a specified color.
-
+ glowWithColor:alpha:
Creates a glow with a specified color and alpha.
-
+ glowWithColor:alpha:blur:
Creates a glow with a specified color, alpha and blur.
-
+ glowWithColor:alpha:blur:resolution:
Creates a glow with a specified color, alpha, blur and resolution.
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
Properties
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