Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions crates/rustmotion-core/src/schema/scenario.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,13 @@ fn default_camera_zoom() -> f32 {
/// Direction for progressive blur.
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[derive(Default)]
pub enum BlurDirection {
Top,
#[default]
Bottom,
}

impl Default for BlurDirection {
fn default() -> Self {
BlurDirection::Bottom
}
}

/// A post-processing effect applied to the full frame buffer after Skia renders.
/// Effects are pure Rust, deterministic, and applied in declaration order.
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
Expand Down
8 changes: 4 additions & 4 deletions crates/rustmotion/src/engine/render/post_effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ pub fn apply_pixelate(buf: &mut [u8], w: u32, h: u32, size: u32) {
return;
}

let bx_count = (w + size - 1) / size;
let by_count = (h + size - 1) / size;
let bx_count = w.div_ceil(size);
let by_count = h.div_ceil(size);

for by in 0..by_count {
for bx in 0..bx_count {
Expand Down Expand Up @@ -273,7 +273,7 @@ pub fn apply_progressive_blur(
for x in 0..w {
let x0 = x.saturating_sub(r);
let x1 = (x + r).min(w - 1);
let count = (x1 - x0 + 1) as u32;
let count = x1 - x0 + 1;
let mut sum = [0u32; 4];
for sx in x0..=x1 {
let base = ((y * w + sx) * 4) as usize;
Expand Down Expand Up @@ -303,7 +303,7 @@ pub fn apply_progressive_blur(
for x in 0..w {
let y0 = y.saturating_sub(r);
let y1 = (y + r).min(h - 1);
let count = (y1 - y0 + 1) as u32;
let count = y1 - y0 + 1;
let mut sum = [0u32; 4];
for sy in y0..=y1 {
let base = ((sy * w + x) * 4) as usize;
Expand Down
Loading