class
#include <Magnum/Ui/BaseLayer.h>
Configuration Configuration of a base layer shared state.
Constructors, destructors, conversion operators
- Configuration(UnsignedInt styleUniformCount, UnsignedInt styleCount) explicit
- Constructor.
- Configuration(UnsignedInt styleCount) explicit
- Construct with style uniform count being the same as style count.
Public functions
- auto styleUniformCount() const -> UnsignedInt
- Style uniform count.
- auto styleCount() const -> UnsignedInt
- Style count.
- auto dynamicStyleCount() const -> UnsignedInt
- Dynamic style count.
- auto setDynamicStyleCount(UnsignedInt count) -> Configuration&
- Set dynamic style count.
- auto flags() const -> BaseLayerSharedFlags
- Flags.
- auto setFlags(BaseLayerSharedFlags flags) -> Configuration&
- Set flags.
- auto addFlags(BaseLayerSharedFlags flags) -> Configuration&
- Add flags.
- auto clearFlags(BaseLayerSharedFlags flags) -> Configuration&
- Clear flags.
- auto backgroundBlurRadius() const -> UnsignedInt
- Background blur radius.
- auto backgroundBlurCutoff() const -> Float
- Background blur sampling cutoff.
- auto setBackgroundBlurRadius(UnsignedInt radius, Float cutoff = 0.5f/255.0f) -> Configuration&
- Set background blur radius and sampling cutoff.
Function documentation
Magnum:: Ui:: BaseLayer:: Shared:: Configuration:: Configuration(UnsignedInt styleUniformCount,
UnsignedInt styleCount) explicit
Constructor.
The styleUniformCount
parameter specifies the size of the uniform array, styleCount
then the number of distinct styles to use for drawing. The sizes are independent in order to allow styles with different paddings share the same uniform data. Either both styleUniformCount
and styleCount
is expected to be non-zero, or both zero with a non-zero dynamic style count specified with setDynamicStyleCount(). Style data are then set with setStyle(), dynamic style data then with BaseLayer::
Magnum:: Ui:: BaseLayer:: Shared:: Configuration:: Configuration(UnsignedInt styleCount) explicit
Construct with style uniform count being the same as style count.
Equivalent to calling Configuration(UnsignedInt, UnsignedInt) with both parameters set to styleCount
.
Configuration& Magnum:: Ui:: BaseLayer:: Shared:: Configuration:: setDynamicStyleCount(UnsignedInt count)
Set dynamic style count.
Returns | Reference to self (for method chaining) |
---|
Initial count is 0
.
Configuration& Magnum:: Ui:: BaseLayer:: Shared:: Configuration:: setFlags(BaseLayerSharedFlags flags)
Set flags.
Returns | Reference to self (for method chaining) |
---|
By default no flags are set.
Configuration& Magnum:: Ui:: BaseLayer:: Shared:: Configuration:: addFlags(BaseLayerSharedFlags flags)
Add flags.
Returns | Reference to self (for method chaining) |
---|
Calls setFlags() with the existing flags ORed with flags
. Useful for preserving previously set flags.
Configuration& Magnum:: Ui:: BaseLayer:: Shared:: Configuration:: clearFlags(BaseLayerSharedFlags flags)
Clear flags.
Returns | Reference to self (for method chaining) |
---|
Calls setFlags() with the existing flags ANDed with the inverse of flags
. Useful for removing a subset of previously set flags.
Configuration& Magnum:: Ui:: BaseLayer:: Shared:: Configuration:: setBackgroundBlurRadius(UnsignedInt radius,
Float cutoff = 0.5f/255.0f)
Set background blur radius and sampling cutoff.
Parameters | |
---|---|
radius | Gaussian blur radius |
cutoff | Cutoff for weight values after which no sampling is done |
Returns | Reference to self (for method chaining) |
Expects that the radius
is less than 31
, value of 0
makes the blur sample only the center pixel, effectively not blurring anything. The cutoff
value controls a balance between speed and precision, 0.0f
samples all pixels in given radius even though they may have a weight that doesn't result in any contribution to the quantized output, higher values gradually reduce the number of sampled pixels down to just one.
While the radius is a static setting that has to be set upfront, there's also pass count that can be changed dynamically at runtime. See BaseLayer::
Initial radius
is 4
and cutoff
is 0.5f/255.0f
, i.e. weights that don't contribute any value even when combined from both sides of the blur circle for a 8bpp render target are ignored.