tessera_ui_basic_components/pipelines/blur/command.rs
1use tessera_ui::{ComputeCommand, Px, renderer::command::BarrierRequirement};
2
3/// A synchronous command to execute a gaussian blur.
4/// BlurCommand only describes blur parameters
5#[derive(Debug, Clone, PartialEq)]
6pub struct BlurCommand {
7 /// Blur radius.
8 pub radius: f32,
9 /// Blur direction: (1.0, 0.0) for horizontal, (0.0, 1.0) for vertical.
10 pub direction: (f32, f32),
11 /// Padding size.
12 pub padding: Px,
13}
14
15impl ComputeCommand for BlurCommand {
16 fn barrier(&self) -> BarrierRequirement {
17 BarrierRequirement::PaddedLocal {
18 top: self.padding,
19 bottom: self.padding,
20 left: self.padding,
21 right: self.padding,
22 }
23 }
24}