Composition functionality for 2D nodes. More...
#include <kanzi/core.ui/node/node_visual2d.hpp>
Public Member Functions | |
tuple< QuadDescription, unsigned int > | calculateContentStretch (int contentStretch, Vector2 renderSize, Vector2 contentSize) |
Calculate foreground content stretch. More... | |
void | createBackgroundGeometry (const QuadDescription &quad) |
Create background quad. More... | |
void | createBackgroundGeometry (const QuadDescription &bg, const QuadDescription &fg, unsigned int clippingResult) |
Create the outside area quad. More... | |
BrushRenderer * | getBackgroundBrushRenderer () const |
Get background brush renderer. More... | |
Geometry * | getBackgroundGeometry () const |
Access background geometry. More... | |
Vector2 | getBackgroundTiling () const |
Get background tiling from brush if present. More... | |
BrushRenderer * | getForegroundBrushRenderer () const |
Get foreground brush renderer. More... | |
GeometryQuad * | getForegroundGeometry () const |
Access foreground quad. More... | |
Vector2 | getForegroundTiling () const |
Get foreground tiling from brush if present. More... | |
bool | isBackgroundOpaque () const |
Tell if background brush is present and is opaque. More... | |
bool | isForegroundOpaque () const |
Tell if foreground brush is present and is opaque. More... | |
NodeVisual2D ()=default | |
Default constructor. More... | |
void | renderBackground (Renderer3D &renderer, const Geometry &geometry, const Matrix4x4 &transform) |
Render using background brush. More... | |
void | renderBackground (Renderer3D &renderer, const Geometry &geometry, const Matrix3x3 &transform) |
Render using background brush wrapper. More... | |
void | renderBackground (Renderer3D &renderer, const Matrix4x4 &transform) |
Render using background brush. More... | |
void | renderBackground (Renderer3D &renderer, const Matrix3x3 &transform) |
Render using background brush wrapper. More... | |
void | renderForeground (Renderer3D &renderer, const Matrix4x4 &transform) |
Render using foreground brush. More... | |
void | renderForeground (Renderer3D &renderer, const Matrix3x3 &transform) |
Render using foreground brush wrapper. More... | |
void | resetBackgroundBrush () |
Reset background brush renderer. More... | |
void | resetBackgroundGeometry () |
Reset outside area quad. More... | |
void | resetForegroundBrush () |
Reset foreground brush renderer. More... | |
void | resetForegroundGeometry () |
Reset foreground geometry. More... | |
void | restoreResources () |
Restore resources to GPU, if applicable. More... | |
void | setBackgroundBrush (BrushSharedPtr brush, Node &node) |
Create background brush renderer. More... | |
void | setForegroundBrushRenderer (BrushSharedPtr brush, Node &node) |
Create foreground brush renderer. More... | |
void | setForegroundGeometry (const QuadDescription &quad) |
Set foreground quad with full data. More... | |
void | storeRenderingParameters (float layoutOpacity, bool foregroundOpaquenessHint, bool foregroundTranslucencyHint) |
Store rendering parameters for the brushes. More... | |
void | updateBrushRenderers (bool selfInCompositionTarget) |
Update brush renderers for rendering. More... | |
void | updateContentTexture (TextureSharedPtr texture) |
Update content texture in foreground brush renderer, if it exists. More... | |
Composition functionality for 2D nodes.
|
explicitdefault |
Default constructor.
tuple<QuadDescription, unsigned int> kanzi::NodeVisual2D::calculateContentStretch | ( | int | contentStretch, |
Vector2 | renderSize, | ||
Vector2 | contentSize | ||
) |
Calculate foreground content stretch.
contentStretch | Content stretch mode, of type Node2D::ContentStretch. |
renderSize | Render size. |
contentSize | Content size. |
void kanzi::NodeVisual2D::renderBackground | ( | Renderer3D & | renderer, |
const Geometry & | geometry, | ||
const Matrix4x4 & | transform | ||
) |
Render using background brush.
renderer | Renderer to use. |
geometry | Quad to render. |
transform | Transform for the quad. |
|
inline |
Render using background brush wrapper.
void kanzi::NodeVisual2D::renderBackground | ( | Renderer3D & | renderer, |
const Matrix4x4 & | transform | ||
) |
Render using background brush.
Uses background quad from visual.
renderer | Renderer to use. |
transform | Transform for the quad. |
|
inline |
Render using background brush wrapper.
void kanzi::NodeVisual2D::renderForeground | ( | Renderer3D & | renderer, |
const Matrix4x4 & | transform | ||
) |
Render using foreground brush.
renderer | Renderer to use. |
transform | Transform for the quad. |
|
inline |
Render using foreground brush wrapper.
void kanzi::NodeVisual2D::restoreResources | ( | ) |
Restore resources to GPU, if applicable.
void kanzi::NodeVisual2D::storeRenderingParameters | ( | float | layoutOpacity, |
bool | foregroundOpaquenessHint, | ||
bool | foregroundTranslucencyHint | ||
) |
Store rendering parameters for the brushes.
Kanzi calls this function during updateRender(). If the parameters differ, Kanzi marks the brush renderers dirty. Kanzi updates the brush renderers during rendering based on the composition status.
layoutOpacity | Layout opacity of the node. |
foregroundOpaquenessHint | True if node foreground should use opaque render mode if possible. |
foregroundTranslucencyHint | True if node foreground should use translucent render mode if opaque render mode is not used. |
void kanzi::NodeVisual2D::updateBrushRenderers | ( | bool | selfInCompositionTarget | ) |
Update brush renderers for rendering.
If no settings have changed, this call is a NOP.
selfInCompositionTarget | Whether the node is rendered to a composition target. |
|
inline |
Get background brush renderer.
|
inline |
|
inline |
Reset background brush renderer.
|
inline |
Get foreground brush renderer.
|
inline |
|
inline |
Reset foreground brush renderer.
|
inline |
Access foreground quad.
|
inline |
Set foreground quad with full data.
quad | The quad to set. |
|
inline |
Reset foreground geometry.
|
inline |
Get background tiling from brush if present.
|
inline |
Get foreground tiling from brush if present.
|
inline |
Tell if background brush is present and is opaque.
|
inline |
Tell if foreground brush is present and is opaque.
|
inline |
Create background quad.
Creates a complete background quad.
quad | Quad description. |
|
inline |
Create the outside area quad.
Creates a frame that does not include the foreground area.
bg | Whole background area quad. |
fg | Whole foreground area quad. |
clippingResult | Clipping result. |
|
inline |
Access background geometry.
|
inline |
Reset outside area quad.
|
inline |
Update content texture in foreground brush renderer, if it exists.