Composition functionality for 2D nodes. More...
#include <kanzi/core.ui/node/node_visual2d.hpp>
Public Member Functions | |
NodeVisual2D () | |
Constructor. More... | |
tuple< QuadDescription, unsigned int > | calculateContentStretch (int contentStretch, Vector2 renderSize, Vector2 contentSize) |
Calculate foreground content stretch. 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 | restoreResources () |
Restore resources to GPU, if applicable. More... | |
void | updateRender (float layoutOpacity, bool selfInCompositionTarget, bool foregroundOpaquenessHint, bool translucencyHint) |
Run updateRender() on foreground and background brush elements. More... | |
BrushRenderer * | getBackgroundBrushRenderer () const |
Get background brush renderer. More... | |
void | setBackgroundBrush (BrushSharedPtr brush, Node &node) |
Create background brush renderer. More... | |
void | resetBackgroundBrush () |
Reset background brush renderer. More... | |
BrushRenderer * | getForegroundBrushRenderer () const |
Get foreground brush renderer. More... | |
void | setForegroundBrushRenderer (BrushSharedPtr brush, Node &node) |
Create foreground brush renderer. More... | |
void | resetForegroundBrush () |
Reset foreground brush renderer. More... | |
GeometryQuad * | getForegroundGeometry () const |
Access foreground quad. More... | |
void | setForegroundGeometry (const QuadDescription &quad) |
Set foreground quad with full data. More... | |
void | resetForegroundGeometry () |
Reset foreground geometry. More... | |
Vector2 | getBackgroundTiling () const |
Get background tiling from brush if present. 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... | |
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... | |
Geometry * | getBackgroundGeometry () const |
Access background geometry. More... | |
void | resetBackgroundGeometry () |
Reset outside area quad. More... | |
void | updateContentTexture (TextureSharedPtr texture) |
Update content texture in foreground brush renderer, if it exists. More... | |
Composition functionality for 2D nodes.
|
inlineexplicit |
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. |
quad | 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. |
quad | Quad to render. |
transform | Transform for the quad. |
|
inline |
Render using foreground brush wrapper.
void kanzi::NodeVisual2D::restoreResources | ( | ) |
Restore resources to GPU, if applicable.
void kanzi::NodeVisual2D::updateRender | ( | float | layoutOpacity, |
bool | selfInCompositionTarget, | ||
bool | foregroundOpaquenessHint, | ||
bool | translucencyHint | ||
) |
Run updateRender() on foreground and background brush elements.
layoutOpacity | Final, layouted opacity of calling node. |
selfInCompositionTarget | Is node rendered to a composition target. |
foregroundOpaquenessHint | True if node foreground should use opaque render mode if possible. |
translucencyHint | True if node should use translucent render mode if opaque render mode is not used. |
|
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.
offset | Offset. |
size | Size. |
textureOffset | size Size. |
|
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.
quad | Whole background 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.