A blurring effect. More...
Public Member Functions | |
BlurComplexEffect (System *system) noexcept | |
virtual | ~BlurComplexEffect () |
nkGraphics::Texture * | getSourceTexture () const |
nkGraphics::Texture * | getOutputTexture () const |
unsigned int | getKernelRadius () const |
bool | getAlphaEncodesBlurPlanes () const |
bool | getPreserveAlpha () const |
void | setSourceTexture (nkGraphics::Texture *value) |
void | setKernelRadius (unsigned int value) |
void | setAlphaEncodesBlurPlanes (bool value) |
void | setPreserveAlpha (bool value) |
virtual bool | load () override |
virtual void | unload () override |
Public Member Functions inherited from nkAstraeus::ComplexEffect | |
ComplexEffect (COMPLEX_EFFECT_TYPE type) noexcept | |
virtual | ~ComplexEffect () |
nkMemory::StringView | getName () const |
nkGraphics::CompositorNode * | getCompositorNode () const |
COMPLEX_EFFECT_TYPE | getType () const |
void | setName (nkMemory::StringView value) |
void | setCompositorNode (nkGraphics::CompositorNode *value) |
Static Public Member Functions | |
static nkMemory::UniquePtr< BlurComplexEffect > | create (System *system=nullptr) |
A blurring effect.
This effect will blur the source texture, given provided parameters.
|
noexcept |
Default constructor. Alternatively, see BlurComplexEffect::create(), or ComplexEffectManager::createOrRetrieve().
system | The system in which the resource should live. |
|
virtual |
Default destructor.
nkGraphics::Texture* nkAstraeus::BlurComplexEffect::getSourceTexture | ( | ) | const |
nkGraphics::Texture* nkAstraeus::BlurComplexEffect::getOutputTexture | ( | ) | const |
unsigned int nkAstraeus::BlurComplexEffect::getKernelRadius | ( | ) | const |
bool nkAstraeus::BlurComplexEffect::getAlphaEncodesBlurPlanes | ( | ) | const |
bool nkAstraeus::BlurComplexEffect::getPreserveAlpha | ( | ) | const |
void nkAstraeus::BlurComplexEffect::setSourceTexture | ( | nkGraphics::Texture * | value | ) |
Sets the texture to use as input to the effect.
value | The texture to use as input. |
void nkAstraeus::BlurComplexEffect::setKernelRadius | ( | unsigned int | value | ) |
Sets the kernel radius for the blurring operation. Defaults to 5.
value | The radius, in pixel, for the blurring operation. For instance, a radius of 1 will blur using 1 pixel around the reference pixel. |
void nkAstraeus::BlurComplexEffect::setAlphaEncodesBlurPlanes | ( | bool | value | ) |
Sets whether the effect should consider alpha as encoding blurring planes. Blurring planes can be used to isolate and blur sub-parts of an image, independently. For instance, having a part of an image with an alpha of 0.2, and another one of 0.3, will blur together the pixels with alpha 0.2, excluding the 0.3 pixels, and vice versa. Defaults to false.
value | Whether the alpha encodes blurring planes (true) or not (false). |
void nkAstraeus::BlurComplexEffect::setPreserveAlpha | ( | bool | value | ) |
Sets whether the alpha channel should be preserved while blurring, or not. A preserved alpha channel will either get blurred like any other color channel if not encoding a plane, either keep the plane information after blurring. Defaults to false. If not preserved, the effect will overwrite any alpha information with 1 in the output texture.
value | Whether the alpha should be preserved (true) or not (false). |
|
overridevirtual |
Loads the effect and make it ready for rendering. After a successful call, this means the compositor node will be populated with the relevant data.
Implements nkAstraeus::ComplexEffect.
|
overridevirtual |
Unloads the effect and its internal memory. After that, the effect is unusable for rendering. The compositor node specified will be cleaned from all linked operations.
Implements nkAstraeus::ComplexEffect.
|
static |
Creates an instance of the class, and returns ownership over it.
system | The system the resource should live in. If left to nullptr, will seek the singleton instance of the system. |