HikoGUI
A low latency retained GUI
|
#include <hikogui/GFX/draw_context_intf.hpp>
Public Member Functions | |
constexpr | draw_attributes (draw_attributes const &) noexcept=default |
constexpr | draw_attributes (draw_attributes &&) noexcept=default |
constexpr draw_attributes & | operator= (draw_attributes const &) noexcept=default |
constexpr draw_attributes & | operator= (draw_attributes &&) noexcept=default |
template<draw_attribute... Args> | |
constexpr | draw_attributes (Args const &...args) noexcept |
Construct the draw attributes based on types and order of the attributes. | |
constexpr void | add () noexcept |
template<draw_attribute T> | |
constexpr void | add (T const &attribute) noexcept |
template<draw_attribute First, draw_attribute Second, draw_attribute... Rest> | |
constexpr void | add (First const &first, Second const &second, Rest const &...rest) noexcept |
Data Fields | |
unsigned char | num_colors = 0 |
unsigned char | num_line_caps = 0 |
quad_color | fill_color = {} |
The fill color used for the color of a box inside the border. | |
quad_color | line_color = {} |
The line color used for the color of the border of the box. | |
float | line_width = 0.0f |
The width of a line, or the width of a border. | |
hi::border_side | border_side = hi::border_side::on |
The side on which side of the edge of a shape the border should be drawn. | |
hi::corner_radii | corner_radius = {} |
The radii of each corner of a quad. | |
aarectangle | clipping_rectangle = aarectangle::large() |
The rectangle used the clip the shape when drawing. | |
line_end_cap | begin_line_cap = line_end_cap::flat |
The shape of the beginning of a line. | |
line_end_cap | end_line_cap = line_end_cap::flat |
The shape of the beginning of a line. | |
The draw attributes used to draw shaped into the draw context.
|
inlineconstexprnoexcept |
Construct the draw attributes based on types and order of the attributes.
The following order of attributes is maintained:
fill_color
and line_color
are transparent.hi::color
or hi::quad_color
is used for the fill_color
.hi::color
or hi::quad_color
is used for the line_color
.begin_line_cap
and end_line_cap
are set to flat.hi::line_end_cap
is used for both the begin_line_cap
and end_line_cap
.hi::line_end_cap
is used to override the end_line_cap
.border_side
is set to border_side::on
hi::border_side
argument is used to set the border_side
.corner_radius
are set to (0, 0, 0, 0).hi::corner_radii
argument is used to set the corner_radius
.clipping_rectangle
is set to a rectangle encompassing the whole window.hi::aarectangle
argument is used to set the clipping_rectangle
.line_width
is set to 0.float
or int
argument is used to set the line_width
.args | The attributes to be set. |
line_end_cap hi::v1::draw_attributes::begin_line_cap = line_end_cap::flat |
The shape of the beginning of a line.
hi::border_side hi::v1::draw_attributes::border_side = hi::border_side::on |
The side on which side of the edge of a shape the border should be drawn.
aarectangle hi::v1::draw_attributes::clipping_rectangle = aarectangle::large() |
The rectangle used the clip the shape when drawing.
This rectangle is used for limiting drawing outside of a widget's rectangle. But it may also be used to cut shapes for special effects.
hi::corner_radii hi::v1::draw_attributes::corner_radius = {} |
The radii of each corner of a quad.
line_end_cap hi::v1::draw_attributes::end_line_cap = line_end_cap::flat |
The shape of the beginning of a line.
quad_color hi::v1::draw_attributes::fill_color = {} |
The fill color used for the color of a box inside the border.
This is also used as the line-color when drawing lines. Or the color of the text. And the color for the primary cursor.
quad_color hi::v1::draw_attributes::line_color = {} |
The line color used for the color of the border of the box.
This is also used as the color for the secondary cursor.
float hi::v1::draw_attributes::line_width = 0.0f |
The width of a line, or the width of a border.