Kanzi  3.9.6
Kanzi Engine API
kanzi::OutlineEffectRenderer2D Class Reference

Outline effect renderer class. More...

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

Inheritance diagram for kanzi::OutlineEffectRenderer2D:
[legend]

Public Member Functions

ColorRGBA getColor () const
 Gets the outline color. More...
 
Vector2 getContentGradient () const
 Gets the content gradient. More...
 
Vector4 getContentMask () const
 Gets the content mask. More...
 
float getContentOffset () const
 Gets the content offset. More...
 
unsigned int getInnerWidth () const
 Gets the maximum thickness of the outline inside the content area. More...
 
bool getInvertContentMask () const
 Indicates whether the content mask is inverted. More...
 
OutlineEffect2D::OutlineMethod getMethod () const
 Gets the outline calculation method. More...
 
unsigned int getOuterWidth () const
 Gets the maximum thickness of the outline outside the content area. More...
 
TextureSharedPtr getOutlineTexture () const
 Gets the outline texture. More...
 
Vector2 getOutlineTextureSettings () const
 Gets the texture settings. More...
 
Vector2 getSoftness () const
 Gets the outline softness. More...
 
void setColor (ColorRGBA color)
 Sets the outline color at maximum intensity. More...
 
void setContentGradient (Vector2 value)
 Sets the content gradient. More...
 
void setContentMaskParameters (Vector4 mask, float threshold)
 Sets the content masking parameters. More...
 
void setInvertContentMask (bool invert)
 Sets the content mask inverting parameters. More...
 
void setMethod (OutlineEffect2D::OutlineMethod method)
 Sets the outline calculation method. More...
 
void setOutlineTexture (TextureSharedPtr texture)
 Sets the outline texture. More...
 
void setOutlineTextureSettings (Vector2 settings)
 Sets the texture settings. More...
 
void setSoftness (Vector2 softness)
 Sets the softness of the outline. More...
 
void setWidths (unsigned int outerWidth, unsigned int innerWidth)
 Sets the maximum thickness of the outline. More...
 
- Public Member Functions inherited from kanzi::NodeEffectRenderer2D
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 OutlineEffectRenderer2DUniquePtr create (OutlineEffect2DSharedPtr outlineEffect)
 Creates instances of OutlineEffectRenderer2D. More...
 

Protected Member Functions

void beginEffectOverride (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, const Matrix3x3 &worldTransform, Vector2 requiredSize, bool alphaRequired, bool depthRequired, bool stencilRequired) override
 NodeEffectRenderer2D::beginEffectOverride() implementation. More...
 
void blitEffectOverride (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager, QuadDescription &effectQuad, const Matrix3x3 &transform, const Matrix4x4 *perspectiveMatrix, const Matrix4x4 *projectionMatrix, int blendMode, bool needsClear) override
 NodeEffectRenderer2D::blitEffectOverride() implementation. More...
 
void createOutlineEffectPasses ()
 Creates the effect passes. More...
 
void endEffectOverride (Renderer3D &renderer, CompositionStack &compositionStack, CompositionManager *compositionManager) override
 NodeEffectRenderer2D::endEffectOverride() implementation. More...
 
 OutlineEffectRenderer2D (OutlineEffect2DSharedPtr outlineEffect)
 Constructor. More...
 
void restoreResourcesOverride () override
 NodeEffectRenderer2D::restoreResourcesOverride() implementation. More...
 
void validateContentMaskParameters ()
 Prepares the parameters for content masking. More...
 
void validateEffectPasses (Vector2 nodeSize)
 Prepares the effect passes. More...
 
void validateRenderStates ()
 Prepares the render states. More...
 
- Protected Member Functions inherited from kanzi::NodeEffectRenderer2D
EffectPassaddEffectPass ()
 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...
 
