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

BaseLayer style uniform

Instances of this class together with BaseLayerCommonStyleUniform contain 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. Total count of styles is specified with the BaseLayer::Shared::Configuration::Configuration() constructor, uniforms are then uploaded using BaseLayer::Shared::setStyle(), style data that aren't used by the shader are passed to the function separately.

Constructors, destructors, conversion operators

BaseLayerStyleUniform(DefaultInitT = DefaultInit) explicit constexpr noexcept
Construct with default values.
BaseLayerStyleUniform(const Color4& topColor, const Color4& bottomColor, const Color4& outlineColor, const Vector4& outlineWidth, const Vector4& cornerRadius, const Vector4& innerOutlineCornerRadius) constexpr
Constructor.
BaseLayerStyleUniform(const Color4& topColor, const Color4& bottomColor, const Color4& outlineColor, Float outlineWidth, Float cornerRadius, Float innerOutlineCornerRadius) constexpr
Construct with all corners having the same radius and all edges the same outline width.
BaseLayerStyleUniform(const Color4& topColor, const Color4& bottomColor, const Vector4& cornerRadius) constexpr
Construct with no outline.
BaseLayerStyleUniform(const Color4& topColor, const Color4& bottomColor, Float cornerRadius) constexpr
Construct with no outline and all corners having the same radius.
BaseLayerStyleUniform(const Color4& color, const Color4& outlineColor, const Vector4& outlineWidth, const Vector4& cornerRadius, const Vector4& innerOutlineCornerRadius) constexpr
Construct with no gradient.
BaseLayerStyleUniform(const Color4& color, const Color4& outlineColor, Float outlineWidth, Float cornerRadius, Float innerOutlineCornerRadius) constexpr
Construct with no gradient, all corners having the same radius and all edges the same outline width.
BaseLayerStyleUniform(const Color4& color, const Vector4& cornerRadius) constexpr
Construct with no gradient and no outline.
BaseLayerStyleUniform(const Color4& color, Float cornerRadius) constexpr
Construct with no gradient, no outline and all corners having the same radius.
BaseLayerStyleUniform(NoInitT) explicit noexcept
Construct without initializing the contents.

Public variables

Color4 topColor
Top gradient color.
Color4 bottomColor
Bottom gradient color.
Color4 outlineColor
Outline color.
Vector4 outlineWidth
Outline width.
Vector4 cornerRadius
Corner radius.
Vector4 innerOutlineCornerRadius
Inner outline corner radius.

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 setColor(const Color4& top, const Color4& bottom) -> BaseLayerStyleUniform& constexpr
Set the topColor and bottomColor fields.
auto setColor(const Color4& color) -> BaseLayerStyleUniform& constexpr
Set the topColor and bottomColor fields to the same value.
auto setOutlineColor(const Color4& color) -> BaseLayerStyleUniform& constexpr
Set the outlineColor field.
auto setOutlineWidth(const Vector4& width) -> BaseLayerStyleUniform& constexpr
Set the outlineWidth field.
auto setOutlineWidth(Float width) -> BaseLayerStyleUniform& constexpr
Set the outlineWidth field with all edges having the same value.
auto setCornerRadius(const Vector4& radius) -> BaseLayerStyleUniform& constexpr
Set the cornerRadius field.
auto setCornerRadius(Float radius) -> BaseLayerStyleUniform& constexpr
Set the cornerRadius field with all corners having the same value.
auto setInnerOutlineCornerRadius(const Vector4& radius) -> BaseLayerStyleUniform& constexpr
Set the innerOutlineCornerRadius field.
auto setInnerOutlineCornerRadius(Float radius) -> BaseLayerStyleUniform& constexpr
Set the innerOutlineCornerRadius field with all corners having the same value.

Function documentation

Magnum::Ui::BaseLayerStyleUniform::BaseLayerStyleUniform(const Color4& topColor, const Color4& bottomColor, const Color4& outlineColor, Float outlineWidth, Float cornerRadius, Float innerOutlineCornerRadius) constexpr

Construct with all corners having the same radius and all edges the same outline width.

The outlineWidth, cornerRadius and innerOutlineCornerRadius fields have all components set to the values of outlineWidth, cornerRadius and innerOutlineCornerRadius.

Magnum::Ui::BaseLayerStyleUniform::BaseLayerStyleUniform(const Color4& topColor, const Color4& bottomColor, const Vector4& cornerRadius) constexpr

Construct with no outline.

The outlineColor field is set to 0xffffff_srgbf, outlineWidth to a zero vector and both cornerRadius and innerOutlineCornerRadius get a value of cornerRadius.

