75 Color cdef{Colors::White};
77 FilterParam() =
default;
80 : uniform(std::move(u)), type(t), argIndex(ai), fdef(fd) {}
83 : uniform(std::move(u)), type(t), argIndex(ai), cdef(cd) {}
117 std::vector<FilterParam> params;
154 std::unordered_map<std::string, FilterDef> defs_;
Centralized standard library includes used throughout ZenitUI.
Small value types shared by the layout, rendering and input layers.
The Style / ComputedStyle pair and all style-related value types.
void clear()
Remove all registered filters, including builtins.
FilterRegistry()
Construct the registry and populate builtin filters.
void add(FilterDef def)
Register or replace a filter definition.
void registerBuiltins()
Register the builtin filters (blur, drop-shadow) if absent.
void reset()
Clear all filters and re-register only the builtins.
void addCustom(std::string name, FilterCustomFn fn)
Register a custom (shader-less) filter.
const FilterDef * find(const std::string &name) const
Look up a filter by name; returns nullptr if not found.
Abstract 2D rendering backend.
Definition UIContext.hpp:106
The base node type: tree, style, layout, input, scroll, render.
Definition Layout.hpp:154
std::function< void(const FilterContext &)> FilterCustomFn
Callback signature for FilterPattern::Custom filters.
Definition FilterRegistry.hpp:106
FilterParamType
Type of a filter parameter.
Definition FilterRegistry.hpp:52
void applyFilter(const FilterDef &def, const FilterContext &ctx)
Execute one filter against the given context.
FilterPattern
Execution pattern for a filter definition.
Definition FilterRegistry.hpp:43
@ Separable
Two shader passes (H then V), using the scratch target.
Definition FilterRegistry.hpp:45
@ Custom
Invoke the custom callback directly.
Definition FilterRegistry.hpp:47
@ Silhouette
Offset silhouette draw + original draw, for drop-shadows.
Definition FilterRegistry.hpp:46
@ SinglePass
One shader, one draw.
Definition FilterRegistry.hpp:44
8-bit-per-channel RGBA color, non-premultiplied.
Definition CoreTypes.hpp:78
Per-invocation state passed to applyFilter and to custom filters.
Definition FilterRegistry.hpp:91
TargetHandle scratch
Intermediate target for full-res separable/custom passes.
Definition FilterRegistry.hpp:96
Vec2 texSize
Backing texture dimensions of src in logical pixels.
Definition FilterRegistry.hpp:100
UIContext * ui
Owning UI context (assets, target pool, render stats).
Definition FilterRegistry.hpp:92
IRenderer * renderer
Active renderer backend.
Definition FilterRegistry.hpp:93
TargetHandle write_target
Destination off-screen target, or invalid when drawing to screen.
Definition FilterRegistry.hpp:97
const FilterRef * ref
Parsed CSS filter reference supplying parameter arguments.
Definition FilterRegistry.hpp:102
Layout * node
Filtered node currently being rendered.
Definition FilterRegistry.hpp:94
float opacity
Final compositing opacity (applied on the screen pass).
Definition FilterRegistry.hpp:101
Rect dst
Logical content sub-rectangle inside off-screen targets.
Definition FilterRegistry.hpp:99
Rect region
Screen-space destination rectangle.
Definition FilterRegistry.hpp:98
TargetHandle src
Source off-screen target for this pass.
Definition FilterRegistry.hpp:95
Complete description of one filter.
Definition FilterRegistry.hpp:113
int downscale
1, 2, or 4 (Separable filters only).
Definition FilterRegistry.hpp:119
One filter in the filters list of a Style.
Definition Style.hpp:679
Axis-aligned rectangle in screen coordinates.
Definition CoreTypes.hpp:46
Opaque handle to an off-screen render target.
Definition CoreTypes.hpp:155
Per-instance UI context: backends, theme, text engine, frame state, and routing.
Definition UIContext.hpp:725
2D vector with component-wise arithmetic.
Definition CoreTypes.hpp:25
3D vector.
Definition CoreTypes.hpp:34
4D vector with an implicit w = 1 default.
Definition CoreTypes.hpp:40