Expand description
GPU filter library built on top of filtrate-core abstractions.
filtrate hosts the built-in filter implementations and their WGSL
shaders, and (in upcoming phases) the GPU runtime that compiles a
Filter graph into a wgpu pipeline. It is designed to be usable
outside of WaterUI for any wgpu-based image, video, or render-target
workflow.
§Layout
filters: built-in filter structs (Brightness,Blur, …). Each filter implementsFilterfromfiltrate-coreand references one or more WGSL shader files undersrc/shaders/.shaders/(not a Rust module): WGSL fragments and full-shader files compiled into the binary viainclude_str!from individual filter modules.
§Example
use filtrate::filters::{Blur, Brightness};
use filtrate::{Filter, FilterExt};
let chain = Blur(5.0_f32).then(Brightness(0.1_f32));§WebGL support
The optional webgl feature enables wgpu’s WebGL2 backend for wasm
targets (wasm32-unknown-unknown). WebGL2 has no compute shaders or
storage textures, so spatial filter stages compile to a fragment
translation of the same shader body there, selected automatically from
the device limits — see runtime::SpatialExecution. The feature is a
compile error on non-wasm targets.
Re-exports§
pub use effect::Effect;pub use effect::EffectContext;pub use effect::EffectFrameClock;pub use effect::EffectFrameTiming;pub use effect::EffectInput;pub use effect::EffectOutput;pub use effect::EffectRedrawCallback;pub use effect::EffectRenderError;pub use effect::EffectRenderResult;pub use effect::EffectSetupError;pub use effect::EffectSetupResult;pub use runtime::FilterAdapter;pub use runtime::HdrPolicy;
Modules§
- effect
- GPU-aware runtime trait for filter effects.
- filters
- Filter implementations.
- multi_
input - Multi-input GPU filters built for modern GPUs.
- runtime
- Generic GPU runtime for compiling a typed
Filtergraph into anEffect.
Structs§
- Animated
Target - Carries a new target value plus optional animation interpolator from a watcher callback into the runtime.
- Animation
Track - Single-channel
f32animation timeline. - Chain
- A chain of two filters.
- Watch
Guard - Opaque guard returned by
FilterParam::watch_animatedthat keeps a subscription alive. Dropping the guard cancels the subscription. - Wgsl
Module Cache - Memoizes runtime-compiled WGSL modules for one device.
Constants§
- MAX_
FILTER_ PARAMS - Maximum number of
f32parameters a single fused filter pipeline can carry. - MAX_
FILTER_ PARAM_ VEC4S - Number of
vec4<f32>slots required to holdMAX_FILTER_PARAMSfloats.
Traits§
- Filter
- A GPU filter that processes textures.
- Filter
Ext - Extension trait for chaining filters.
- Filter
Param - A scalar
f32parameter that can be sampled during initialization and observed for animated changes. - Interpolator
- Interpolator drives a smooth transition between two
f32values over time. - Param
Array - Trait for parameter arrays that can write their values to a buffer.
- Signal
Visitor - Sink for
crate::Filter::visit_signalstraversal. - Stage
Collector - Sink for atomic stages emitted by
crate::Filter::collect_stages.
Type Aliases§
- Animated
Callback - Boxed callback type passed to
FilterParam::watch_animated.