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.
-
– initInitializes a blur filter with a blur and resolution of 1.0f.
-
+ blurFilterWithBlur:resolution:Factory method.
-
+ blurFilterWithBlur:Factory method.
-
+ blurFilterFactory method.
Drop Shadow
-
+ dropShadowCreates 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
-
+ glowCreates 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)blurFilterDiscussion
Factory method.
Declared In
SPBlurFilter.hblurFilterWithBlur:
Factory method.
+ (instancetype)blurFilterWithBlur:(float)blurDiscussion
Factory method.
Declared In
SPBlurFilter.hblurFilterWithBlur:resolution:
Factory method.
+ (instancetype)blurFilterWithBlur:(float)blur resolution:(float)resolutionDiscussion
Factory method.
Declared In
SPBlurFilter.hdropShadow
Creates a black drop shadow with a distance of 4.0 at a 45 degree angle.
+ (instancetype)dropShadowDiscussion
Creates a black drop shadow with a distance of 4.0 at a 45 degree angle.
Declared In
SPBlurFilter.hdropShadowWithDistance:
Creates a black drop shadow with a specified distance at a 45 degree angle.
+ (instancetype)dropShadowWithDistance:(float)distanceDiscussion
Creates a black drop shadow with a specified distance at a 45 degree angle.
Declared In
SPBlurFilter.hdropShadowWithDistance:angle:
Creates a black drop shadow with a specified distance and angle.
+ (instancetype)dropShadowWithDistance:(float)distance angle:(float)angleDiscussion
Creates a black drop shadow with a specified distance and angle.
Declared In
SPBlurFilter.hdropShadowWithDistance:angle:color:
Creates a drop shadow with a specified distance, angle and color.
+ (instancetype)dropShadowWithDistance:(float)distance angle:(float)angle color:(uint)colorDiscussion
Creates a drop shadow with a specified distance, angle and color.
Declared In
SPBlurFilter.hdropShadowWithDistance: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)alphaDiscussion
Creates a drop shadow with a specified distance, angle, color and alpha.
Declared In
SPBlurFilter.hdropShadowWithDistance: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)blurDiscussion
Creates a drop shadow with a specified distance, angle, color, alpha and blur.
Declared In
SPBlurFilter.hdropShadowWithDistance: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)resolutionDiscussion
Creates a drop shadow with a specified distance, angle, color, alpha, blur and resolution.
Declared In
SPBlurFilter.hglow
Creates a yellow glow.
+ (instancetype)glowDiscussion
Creates a yellow glow.
Declared In
SPBlurFilter.hglowWithColor:
Creates a glow with a specified color.
+ (instancetype)glowWithColor:(uint)colorDiscussion
Creates a glow with a specified color.
Declared In
SPBlurFilter.hglowWithColor:alpha:
Creates a glow with a specified color and alpha.
+ (instancetype)glowWithColor:(uint)color alpha:(float)alphaDiscussion
Creates a glow with a specified color and alpha.
Declared In
SPBlurFilter.hglowWithColor:alpha:blur:
Creates a glow with a specified color, alpha and blur.
+ (instancetype)glowWithColor:(uint)color alpha:(float)alpha blur:(float)blurDiscussion
Creates a glow with a specified color, alpha and blur.
Declared In
SPBlurFilter.hglowWithColor: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)resolutionDiscussion
Creates a glow with a specified color, alpha, blur and resolution.
Declared In
SPBlurFilter.hInstance Methods
init
Initializes a blur filter with a blur and resolution of 1.0f.
- (instancetype)initDiscussion
Initializes a blur filter with a blur and resolution of 1.0f.
Declared In
SPBlurFilter.hinitWithBlur:
Initializes a blur filter with the specified blur and a resolution of 1.0f.
- (instancetype)initWithBlur:(float)blurDiscussion
Initializes a blur filter with the specified blur and a resolution of 1.0f.
Declared In
SPBlurFilter.hinitWithBlur:resolution:
Initializes a blur filter with the specified blur and a resolution. Designated Initializer.
- (instancetype)initWithBlur:(float)blur resolution:(float)resolutionDiscussion
Initializes a blur filter with the specified blur and a resolution. Designated Initializer.
Declared In
SPBlurFilter.hsetUniformColor:
The current uniform color will replace the RGB values of the input color. Pass NO to deactivate the uniform color.
- (void)setUniformColor:(BOOL)enableDiscussion
The current uniform color will replace the RGB values of the input color. Pass NO to deactivate the uniform color.
Declared In
SPBlurFilter.hsetUniformColor: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)colorDiscussion
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.hsetUniformColor: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)alphaDiscussion
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