|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
#include "draw_target.h"Functions | |
| int | rmgui_layer_composite_to (rmgui_target_t *parent, rmgui_target_t *child, rmgui_rect_t rect, rmgui_rect_t clip, const rmgui_layer_transform_t *transform, const rmgui_layer_shadow_t *shadow) |
| Composite the child's premultiplied region {0,0,rect.w,rect.h} into parent using layer.h geometry, clipping, sampling and opacity. | |
| int | rmgui_layer_composite_cached_to (rmgui_layer_t *layer, rmgui_target_t *parent, rmgui_target_t *child, rmgui_rect_t rect, rmgui_rect_t clip, const rmgui_layer_transform_t *transform, const rmgui_layer_shadow_t *shadow) |
| Composite as above, retaining the CPU shadow mask in caller-owned layer. | |
| void | rmgui_draw_frame_shadow_to (rmgui_target_t *, rmgui_rect_t rect, rmgui_rect_t clip, int radius, int blur, rmgui_color_t color) |
| Paint a clipped, uniformly rounded frame-shadow silhouette and its outer blur with window_frame.h's exact integer fill and rounded.h glow rules. | |
| int rmgui_layer_composite_to | ( | rmgui_target_t * | parent, |
| rmgui_target_t * | child, | ||
| rmgui_rect_t | rect, | ||
| rmgui_rect_t | clip, | ||
| const rmgui_layer_transform_t * | transform, | ||
| const rmgui_layer_shadow_t * | shadow ) |
Composite the child's premultiplied region {0,0,rect.w,rect.h} into parent using layer.h geometry, clipping, sampling and opacity.
Targets must have the same kind. Shadows use a bounded tiled procedural mask; use rmgui_layer_composite_cached_to to retain CPU shadow masks. RECORD rejects invalid geometry/transforms, failed or consumed children, cycles and nesting beyond RMGUI_TARGET_LAYER_DEPTH_MAX (including the root). An open child is sealed. On success its stream and all storage/resources must remain immutable and alive until parent submit/discard, which releases the child recursively. A failed append does not acquire the child, but may have sealed it; its caller must discard it. No allocation. Return 0 on success, -1 on failure; RECORD latches the first named failure on parent.
| int rmgui_layer_composite_cached_to | ( | rmgui_layer_t * | layer, |
| rmgui_target_t * | parent, | ||
| rmgui_target_t * | child, | ||
| rmgui_rect_t | rect, | ||
| rmgui_rect_t | clip, | ||
| const rmgui_layer_transform_t * | transform, | ||
| const rmgui_layer_shadow_t * | shadow ) |
Composite as above, retaining the CPU shadow mask in caller-owned layer.
CPU requires a non-NULL idle layer (rmgui_layer_alloc / rmgui_layer_free). A shadow with nonzero color alpha requires its entire mask to fit: rect.w + 6 * blur_px by rect.h + 6 * blur_px. Returns -1 without drawing or modifying layer when storage is insufficient; never uses procedural tiles. No allocation. An all-zero layer suffices when no shadow is cast.
One mask is retained per layer. Width, height, corner radius, blur or shadow/glow mode changes replace it on the next successful visible paint. Position, transform, opacity, shadow offset and color do not invalidate it. The layer must not be used concurrently or between begin/end. RECORD is exactly rmgui_layer_composite_to: layer may be NULL and is neither read nor retained; record/native resource and pixel rules above remain unchanged.
| void rmgui_draw_frame_shadow_to | ( | rmgui_target_t * | , |
| rmgui_rect_t | rect, | ||
| rmgui_rect_t | clip, | ||
| int | radius, | ||
| int | blur, | ||
| rmgui_color_t | color ) |
Paint a clipped, uniformly rounded frame-shadow silhouette and its outer blur with window_frame.h's exact integer fill and rounded.h glow rules.
radius is clamped to the silhouette; blur is clamped to 0..64. RECORD copies value arguments and never allocates.