Magnum::Ui::BaseLayerCommonStyleUniform struct new in Git master

Properties common to all BaseLayer style uniforms.

Together with one or more BaseLayerStyleUniform instances contains style properties that are used by the BaseLayer shaders to draw the layer data, packed in a form that allows direct usage in uniform buffers. Is uploaded using BaseLayer::Shared::setStyle(), style data that aren't used by the shader are passed to the function separately.

Constructors, destructors, conversion operators

BaseLayerCommonStyleUniform(DefaultInitT = DefaultInit) explicit constexpr noexcept
Construct with default values.
BaseLayerCommonStyleUniform(Float smoothness, Float innerOutlineSmoothness, Float blurredBackgroundAlpha) constexpr
Constructor.
BaseLayerCommonStyleUniform(Float smoothness, Float innerOutlineSmoothness) constexpr
Construct without blur parameters.
BaseLayerCommonStyleUniform(Float smoothness) constexpr
Construct without blur parameters with the smoothness and innerOutlineSmoothness fields set to the same value.
BaseLayerCommonStyleUniform(NoInitT) explicit noexcept
Construct without initializing the contents.

Public variables

Float smoothness
Edge smoothness radius.
Float innerOutlineSmoothness
Inner outline edge smoothness radius.
Float backgroundBlurAlpha
Blurred background alpha.

Convenience setters

Provided to allow the use of method chaining for populating a structure in a single expression, otherwise equivalent to accessing the fields directly. Also guaranteed to provide backwards compatibility when packing of the actual fields changes.

auto setSmoothness(Float smoothness, Float innerOutlineSmoothness) -> BaseLayerCommonStyleUniform&
Set the smoothness and innerOutlineSmoothness fields.
auto setSmoothness(Float smoothness) -> BaseLayerCommonStyleUniform&
Set the smoothness and innerOutlineSmoothness fields to the same value.
auto setBackgroundBlurAlpha(Float alpha) -> BaseLayerCommonStyleUniform&
Set the backgroundBlurAlpha field.

Function documentation

BaseLayerCommonStyleUniform& Magnum::Ui::BaseLayerCommonStyleUniform::setSmoothness(Float smoothness, Float innerOutlineSmoothness)

Set the smoothness and innerOutlineSmoothness fields.

Returns Reference to self (for method chaining)

BaseLayerCommonStyleUniform& Magnum::Ui::BaseLayerCommonStyleUniform::setSmoothness(Float smoothness)

Set the smoothness and innerOutlineSmoothness fields to the same value.

Returns Reference to self (for method chaining)

BaseLayerCommonStyleUniform& Magnum::Ui::BaseLayerCommonStyleUniform::setBackgroundBlurAlpha(Float alpha)

Set the backgroundBlurAlpha field.

Returns Reference to self (for method chaining)

Variable documentation

Float Magnum::Ui::BaseLayerCommonStyleUniform::smoothness

Edge smoothness radius.

In pixels, i.e. setting the value to 1.0f will make the smoothing extend 1 pixel on each side of the edge. Default value is 0.0f.

Float Magnum::Ui::BaseLayerCommonStyleUniform::innerOutlineSmoothness

Inner outline edge smoothness radius.

In pixels, i.e. setting the value to 1.0f will make the smoothing extend 1 pixel on each side of the edge. Default value is 0.0f. Not used if BaseLayerSharedFlag::NoOutline is enabled.

Float Magnum::Ui::BaseLayerCommonStyleUniform::backgroundBlurAlpha

Blurred background alpha.

If BaseLayerSharedFlag::BackgroundBlur is enabled, the alpha value of BaseLayerStyleUniform::topColor, bottomColor and outlineColor is used to interpolate between the color value and the blurred background. Making this value less than 1.0f makes the original unblurred framebuffer contents show through as well, which can be used to achieve a glow-like effect. Default value is 1.0f. A similar effect can also be achieved using BaseLayerSharedFlag::TextureMask and pixel alpha values between 0.0f and 1.0f.

Image Default value of 1.0f
Image Value of 0.75f