struct new in Git master
#include <Magnum/Shaders/Line.h>
LineMaterialUniform Material uniform for line shaders.
Describes material properties referenced from LineDrawUniform::
Constructors, destructors, conversion operators
- LineMaterialUniform(DefaultInitT = DefaultInit) explicit constexpr noexcept
- Construct with default parameters.
- LineMaterialUniform(NoInitT) explicit noexcept
- Construct without initializing the contents.
Public variables
- Color4 backgroundColor
- Background color.
- Color4 color
- Color.
- Float width
- Line width.
- Float smoothness
- Line smoothness.
- Float miterLimit
- Miter limit.
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& color) -> LineMaterialUniform&
- Set the color field.
- auto setBackgroundColor(const Color4& color) -> LineMaterialUniform&
- Set the backgroundColor field.
- auto setWidth(Float width) -> LineMaterialUniform&
- Set the width field.
- auto setSmoothness(Float smoothness) -> LineMaterialUniform&
- Set the smoothness field.
- auto setMiterLengthLimit(Float limit) -> LineMaterialUniform&
- Set the miterLimit field to a length value.
- auto setMiterAngleLimit(Rad limit) -> LineMaterialUniform&
- Set the miterLimit field to an angle value.
Function documentation
LineMaterialUniform& Magnum:: Shaders:: LineMaterialUniform:: setColor(const Color4& color)
Set the color field.
Returns | Reference to self (for method chaining) |
---|
LineMaterialUniform& Magnum:: Shaders:: LineMaterialUniform:: setBackgroundColor(const Color4& color)
Set the backgroundColor field.
Returns | Reference to self (for method chaining) |
---|
LineMaterialUniform& Magnum:: Shaders:: LineMaterialUniform:: setWidth(Float width)
Set the width field.
Returns | Reference to self (for method chaining) |
---|
LineMaterialUniform& Magnum:: Shaders:: LineMaterialUniform:: setSmoothness(Float smoothness)
Set the smoothness field.
Returns | Reference to self (for method chaining) |
---|
LineMaterialUniform& Magnum:: Shaders:: LineMaterialUniform:: setMiterLengthLimit(Float limit)
Set the miterLimit field to a length value.
Returns | Reference to self (for method chaining) |
---|
Expects that limit
is greater than or equal to 1.0f
and finite.
LineMaterialUniform& Magnum:: Shaders:: LineMaterialUniform:: setMiterAngleLimit(Rad limit)
Set the miterLimit field to an angle value.
Returns | Reference to self (for method chaining) |
---|
Expects that limit
is greater than 0.0_radf
.
Variable documentation
Color4 Magnum:: Shaders:: LineMaterialUniform:: backgroundColor
Background color.
Default value is 0x00000000_rgbaf
. Used for edge smoothing if smoothness is non-zero, and for background areas if LineCapStyle::
Color4 Magnum:: Shaders:: LineMaterialUniform:: color
Color.
Default value is 0xffffffff_rgbaf
.
If LineGL::
Float Magnum:: Shaders:: LineMaterialUniform:: width
Line width.
Screen-space, interpreted depending on the viewport size — i.e., a value of 1.0f
is one pixel only if LineGL::1.0f
.
Float Magnum:: Shaders:: LineMaterialUniform:: smoothness
Line smoothness.
Larger values will make edges look less aliased (but blurry), smaller values will make them more crisp (but possibly aliased). Screen-space, interpreted depending on the viewport size — i.e., a value of 1.0f
is one pixel only if LineGL::0.0f
.
Float Magnum:: Shaders:: LineMaterialUniform:: miterLimit
Miter limit.
Limit at which a LineJoinStyle::
Represented as a cosine of the angle between two neighboring line segments, with LineJoinStyle::
For convenience it's recommended to use the setMiterLengthLimit() and setMiterAngleLimit() helpers instead of setting this value directly.