RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
rmgui_layer_shadow_t Struct Reference

A shadow (OVER) or glow (ADD) cast by the rounded rect of the element, radii device px, the SAME value passed to the face painter: shadow.radii = radii; rmgui_draw_fill_rounded_corners(fb, clip, rect, radii, color, mode); Uniform shadows retain the legacy binary raster; asymmetric shadows use the corner fill's exact antialiased raster. More...

#include <layer.h>

Data Fields

int offset_x
int offset_y
rmgui_corner_radii_t radii
int blur_px
rmgui_color_t color
rmgui_draw_mode_t mode

Detailed Description

A shadow (OVER) or glow (ADD) cast by the rounded rect of the element, radii device px, the SAME value passed to the face painter: shadow.radii = radii; rmgui_draw_fill_rounded_corners(fb, clip, rect, radii, color, mode); Uniform shadows retain the legacy binary raster; asymmetric shadows use the corner fill's exact antialiased raster.

A uniform face uses rmgui_corner_radii_uniform(radius). Each nonnegative radius is clamped to floor(min(rect.w, rect.h) / 2); adjacent radii sum to at most their edge. With blur_px > 0 coverage is a smooth function of signed distance d from the pixel centre: 1/2 on the edge, 1 at d <= -3 * blur_px, 0 at d >= 3 * blur_px, decreasing between (a triple box blur's straight-edge profile). With blur_px 0 it is exactly the corresponding fill. A glow is hollow: 0 on every pixel that fill covers, so on the direct path a glow with no offset lights no pixel of the element's rounded face, whatever the element paints there (a translucent face and its text included); the hole moves with the offset. A glow with blur_px 0 lights nothing. The cast is transformed with the element and then moved by offset_x, offset_y destination pixels. color.a scales its coverage; color.a == 0 casts none. Native GPU submission supports uniform radii only; asymmetric casting radii explicitly refuse before GPU work so the host can choose CPU rendering.

rmgui_layer_shadow_t.blur_px

0..the caller's max_blur_px allowance

Field Documentation

◆ offset_x

int rmgui_layer_shadow_t::offset_x

◆ offset_y

int rmgui_layer_shadow_t::offset_y

◆ radii

rmgui_corner_radii_t rmgui_layer_shadow_t::radii

◆ blur_px

int rmgui_layer_shadow_t::blur_px

◆ color

rmgui_color_t rmgui_layer_shadow_t::color

◆ mode

rmgui_draw_mode_t rmgui_layer_shadow_t::mode

The documentation for this struct was generated from the following file: