Outline effect renderer class. More...
#include <kanzi/core.ui/effect/outline_effect_renderer2d.hpp>
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 | |
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... | |
Additional Inherited Members | |
Protected Types inherited from kanzi::NodeEffectRenderer2D | |
using | EffectPassContainer = vector< EffectPass > |
Container for effect passes. More... | |
Outline effect renderer class.
|
explicitprotected |
Constructor.
outlineEffect | The OutlineEffect2D instance on which this renderer is based. |
|
static |
Creates instances of OutlineEffectRenderer2D.
outlineEffect | The OutlineEffect2D instance on which this renderer is based. |
void kanzi::OutlineEffectRenderer2D::setColor | ( | ColorRGBA | color | ) |
Sets the outline color at maximum intensity.
color | Color of the outline. |
|
inline |
Gets the outline color.
void kanzi::OutlineEffectRenderer2D::setContentGradient | ( | Vector2 | value | ) |
Sets the content gradient.
value | Content gradient value. |
|
inline |
Gets the content gradient.
void kanzi::OutlineEffectRenderer2D::setInvertContentMask | ( | bool | invert | ) |
Sets the content mask inverting parameters.
invert | Whether to invert the masking. |
|
inline |
Indicates whether the content mask is inverted.
void kanzi::OutlineEffectRenderer2D::setContentMaskParameters | ( | Vector4 | mask, |
float | threshold | ||
) |
Sets the content masking parameters.
mask | Content masking vector. |
threshold | Content masking threshold. |
|
inline |
Gets the content mask.
|
inline |
Gets the content offset.
void kanzi::OutlineEffectRenderer2D::setOutlineTexture | ( | TextureSharedPtr | texture | ) |
Sets the outline texture.
texture | The texture to apply to the outline. |
|
inline |
Gets the outline texture.
void kanzi::OutlineEffectRenderer2D::setOutlineTextureSettings | ( | Vector2 | settings | ) |
Sets the texture settings.
settings | Texture settings, offset and scale. |
|
inline |
void kanzi::OutlineEffectRenderer2D::setMethod | ( | OutlineEffect2D::OutlineMethod | method | ) |
Sets the outline calculation method.
method | Method for calculation. |
|
inline |
Gets the outline calculation method.
void kanzi::OutlineEffectRenderer2D::setWidths | ( | unsigned int | outerWidth, |
unsigned int | innerWidth | ||
) |
Sets the maximum thickness of the outline.
outerWidth | The maximum thickness of the outer outline in pixels. |
innerWidth | The maximum thickness of the inner outline in pixels. |
|
inline |
Gets the maximum thickness of the outline outside the content area.
|
inline |
Gets the maximum thickness of the outline inside the content area.
void kanzi::OutlineEffectRenderer2D::setSoftness | ( | Vector2 | softness | ) |
Sets the softness of the outline.
softness | The softness of the outline as a two-component vector: outer softness, inner softness. |
|
inline |
Gets the outline softness.
|
overrideprotectedvirtual |
NodeEffectRenderer2D::beginEffectOverride() implementation.
Implements kanzi::NodeEffectRenderer2D.
|
overrideprotectedvirtual |
NodeEffectRenderer2D::endEffectOverride() implementation.
Implements kanzi::NodeEffectRenderer2D.
|
overrideprotectedvirtual |
NodeEffectRenderer2D::blitEffectOverride() implementation.
Implements kanzi::NodeEffectRenderer2D.
|
overrideprotectedvirtual |
NodeEffectRenderer2D::restoreResourcesOverride() implementation.
Implements kanzi::NodeEffectRenderer2D.
|
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().
|
protected |
Prepares the parameters for content masking.
|
protected |
Prepares the effect passes.
nodeSize | Size of the node. |
|
protected |
Prepares the render states.
|
protected |
Outline calculation method.
|
protected |
First pass render state.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Second pass render state (optional).
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Blit render state.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Render state handle.
|
protected |
Input masking invert value from the effect.
|
protected |
Input mask value from the effect.
|
protected |
Input masking threshold value from the effect.
|
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.
|
protected |
Texture settings.
Defines the offset and scale of the outline texture.
|
protected |
Color of the outline.
When the outline texture is set, this color modulates the color values in that texture.
|
protected |
Maximum outline thickness outside the content area.
|
protected |
Maximum outline thickness inside the content area.
|
protected |
Outline softness.
First component is outer softness, second component is inner softness.
|
protected |
Content fade-out gradient.
Components X and Y determine content falloff outside the border.
|
protected |
Content masking vector.
|
protected |
Content offset value.
|
protected |
The node size that Kanzi uses when it validates the effect passes.
|
protected |
Index of the node pass.
|
protected |
Index of the first pass.
|
protected |
Index of the second pass.
|
protected |
Index of the blit pass.
|
protected |
Dirty bits from parameters being modified.