Magnum::Ui::BaseLayerStyleUniform::BaseLayerStyleUniform(const Color4& topColor, const Color4& bottomColor, Float cornerRadius) constexpr

Construct with no outline and all corners having the same radius.

Delegates to BaseLayerStyleUniform(const Color4&, const Color4&, const Vector4&) with cornerRadius having all components set to the same value.

Magnum::Ui::BaseLayerStyleUniform::BaseLayerStyleUniform(const Color4& color, const Color4& outlineColor, const Vector4& outlineWidth, const Vector4& cornerRadius, const Vector4& innerOutlineCornerRadius) constexpr

Construct with no gradient.

The topColor and bottomColor fields are both set to the value of color.

Magnum::Ui::BaseLayerStyleUniform::BaseLayerStyleUniform(const Color4& color, const Color4& outlineColor, Float outlineWidth, Float cornerRadius, Float innerOutlineCornerRadius) constexpr

Construct with no gradient, all corners having the same radius and all edges the same outline width.

Delegates to BaseLayerStyleUniform(const Color4&, const Color4&, const Color4&, Float, Float, Float) with color used for both topColor and bottomColor.

Magnum::Ui::BaseLayerStyleUniform::BaseLayerStyleUniform(const Color4& color, const Vector4& cornerRadius) constexpr

Construct with no gradient and no outline.

Delegates to BaseLayerStyleUniform(const Color4&, const Color4&, const Vector4&) with color used for both topColor and bottomColor.

Magnum::Ui::BaseLayerStyleUniform::BaseLayerStyleUniform(const Color4& color, Float cornerRadius) constexpr

Construct with no gradient, no outline and all corners having the same radius.

Delegates to BaseLayerStyleUniform(const Color4&, const Color4&, Float) with color used for both topColor and bottomColor.

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setColor(const Color4& top, const Color4& bottom) constexpr

Set the topColor and bottomColor fields.

Returns Reference to self (for method chaining)

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setColor(const Color4& color) constexpr

Set the topColor and bottomColor fields to the same value.

Returns Reference to self (for method chaining)

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setOutlineColor(const Color4& color) constexpr

Set the outlineColor field.

Returns Reference to self (for method chaining)

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setOutlineWidth(const Vector4& width) constexpr

Set the outlineWidth field.

Returns Reference to self (for method chaining)

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setOutlineWidth(Float width) constexpr

Set the outlineWidth field with all edges having the same value.

Returns Reference to self (for method chaining)

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setCornerRadius(const Vector4& radius) constexpr

Set the cornerRadius field.

Returns Reference to self (for method chaining)

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setCornerRadius(Float radius) constexpr

Set the cornerRadius field with all corners having the same value.

Returns Reference to self (for method chaining)

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setInnerOutlineCornerRadius(const Vector4& radius) constexpr

Set the innerOutlineCornerRadius field.

Returns Reference to self (for method chaining)

BaseLayerStyleUniform& Magnum::Ui::BaseLayerStyleUniform::setInnerOutlineCornerRadius(Float radius) constexpr

Set the innerOutlineCornerRadius field with all corners having the same value.

Returns Reference to self (for method chaining)

Variable documentation

Color4 Magnum::Ui::BaseLayerStyleUniform::topColor

Top gradient color.

Default value is 0xffffffff_srgbaf.

Color4 Magnum::Ui::BaseLayerStyleUniform::bottomColor

Bottom gradient color.

Default value is 0xffffffff_srgbaf.

Color4 Magnum::Ui::BaseLayerStyleUniform::outlineColor

Outline color.

Default value is 0xffffffff_srgbaf. Visible only if outlineWidth is non-zero on at least one side or if the difference between cornerRadius and innerOutlineCornerRadius makes it show. Not used if BaseLayerSharedFlag::NoOutline is enabled.

Vector4 Magnum::Ui::BaseLayerStyleUniform::outlineWidth

Outline width.

In order left, top, right, bottom. Default value is 0.0f for all sides. Not used if BaseLayerSharedFlag::NoOutline is enabled.

Vector4 Magnum::Ui::BaseLayerStyleUniform::cornerRadius

Corner radius.

In order top left, bottom left, top right, bottom right. Default value is 0.0f for all sides. Not used if BaseLayerSharedFlag::NoRoundedCorners is enabled.

Vector4 Magnum::Ui::BaseLayerStyleUniform::innerOutlineCornerRadius

Inner outline corner radius.

In order top left, bottom left, top right, bottom right. Default value is 0.0f for all sides. Not used if BaseLayerSharedFlag::NoOutline or NoRoundedCorners is enabled.