C# Класс SparrowSharp.Filters.BlurFilter

The BlurFilter 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 FilterFactory 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.

Наследование: FragmentFilter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BlurFilter ( float blur = 1.0f, float resolution = 1.0f ) : System

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

SetUniformColor ( bool enable, uint color = 0x000000, float alpha = 1.0f ) : void

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

Защищенные методы

Метод Описание
ActivateWithPass ( int pass, Texture texture, Matrix mvpMatrix ) : void
CreatePrograms ( ) : void

Приватные методы

Метод Описание
UpdateMarginsAndPasses ( ) : void
UpdateParamaters ( int pass, int texWidth, int texHeight ) : void

Описание методов

ActivateWithPass() защищенный Метод

protected ActivateWithPass ( int pass, Texture texture, Matrix mvpMatrix ) : void
pass int
texture Sparrow.Textures.Texture
mvpMatrix Matrix
Результат void

BlurFilter() публичный Метод

Initializes a blur filter with the specified blur and a resolution.
public BlurFilter ( float blur = 1.0f, float resolution = 1.0f ) : System
blur float
resolution float
Результат System

CreatePrograms() защищенный Метод

protected CreatePrograms ( ) : void
Результат void

SetUniformColor() публичный Метод

A uniform color will replace the RGB values of the input color, while the alpha value will be multiplied with the given factor. Pass false as the first parameter to deactivate the uniform color.
public SetUniformColor ( bool enable, uint color = 0x000000, float alpha = 1.0f ) : void
enable bool
color uint
alpha float
Результат void