Kanzi 3.9.10
kanzi::MaskEffectRenderer2D Class Reference

Mask effect renderer class. More...

#include <kanzi/core.ui/effect/mask_effect_renderer2d.hpp>

Inheritance diagram for kanzi::MaskEffectRenderer2D:
[legend]

Public Member Functions

void setChannelWeights (Vector4 weights)
 Sets the channel weights to use to calculate the mask value from the mask texture.
 
void setHeight (optional< float > height)
 Overrides the height of the mask texture.
 
void setHorizontalAlignment (MaskEffect2D::HorizontalAlignment alignment)
 Sets the horizontal alignment of the mask.
 
void setMask (TextureSharedPtr texture)
 Sets the mask texture.
 
void setOffset (Vector2 offset)
 Sets the pixel offset to apply to the mask after stretch, alignment, and scale.
 
void setScale (Vector2 scale)
 Sets the scale to apply to the mask after stretch and alignment.
 
void setScreenSpace (bool enabled)
 Sets whether the screen space mode is enabled.
 
void setStrength (float strength)
 Sets the strength of the mask.
 
void setStretch (MaskEffect2D::Stretch stretch)
 Sets the stretch mode of the mask.
 
void setVerticalAlignment (MaskEffect2D::VerticalAlignment alignment)
 Sets the vertical alignment of the mask.
 
void setWidth (optional< float > width)
 Overrides the width of the mask texture.
 
- Public Member Functions inherited from kanzi::NodeEffectRenderer2D
void applyEffect (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, const Matrix3x3 &worldTransform, const CompositionContentRequirements &requirements, TextureSharedPtr sourceContent)
 Applies the effect on the source content provided as texture.
 
void beginEffect (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, const Matrix3x3 &worldTransform, const CompositionContentRequirements &requirements)
 Begins the effect.
 
void blitEffect (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, const QuadDescription &effectQuad, const Matrix3x3 &transform, const Matrix4x4 *perspectiveMatrix, const Matrix4x4 *projectionMatrix, int blendMode, bool needsClear)
 Blits the effect to the current framebuffer.
 
void endEffect (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager)
 Ends the effect.
 
NodeEffect2DSharedPtr getEffect () const
 Get NodeEffect2D instance where this renderer has been instantiated from.
 
size_t getEffectPassCount () const
 Gets the number of effect passes.
 
bool isLayeredOnTop () const
 Whether a compatible effect renders logically on top of its source content.
 
bool isRenderEffectOnlyEnabled () const
 Whether the effect only mode is enabled.
 
void restoreResources ()
 Restores resources after the rendering context has been lost.
 
void setRenderEffectOnly (bool renderEffectOnly)
 Sets the render effect only mode.
 
virtual bool supportsBlitBlendMode (int blendMode)
 Whether the effect is compatible with a given blend mode.
 
virtual ~NodeEffectRenderer2D ()
 Declare NodeEffectRenderer2D as not movable nor copyable.
 

Static Public Member Functions

static NodeEffectRenderer2DUniquePtr create (MaskEffect2DSharedPtr maskEffect)
 Creates instances of MaskEffectRenderer2D.
 

Additional Inherited Members

- Protected Types inherited from kanzi::NodeEffectRenderer2D
using EffectPassContainer
 Container for effect passes.
 
- Protected Member Functions inherited from kanzi::NodeEffectRenderer2D
EffectPassaddEffectPass ()
 Adds an effect pass and gets a reference to that pass.
 
void beginInitialEffectPass (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, const CompositionContentRequirements &requirements)
 Begins the initial effect pass (effect pass at index 0).
 
void blitEffectPass (int effectPassIndex, Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, const QuadDescription &effectQuad, const Matrix3x3 &transform, const Matrix4x4 *perspectiveMatrix, const Matrix4x4 *projectionMatrix, int blendMode, bool needsClear)
 Blits the effect pass and handles the perspective transform if necessary.
 