EffectPassgetEffectPass (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 &currentEffectPass, 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...
 

Protected Attributes

int m_blitPassIndex
 Index of the blit pass. More...
 
EffectRenderState m_blitRenderState
 Blit render state. More...
 
GlRenderState::HandleType m_boxStepHandle1
 Render state handle. More...
 
GlRenderState::HandleType m_boxStepHandle2
 Render state handle. More...
 
Vector4 m_cachedMask
 Input mask value from the effect. More...
 
bool m_cachedMaskInvert
 Input masking invert value from the effect. More...
 
float m_cachedMaskThreshold
 Input masking threshold value from the effect. More...
 
Vector2 m_cachedNodeSize
 The node size that Kanzi uses when it validates the effect passes. More...
 
ColorRGBA m_color
 Color of the outline. More...
 
GlRenderState::HandleType m_colorHandle
 Render state handle. More...
 
Vector2 m_contentGradient
 Content fade-out gradient. More...
 
GlRenderState::HandleType m_contentGradientHandle
 Render state handle. More...
 
Vector4 m_contentMask
 Content masking vector. More...
 
GlRenderState::HandleType m_contentMaskHandle1
 Render state handle. More...
 
float m_contentOffset
 Content offset value. More...
 
GlRenderState::HandleType m_contentOffsetHandle1
 Render state handle. More...
 
bool m_effectPassesDirty
 Dirty bits from parameters being modified. More...
 
GlRenderState::HandleType m_innerRadiusHandle1
 Render state handle. More...
 
GlRenderState::HandleType m_innerRadiusHandle2
 Render state handle. More...
 
unsigned int m_innerWidth
 Maximum outline thickness inside the content area. More...
 
OutlineEffect2D::OutlineMethod m_method
 Outline calculation method. More...
 
int m_nodePassIndex
 Index of the node pass. More...
 
GlRenderState::HandleType m_outerRadiusHandle1
 Render state handle. More...
 
GlRenderState::HandleType m_outerRadiusHandle2
 Render state handle. More...
 
unsigned int m_outerWidth
 Maximum outline thickness outside the content area. More...
 
TextureSharedPtr m_outlineTexture
 Outline texture. More...
 
GlRenderState::HandleType m_outlineTextureHandle
 Render state handle. More...
 
Vector2 m_outlineTextureSettings
 Texture settings. More...
 
GlRenderState::HandleType m_outlineTextureSettingsHandle
 Render state handle. More...
 
int m_passIndex1
 Index of the first pass. More...
 
int m_passIndex2
 Index of the second pass. More...
 
EffectRenderState m_passRenderState1
 First pass render state. More...
 
EffectRenderState m_passRenderState2
 Second pass render state (optional). More...
 
Vector2 m_softness
 Outline softness. More...
 
GlRenderState::HandleType m_softnessHandle
 Render state handle. More...
 

Additional Inherited Members

- Protected Types inherited from kanzi::NodeEffectRenderer2D
using EffectPassContainer = vector< EffectPass >
 Container for effect passes. More...
 

Detailed Description

Outline effect renderer class.

See also
OutlineEffect2D, NodeEffect2D, NodeEffectPrefab2D, NodeEffectTemplate2D
Since
Kanzi 3.9.5

Constructor & Destructor Documentation

◆ OutlineEffectRenderer2D()

kanzi::OutlineEffectRenderer2D::OutlineEffectRenderer2D ( OutlineEffect2DSharedPtr  outlineEffect)
explicitprotected

Constructor.

Parameters
outlineEffectThe OutlineEffect2D instance on which this renderer is based.

Member Function Documentation

◆ create()

static OutlineEffectRenderer2DUniquePtr kanzi::OutlineEffectRenderer2D::create ( OutlineEffect2DSharedPtr  outlineEffect)
static

Creates instances of OutlineEffectRenderer2D.

Parameters
outlineEffectThe OutlineEffect2D instance on which this renderer is based.
Returns
OutlineEffectRenderer2D instance.

◆ setColor()

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

Sets the outline color at maximum intensity.

Parameters
colorColor of the outline.

◆ getColor()

ColorRGBA kanzi::OutlineEffectRenderer2D::getColor ( ) const
inline

Gets the outline color.

Returns
Color of the outline.

◆ setContentGradient()

void kanzi::OutlineEffectRenderer2D::setContentGradient ( Vector2  value)

Sets the content gradient.

Parameters
valueContent gradient value.

◆ getContentGradient()

Vector2 kanzi::OutlineEffectRenderer2D::getContentGradient ( ) const
inline

Gets the content gradient.

Returns
Content gradient value.

◆ setInvertContentMask()

void kanzi::OutlineEffectRenderer2D::setInvertContentMask ( bool  invert)

Sets the content mask inverting parameters.

Parameters
invertWhether to invert the masking.

◆ getInvertContentMask()

bool kanzi::OutlineEffectRenderer2D::getInvertContentMask ( ) const
inline

Indicates whether the content mask is inverted.

Returns
If the content mask is inverted, true, otherwise false.

◆ setContentMaskParameters()

void kanzi::OutlineEffectRenderer2D::setContentMaskParameters ( Vector4  mask,
float  threshold 
)

Sets the content masking parameters.

Parameters
maskContent masking vector.
thresholdContent masking threshold.

◆ getContentMask()

Vector4 kanzi::OutlineEffectRenderer2D::getContentMask ( ) const
inline

Gets the content mask.

Returns
Content mask value.

◆ getContentOffset()

float kanzi::OutlineEffectRenderer2D::getContentOffset ( ) const
inline

Gets the content offset.

Returns
Content offset value.

◆ setOutlineTexture()

void kanzi::OutlineEffectRenderer2D::setOutlineTexture ( TextureSharedPtr  texture)

Sets the outline texture.

Parameters
textureThe texture to apply to the outline.

◆ getOutlineTexture()

TextureSharedPtr kanzi::OutlineEffectRenderer2D::getOutlineTexture ( ) const
inline

Gets the outline texture.

Returns
Texture used for coloring the outline.

◆ setOutlineTextureSettings()

void kanzi::OutlineEffectRenderer2D::setOutlineTextureSettings ( Vector2  settings)

Sets the texture settings.

Parameters
settingsTexture settings, offset and scale.

◆ getOutlineTextureSettings()

Vector2 kanzi::OutlineEffectRenderer2D::getOutlineTextureSettings ( ) const
inline

Gets the texture settings.

Returns
Texture settings packed into a Vector2, offset and scale.

◆ setMethod()

void kanzi::OutlineEffectRenderer2D::setMethod ( OutlineEffect2D::OutlineMethod  method)

Sets the outline calculation method.

Parameters
methodMethod for calculation.

◆ getMethod()

OutlineEffect2D::OutlineMethod kanzi::OutlineEffectRenderer2D::getMethod ( ) const
inline

Gets the outline calculation method.

Returns
Method for outline calculation.

◆ setWidths()

void kanzi::OutlineEffectRenderer2D::setWidths ( unsigned int  outerWidth,
unsigned int  innerWidth 
)

Sets the maximum thickness of the outline.

Parameters
outerWidthThe maximum thickness of the outer outline in pixels.
innerWidthThe maximum thickness of the inner outline in pixels.

◆ getOuterWidth()

unsigned int kanzi::OutlineEffectRenderer2D::getOuterWidth ( ) const
inline

Gets the maximum thickness of the outline outside the content area.

Returns
Thickness of the outer outline in pixels.

◆ getInnerWidth()

unsigned int kanzi::OutlineEffectRenderer2D::getInnerWidth ( ) const
inline

Gets the maximum thickness of the outline inside the content area.

Returns
Thickness of the inner outline in pixels.

◆ setSoftness()

void kanzi::OutlineEffectRenderer2D::setSoftness ( Vector2  softness)

Sets the softness of the outline.

Parameters
softnessThe softness of the outline as a two-component vector: outer softness, inner softness.

◆ getSoftness()

Vector2 kanzi::OutlineEffectRenderer2D::getSoftness ( ) const
inline

Gets the outline softness.

Returns
The softness of the outline as a two-component vector: outer softness, inner softness.

◆ beginEffectOverride()

void kanzi::OutlineEffectRenderer2D::beginEffectOverride ( Renderer3D renderer,
CompositionStack compositionStack,
CompositionManager compositionManager,
const Matrix3x3 worldTransform,
Vector2  requiredSize,
bool  alphaRequired,
bool  depthRequired,
bool  stencilRequired 
)
overrideprotectedvirtual

◆ endEffectOverride()

void kanzi::OutlineEffectRenderer2D::endEffectOverride ( Renderer3D renderer,
CompositionStack compositionStack,
CompositionManager compositionManager 
)
overrideprotectedvirtual

◆ blitEffectOverride()

void kanzi::OutlineEffectRenderer2D::blitEffectOverride ( Renderer3D renderer,
CompositionStack compositionStack,
CompositionManager compositionManager,
QuadDescription effectQuad,
const Matrix3x3 transform,
const Matrix4x4 perspectiveMatrix,
const Matrix4x4 projectionMatrix,
int  blendMode,
bool  needsClear 
)
overrideprotectedvirtual

◆ restoreResourcesOverride()

void kanzi::OutlineEffectRenderer2D::restoreResourcesOverride ( )
overrideprotectedvirtual

◆ createOutlineEffectPasses()

void kanzi::OutlineEffectRenderer2D::createOutlineEffectPasses ( )
protected

Creates the effect passes.

Kanzi executes this function when the outline method changes. If only outline settings change but the method does not, use validateEffectPasses().

◆ validateContentMaskParameters()

void kanzi::OutlineEffectRenderer2D::validateContentMaskParameters ( )
protected

Prepares the parameters for content masking.

◆ validateEffectPasses()

void kanzi::OutlineEffectRenderer2D::validateEffectPasses ( Vector2  nodeSize)
protected

Prepares the effect passes.

Parameters
nodeSizeSize of the node.

◆ validateRenderStates()

void kanzi::OutlineEffectRenderer2D::validateRenderStates ( )
protected

Prepares the render states.

Member Data Documentation

◆ m_method

OutlineEffect2D::OutlineMethod kanzi::OutlineEffectRenderer2D::m_method
protected

Outline calculation method.

◆ m_passRenderState1

EffectRenderState kanzi::OutlineEffectRenderer2D::m_passRenderState1
protected

First pass render state.

◆ m_boxStepHandle1

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_boxStepHandle1
protected

Render state handle.

◆ m_contentMaskHandle1

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_contentMaskHandle1
protected

Render state handle.

◆ m_contentOffsetHandle1

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_contentOffsetHandle1
protected

Render state handle.

◆ m_innerRadiusHandle1

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_innerRadiusHandle1
protected

Render state handle.

◆ m_outerRadiusHandle1

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_outerRadiusHandle1
protected

Render state handle.

◆ m_passRenderState2

EffectRenderState kanzi::OutlineEffectRenderer2D::m_passRenderState2
protected

Second pass render state (optional).

◆ m_boxStepHandle2

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_boxStepHandle2
protected

Render state handle.

◆ m_innerRadiusHandle2

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_innerRadiusHandle2
protected

Render state handle.

◆ m_outerRadiusHandle2

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_outerRadiusHandle2
protected

Render state handle.

◆ m_blitRenderState

EffectRenderState kanzi::OutlineEffectRenderer2D::m_blitRenderState
protected

Blit render state.

◆ m_contentGradientHandle

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_contentGradientHandle
protected

Render state handle.

◆ m_colorHandle

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_colorHandle
protected

Render state handle.

◆ m_outlineTextureHandle

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_outlineTextureHandle
protected

Render state handle.

◆ m_outlineTextureSettingsHandle

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_outlineTextureSettingsHandle
protected

Render state handle.

◆ m_softnessHandle

GlRenderState::HandleType kanzi::OutlineEffectRenderer2D::m_softnessHandle
protected

Render state handle.

◆ m_cachedMaskInvert

bool kanzi::OutlineEffectRenderer2D::m_cachedMaskInvert
protected

Input masking invert value from the effect.

◆ m_cachedMask

Vector4 kanzi::OutlineEffectRenderer2D::m_cachedMask
protected

Input mask value from the effect.

◆ m_cachedMaskThreshold

float kanzi::OutlineEffectRenderer2D::m_cachedMaskThreshold
protected

Input masking threshold value from the effect.

◆ m_outlineTexture

TextureSharedPtr kanzi::OutlineEffectRenderer2D::m_outlineTexture
protected

Outline texture.

Kanzi applies this texture to the outline and modulates the color values in the texture with the outline color. If nullptr, the outline uses only color.

◆ m_outlineTextureSettings

Vector2 kanzi::OutlineEffectRenderer2D::m_outlineTextureSettings
protected

Texture settings.

Defines the offset and scale of the outline texture.

◆ m_color

ColorRGBA kanzi::OutlineEffectRenderer2D::m_color
protected

Color of the outline.

When the outline texture is set, this color modulates the color values in that texture.

◆ m_outerWidth

unsigned int kanzi::OutlineEffectRenderer2D::m_outerWidth
protected

Maximum outline thickness outside the content area.

◆ m_innerWidth

unsigned int kanzi::OutlineEffectRenderer2D::m_innerWidth
protected

Maximum outline thickness inside the content area.

◆ m_softness

Vector2 kanzi::OutlineEffectRenderer2D::m_softness
protected

Outline softness.

First component is outer softness, second component is inner softness.

◆ m_contentGradient

Vector2 kanzi::OutlineEffectRenderer2D::m_contentGradient
protected

Content fade-out gradient.

Components X and Y determine content falloff outside the border.

◆ m_contentMask

Vector4 kanzi::OutlineEffectRenderer2D::m_contentMask
protected

Content masking vector.

◆ m_contentOffset

float kanzi::OutlineEffectRenderer2D::m_contentOffset
protected

Content offset value.

◆ m_cachedNodeSize

Vector2 kanzi::OutlineEffectRenderer2D::m_cachedNodeSize
protected

The node size that Kanzi uses when it validates the effect passes.

◆ m_nodePassIndex

int kanzi::OutlineEffectRenderer2D::m_nodePassIndex
protected

Index of the node pass.

◆ m_passIndex1

int kanzi::OutlineEffectRenderer2D::m_passIndex1
protected

Index of the first pass.

◆ m_passIndex2

int kanzi::OutlineEffectRenderer2D::m_passIndex2
protected

Index of the second pass.

◆ m_blitPassIndex

int kanzi::OutlineEffectRenderer2D::m_blitPassIndex
protected

Index of the blit pass.

◆ m_effectPassesDirty

bool kanzi::OutlineEffectRenderer2D::m_effectPassesDirty
protected

Dirty bits from parameters being modified.


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