Skip to content

Commit

Permalink
Hotfix fft
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Oct 5, 2024
1 parent 01e753f commit fbbcafd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libblur"
version = "0.14.1"
version = "0.14.2"
edition = "2021"
description = "Fast image blurring in pure Rust"
readme = "../../README.md"
Expand Down
4 changes: 2 additions & 2 deletions src/lib/filter2d/filter_2d_rgba_fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ where

let mut chanel_fourth = gather_channel::<T, 4>(src, image_size, 3);
filter_2d_fft(
&chanel_third,
&mut chanel_fourth,
&chanel_fourth,
&mut working_channel,
image_size,
kernel,
kernel_shape,
Expand Down
49 changes: 24 additions & 25 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod split;
use crate::merge::merge_channels_3;
use crate::split::split_channels_3;
use image::{EncodableLayout, GenericImageView, ImageReader};
use libblur::{filter_1d_exact, filter_1d_rgb_approx, filter_1d_rgba_exact, filter_2d_rgb, filter_2d_rgb_fft, generate_motion_kernel, get_gaussian_kernel_1d, get_laplacian_kernel, get_sigma_size, laplacian, make_arena, motion_blur, sobel, ArenaPads, EdgeMode, FastBlurChannels, GaussianPreciseLevel, ImageSize, KernelShape, Scalar, ThreadingPolicy};
use libblur::{filter_1d_exact, filter_1d_rgb_approx, filter_1d_rgba_exact, filter_2d_rgb, filter_2d_rgb_fft, filter_2d_rgba, filter_2d_rgba_fft, generate_motion_kernel, get_gaussian_kernel_1d, get_laplacian_kernel, get_sigma_size, laplacian, make_arena, motion_blur, sobel, ArenaPads, EdgeMode, FastBlurChannels, GaussianPreciseLevel, ImageSize, KernelShape, Scalar, ThreadingPolicy};
use std::time::Instant;

#[allow(dead_code)]
Expand Down Expand Up @@ -314,41 +314,40 @@ fn main() {
// )
// .unwrap();

motion_blur(
&bytes,
&mut dst_bytes,
ImageSize::new(dimensions.0 as usize, dimensions.1 as usize),
90f32,
75,
EdgeMode::Reflect101,
Scalar::default(),
FastBlurChannels::Channels4,
ThreadingPolicy::Adaptive,
);

// laplacian(
// motion_blur(
// &bytes,
// &mut dst_bytes,
// ImageSize::new(dimensions.0 as usize, dimensions.1 as usize),
// EdgeMode::Clamp,
// 90f32,
// 75,
// EdgeMode::Reflect101,
// Scalar::default(),
// FastBlurChannels::Channels3,
// FastBlurChannels::Channels4,
// ThreadingPolicy::Adaptive,
// );
//
// let motion_kernel = generate_motion_kernel(225, 15.);
//
// filter_2d_rgb(

// laplacian(
// &bytes,
// &mut dst_bytes,
// ImageSize::new(dimensions.0 as usize, dimensions.1 as usize),
// &motion_kernel,
// KernelShape::new(225, 225),
// EdgeMode::Clamp,
// Scalar::new(255.0, 0., 0., 255.0),
// Scalar::default(),
// FastBlurChannels::Channels3,
// ThreadingPolicy::Adaptive,
// )
// .unwrap();
// );
//
let motion_kernel = generate_motion_kernel(225, 15.);

filter_2d_rgba_fft::<u8, f32, f32>(
&bytes,
&mut dst_bytes,
ImageSize::new(dimensions.0 as usize, dimensions.1 as usize),
&motion_kernel,
KernelShape::new(225, 225),
EdgeMode::Clamp,
Scalar::new(255.0, 0., 0., 255.0),
)
.unwrap();

//
// filter_2d_rgba_approx::<u8, f32, i32>(
Expand Down

0 comments on commit fbbcafd

Please sign in to comment.