Mask effect renderer class. More...
#include <kanzi/core.ui/effect/mask_effect_renderer2d.hpp>
Public Member Functions | |
void | setChannelWeights (Vector4 weights) |
Sets the channel weights to use to calculate the mask value from the mask texture. More... | |
void | setHeight (optional< float > height) |
Overrides the height of the mask texture. More... | |
void | setHorizontalAlignment (MaskEffect2D::HorizontalAlignment alignment) |
Sets the horizontal alignment of the mask. More... | |
void | setMask (TextureSharedPtr texture) |
Sets the mask texture. More... | |
void | setOffset (Vector2 offset) |
Sets the pixel offset to apply to the mask after stretch, alignment, and scale. More... | |
void | setScale (Vector2 scale) |
Sets the scale to apply to the mask after stretch and alignment. More... | |
void | setScreenSpace (bool enabled) |
Sets whether the screen space mode is enabled. More... | |
void | setStrength (float strength) |
Sets the strength of the mask. More... | |
void | setStretch (MaskEffect2D::Stretch stretch) |
Sets the stretch mode of the mask. More... | |
void | setVerticalAlignment (MaskEffect2D::VerticalAlignment alignment) |
Sets the vertical alignment of the mask. More... | |
void | setWidth (optional< float > width) |
Overrides the width of the mask texture. More... | |
![]() | |
void | beginEffect (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, const Matrix3x3 &worldTransform, Vector2 requiredSize, bool alphaRequired, bool depthRequired, bool stencilRequired) |
Begins the effect. More... | |
void | blitEffect (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, QuadDescription &effectQuad, const Matrix3x3 &transform, const Matrix4x4 *perspectiveMatrix, const Matrix4x4 *projectionMatrix, int blendMode, bool needsClear) |
Blits the effect to the current framebuffer. More... | |
void | endEffect (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager) |
Ends the effect. More... | |
NodeEffect2DSharedPtr | getEffect () const |
Get NodeEffect2D instance where this renderer has been instantiated from. More... | |
size_t | getEffectPassCount () const |
Gets the number of effect passes. More... | |
void | restoreResources () |
Restores resources after the rendering context has been lost. More... | |
virtual | ~NodeEffectRenderer2D () |
Declare NodeEffectRenderer2D as not movable nor copyable. More... | |
Static Public Member Functions | |
static NodeEffectRenderer2DUniquePtr | create (MaskEffect2DSharedPtr maskEffect) |
Creates instances of MaskEffectRenderer2D. More... | |
Additional Inherited Members | |
![]() | |
using | EffectPassContainer = vector< EffectPass > |
Container for effect passes. More... | |
![]() | |
EffectPass & | addEffectPass () |
Adds an effect pass and gets a reference to that pass. More... | |
void | beginInitialEffectPass (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, bool alphaRequired, bool depthRequired, bool stencilRequired) |
Begins the initial effect pass (effect pass at index 0). More... | |
void | blitFinalEffectPass (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, QuadDescription &effectQuad, const Matrix3x3 &transform, const Matrix4x4 *perspectiveMatrix, const Matrix4x4 *projectionMatrix, int blendMode, bool needsClear) |
Blits the final effect pass, whose index is getEffectPassCount() - 1, and handles the perspective transform if necessary. More... | |
void | blitIntermediateEffectPass (int effectPassIndex, Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager) |
Blits the intermediate effect pass. More... | |
void | clearRenderTarget (Renderer3D &renderer, CompositionStack &compositionStack, TextureSharedPtr texture, ColorRGBA clearColor) |
Clears the render target texture with a given color. More... | |
void | clearRenderTarget (Renderer3D &renderer, CompositionStack &compositionStack, NativeFramebufferHandle framebufferHandle, ColorRGBA clearColor) |
Clears the native framebuffer with a given color. More... | |
void | endInitialEffectPass (CompositionStack &compositionStack) |
Ends the initial effect pass, whose index is 0. More... | |
void | finalizeEffectPasses () |
Finalizes the effect passes. More... | |
Vector2 | getEffectInputTexelSize (int effectPassIndex, int inputIndex) |
Gets the texel size of the input effect pass texture in texture coordinates. More... | |
EffectPass & | getEffectPass (int index) |
Gets a reference to the effect pass at a given index. More... | |
int | getLastEffectPassIndex () const |
Gets the index of the last effect pass. More... | |
NodeEffectRenderer2D (NodeEffect2DSharedPtr nodeEffect) | |
Constructor. More... | |
void | releaseEffectPassInputRenderTargets (NodeEffectRenderer2D::EffectPass ¤tEffectPass, CompositionManager *compositionManager) |
Releases those temporary render targets used by input that have EffectPass::Input::releaseRenderTarget set to true. More... | |
void | removeAllEffectPasses () |
Removes all effect passes. More... | |
Mask effect renderer class.
|
static |
Creates instances of MaskEffectRenderer2D.
maskEffect | The MaskEffect2D instance on which this renderer is based. |
void kanzi::MaskEffectRenderer2D::setMask | ( | TextureSharedPtr | texture | ) |
Sets the mask texture.
texture | Texture to use as the mask. |
void kanzi::MaskEffectRenderer2D::setWidth | ( | optional< float > | width | ) |
Overrides the width of the mask texture.
If nullopt uses the width of the texture.
width | Width of the mask or nullopt. |
void kanzi::MaskEffectRenderer2D::setHeight | ( | optional< float > | height | ) |
Overrides the height of the mask texture.
If nullopt uses the height of the texture.
height | Height of the mask or nullopt. |
void kanzi::MaskEffectRenderer2D::setOffset | ( | Vector2 | offset | ) |
Sets the pixel offset to apply to the mask after stretch, alignment, and scale.
offset | The mask pixel offset. |
void kanzi::MaskEffectRenderer2D::setScale | ( | Vector2 | scale | ) |
Sets the scale to apply to the mask after stretch and alignment.
scale | The scale applied to mask. |
void kanzi::MaskEffectRenderer2D::setHorizontalAlignment | ( | MaskEffect2D::HorizontalAlignment | alignment | ) |
Sets the horizontal alignment of the mask.
alignment | The horizontal alignment. |
void kanzi::MaskEffectRenderer2D::setVerticalAlignment | ( | MaskEffect2D::VerticalAlignment | alignment | ) |
Sets the vertical alignment of the mask.
alignment | The vertical alignment. |
void kanzi::MaskEffectRenderer2D::setScreenSpace | ( | bool | enabled | ) |
Sets whether the screen space mode is enabled.
enabled | Screen space mode enabled. |
void kanzi::MaskEffectRenderer2D::setStretch | ( | MaskEffect2D::Stretch | stretch | ) |
Sets the stretch mode of the mask.
stretch | The stretch mode. |
void kanzi::MaskEffectRenderer2D::setChannelWeights | ( | Vector4 | weights | ) |
Sets the channel weights to use to calculate the mask value from the mask texture.
weights | The channel weights in the order of red, green, blue, and alpha. |
void kanzi::MaskEffectRenderer2D::setStrength | ( | float | strength | ) |
Sets the strength of the mask.
strength | The mask strength. |