Kanzi 3.9.10
kanzi::ShadowEffectRenderer2D Class Reference

Shadow effect renderer class. More...

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

Inheritance diagram for kanzi::ShadowEffectRenderer2D:
[legend]

Public Member Functions

void setBlurRadius (float radius)
 Sets the pixel radius of the blur to use for the shadow.
 
void setColor (ColorRGBA color)
 Sets the premultiplied color of the shadow.
 
void setQuality (ShadowEffect2D::Quality quality)
 Sets the quality of the shadow.
 
void setShadowBlendMode (optional< int > blendMode)
 Sets the blend mode override used for rendering the shadow.
 
void setShadowOffset (Vector2 offset)
 Sets the 2D offset in pixels for the blurred shadow.
 
void setShadowOnly (bool shadowOnly)
 Sets the shadow-only mode.
 
void setType (ShadowEffect2D::Type type)
 Sets the shadow type.
 
bool supportsBlitBlendMode (int blendMode) override
 NodeEffectRenderer2D::supportsBlitBlendMode() implementation.
 
- 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 ~NodeEffectRenderer2D ()
 Declare NodeEffectRenderer2D as not movable nor copyable.
 

Static Public Member Functions

static ShadowEffectRenderer2DUniquePtr create (ShadowEffect2DSharedPtr shadowEffect)
 Creates instances of ShadowEffectRenderer2D.
 

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.
 
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

Shadow effect renderer class.

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

Member Function Documentation

◆ create()

static ShadowEffectRenderer2DUniquePtr kanzi::ShadowEffectRenderer2D::create ( ShadowEffect2DSharedPtr shadowEffect)
static

Creates instances of ShadowEffectRenderer2D.

Parameters
shadowEffectThe ShadowEffect2D instance on which this renderer is based.
Returns
ShadowEffectRenderer2D instance.

◆ setBlurRadius()

void kanzi::ShadowEffectRenderer2D::setBlurRadius ( float radius)

Sets the pixel radius of the blur to use for the shadow.

Parameters
radiusThe blur radius in pixels.

◆ setShadowOffset()

void kanzi::ShadowEffectRenderer2D::setShadowOffset ( Vector2 offset)

Sets the 2D offset in pixels for the blurred shadow.

Parameters
offsetThe shadow offset in pixels.

◆ setColor()

void kanzi::ShadowEffectRenderer2D::setColor ( ColorRGBA color)

Sets the premultiplied color of the shadow.

Parameters
colorThe shadow color.

◆ setQuality()

void kanzi::ShadowEffectRenderer2D::setQuality ( ShadowEffect2D::Quality quality)

Sets the quality of the shadow.

Parameters
qualityThe quality level.

◆ setType()

void kanzi::ShadowEffectRenderer2D::setType ( ShadowEffect2D::Type type)

Sets the shadow type.

Parameters
typeThe shadow type.

◆ setShadowOnly()

void kanzi::ShadowEffectRenderer2D::setShadowOnly ( bool shadowOnly)

Sets the shadow-only mode.

Parameters
shadowOnlyWhether to enable the shadow-only mode.

◆ setShadowBlendMode()

void kanzi::ShadowEffectRenderer2D::setShadowBlendMode ( optional< int > blendMode)

Sets the blend mode override used for rendering the shadow.

Parameters
blendModeThe blend mode override to use, or nullopt to use the default blend mode.
Since
Kanzi 3.9.8

◆ supportsBlitBlendMode()

bool kanzi::ShadowEffectRenderer2D::supportsBlitBlendMode ( int blendMode)
overridevirtual

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