kanzi::NodeVisual2D Class Reference

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...
 
BrushRenderergetBackgroundBrushRenderer () const
 Get background brush renderer. More...
 
void setBackgroundBrush (BrushSharedPtr brush, Node &node)
 Create background brush renderer. More...
 
void resetBackgroundBrush ()
 Reset background brush renderer. More...
 
BrushRenderergetForegroundBrushRenderer () const
 Get foreground brush renderer. More...
 
void setForegroundBrushRenderer (BrushSharedPtr brush, Node &node)
 Create foreground brush renderer. More...
 
void resetForegroundBrush ()
 Reset foreground brush renderer. More...
 
GeometryQuadgetForegroundGeometry () 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...
 
GeometrygetBackgroundGeometry () 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...
 

Detailed Description

Composition functionality for 2D nodes.

Constructor & Destructor Documentation

kanzi::NodeVisual2D::NodeVisual2D ( )
inlineexplicit

Constructor.

Member Function Documentation

tuple<QuadDescription, unsigned int> kanzi::NodeVisual2D::calculateContentStretch ( int  contentStretch,
Vector2  renderSize,
Vector2  contentSize 
)

Calculate foreground content stretch.

Parameters
contentStretchContent stretch mode, of type Node2D::ContentStretch.
renderSizeRender size.
contentSizeContent size.
Returns
Tuple of foreground quad and clipping result mask.
void kanzi::NodeVisual2D::renderBackground ( Renderer3D renderer,
const Geometry geometry,
const Matrix4x4 transform 
)

Render using background brush.

Parameters
rendererRenderer to use.
quadQuad to render.
transformTransform for the quad.
void kanzi::NodeVisual2D::renderBackground ( Renderer3D renderer,
const Geometry geometry,
const Matrix3x3 transform 
)
inline

Render using background brush wrapper.

void kanzi::NodeVisual2D::renderBackground ( Renderer3D renderer,
const Matrix4x4 transform 
)

Render using background brush.

Uses background quad from visual.

Parameters
rendererRenderer to use.
transformTransform for the quad.
void kanzi::NodeVisual2D::renderBackground ( Renderer3D renderer,
const Matrix3x3 transform 
)
inline

Render using background brush wrapper.

void kanzi::NodeVisual2D::renderForeground ( Renderer3D renderer,
const Matrix4x4 transform 
)

Render using foreground brush.

Parameters
rendererRenderer to use.
quadQuad to render.
transformTransform for the quad.
void kanzi::NodeVisual2D::renderForeground ( Renderer3D renderer,
const Matrix3x3 transform 
)
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.

Parameters
layoutOpacityFinal, layouted opacity of calling node.
selfInCompositionTargetIs node rendered to a composition target.
foregroundOpaquenessHintTrue if node foreground should use opaque render mode if possible.
translucencyHintTrue if node should use translucent render mode if opaque render mode is not used.
BrushRenderer* kanzi::NodeVisual2D::getBackgroundBrushRenderer ( ) const
inline

Get background brush renderer.

void kanzi::NodeVisual2D::setBackgroundBrush ( BrushSharedPtr  brush,
Node node 
)
inline

Create background brush renderer.

Parameters
nodeNode to attach to.
brushBrush to create from.
void kanzi::NodeVisual2D::resetBackgroundBrush ( )
inline

Reset background brush renderer.

BrushRenderer* kanzi::NodeVisual2D::getForegroundBrushRenderer ( ) const
inline

Get foreground brush renderer.

void kanzi::NodeVisual2D::setForegroundBrushRenderer ( BrushSharedPtr  brush,
Node node 
)
inline

Create foreground brush renderer.

Parameters
nodeNode to attach to.
brushBrush to create from.
void kanzi::NodeVisual2D::resetForegroundBrush ( )
inline

Reset foreground brush renderer.

GeometryQuad* kanzi::NodeVisual2D::getForegroundGeometry ( ) const
inline

Access foreground quad.

void kanzi::NodeVisual2D::setForegroundGeometry ( const QuadDescription quad)
inline

Set foreground quad with full data.

Parameters
offsetOffset.
sizeSize.
textureOffsetsize Size.
void kanzi::NodeVisual2D::resetForegroundGeometry ( )
inline

Reset foreground geometry.

Vector2 kanzi::NodeVisual2D::getBackgroundTiling ( ) const
inline

Get background tiling from brush if present.

Vector2 kanzi::NodeVisual2D::getForegroundTiling ( ) const
inline

Get foreground tiling from brush if present.

bool kanzi::NodeVisual2D::isBackgroundOpaque ( ) const
inline

Tell if background brush is present and is opaque.

bool kanzi::NodeVisual2D::isForegroundOpaque ( ) const
inline

Tell if foreground brush is present and is opaque.

void kanzi::NodeVisual2D::createBackgroundGeometry ( const QuadDescription quad)
inline

Create background quad.

Creates a complete background quad.

Parameters
quadQuad description.
void kanzi::NodeVisual2D::createBackgroundGeometry ( const QuadDescription bg,
const QuadDescription fg,
unsigned int  clippingResult 
)
inline

Create the outside area quad.

Creates a frame that does not include the foreground area.

Parameters
quadWhole background area quad.
clippingResultClipping result.
Geometry* kanzi::NodeVisual2D::getBackgroundGeometry ( ) const
inline

Access background geometry.

void kanzi::NodeVisual2D::resetBackgroundGeometry ( )
inline

Reset outside area quad.

void kanzi::NodeVisual2D::updateContentTexture ( TextureSharedPtr  texture)
inline

Update content texture in foreground brush renderer, if it exists.


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