void blitFinalEffectPass (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, const 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.
 
void blitIntermediateEffectPass (int effectPassIndex, Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager)
 Blits the intermediate effect pass.
 
void clearRenderTarget (Renderer3D &renderer, CompositionStack &compositionStack, NativeFramebufferHandle framebufferHandle, ColorRGBA clearColor)
 Clears the native framebuffer with a given color.
 
void clearRenderTarget (Renderer3D &renderer, CompositionStack &compositionStack, TextureSharedPtr texture, ColorRGBA clearColor)
 Clears the render target texture with a given color.
 
void configureInitialEffectPass (Vector2 sourceContentSize)
 Configures the initial effect pass.
 
void endInitialEffectPass (CompositionStack &compositionStack)
 Ends the initial effect pass, whose index is 0.
 
void finalizeEffectPasses ()
 Finalizes the effect passes.
 
Vector2 getEffectInputTexelSize (int effectPassIndex, int inputIndex)
 Gets the texel size of the input effect pass texture in texture coordinates.
 
EffectPassgetEffectPass (int index)
 Gets a reference to the effect pass at a given index.
 
int getLastEffectPassIndex () const
 Gets the index of the last effect pass.
 
bool isInitialPassRenderTargetTemporary () const
 Whether the initial pass render target is temporary.
 
 NodeEffectRenderer2D (NodeEffect2DSharedPtr nodeEffect)
 Constructor.
 
virtual void onRenderEffectOnlyChanged ()
 Kanzi calls this when the render effect only mode changes.
 
void releaseEffectPassInputRenderTargets (EffectPass &currentEffectPass, CompositionManager *compositionManager)
 Releases those temporary render targets used by input that have EffectPass::Input::releaseRenderTarget set to true.
 
void removeAllEffectPasses ()
 Removes all user-added effect passes, but leaves the internal initial effect pass.
 
void setLayeredOnTop (bool layeredOnTop)
 Sets whether the effect is layered on top of the source content.
 
- Static Protected Attributes inherited from kanzi::NodeEffectRenderer2D
static constexpr int InitialEffectPassIndex
 Effect pass index for the initial pass.
 

Detailed Description

Mask effect renderer class.

See also
MaskEffect2D, NodeEffect2D, NodeEffectPrefab2D, NodeEffectTemplate2D
Since
Kanzi 3.9.0

Member Function Documentation

◆ create()

static NodeEffectRenderer2DUniquePtr kanzi::MaskEffectRenderer2D::create ( MaskEffect2DSharedPtr maskEffect)
static

Creates instances of MaskEffectRenderer2D.

Parameters
maskEffectThe MaskEffect2D instance on which this renderer is based.
Returns
MaskEffectRenderer2D instance.

◆ setMask()

void kanzi::MaskEffectRenderer2D::setMask ( TextureSharedPtr texture)

Sets the mask texture.

Parameters
textureTexture to use as the mask.

◆ setWidth()

void kanzi::MaskEffectRenderer2D::setWidth ( optional< float > width)

Overrides the width of the mask texture.

If nullopt uses the width of the texture.

Parameters
widthWidth of the mask or nullopt.

◆ setHeight()

void kanzi::MaskEffectRenderer2D::setHeight ( optional< float > height)

Overrides the height of the mask texture.

If nullopt uses the height of the texture.

Parameters
heightHeight of the mask or nullopt.

◆ setOffset()

void kanzi::MaskEffectRenderer2D::setOffset ( Vector2 offset)

Sets the pixel offset to apply to the mask after stretch, alignment, and scale.

Parameters
offsetThe mask pixel offset.

◆ setScale()

void kanzi::MaskEffectRenderer2D::setScale ( Vector2 scale)

Sets the scale to apply to the mask after stretch and alignment.

Parameters
scaleThe scale applied to mask.

◆ setHorizontalAlignment()

void kanzi::MaskEffectRenderer2D::setHorizontalAlignment ( MaskEffect2D::HorizontalAlignment alignment)

Sets the horizontal alignment of the mask.

Parameters
alignmentThe horizontal alignment.

◆ setVerticalAlignment()

void kanzi::MaskEffectRenderer2D::setVerticalAlignment ( MaskEffect2D::VerticalAlignment alignment)

Sets the vertical alignment of the mask.

Parameters
alignmentThe vertical alignment.

◆ setScreenSpace()

void kanzi::MaskEffectRenderer2D::setScreenSpace ( bool enabled)

Sets whether the screen space mode is enabled.

Parameters
enabledScreen space mode enabled.

◆ setStretch()

void kanzi::MaskEffectRenderer2D::setStretch ( MaskEffect2D::Stretch stretch)

Sets the stretch mode of the mask.

Parameters
stretchThe stretch mode.

◆ setChannelWeights()

void kanzi::MaskEffectRenderer2D::setChannelWeights ( Vector4 weights)

Sets the channel weights to use to calculate the mask value from the mask texture.

Parameters
weightsThe channel weights in the order of red, green, blue, and alpha.

◆ setStrength()

void kanzi::MaskEffectRenderer2D::setStrength ( float strength)

Sets the strength of the mask.

Parameters
strengthThe mask strength.

The documentation for this class was generated from the following file: