Expose optional minAmplitude parameter of blur operation (#4172)

This commit is contained in:
Marcos Casagrande
2024-07-23 12:31:11 +02:00
committed by GitHub
parent 67a5854b89
commit 735fee74db
11 changed files with 45 additions and 5 deletions

View File

@@ -144,7 +144,7 @@ namespace sharp {
/*
* Gaussian blur. Use sigma of -1.0 for fast blur.
*/
VImage Blur(VImage image, double const sigma, VipsPrecision precision) {
VImage Blur(VImage image, double const sigma, VipsPrecision precision, double const minAmpl) {
if (sigma == -1.0) {
// Fast, mild blur - averages neighbouring pixels
VImage blur = VImage::new_matrixv(3, 3,
@@ -156,7 +156,8 @@ namespace sharp {
} else {
// Slower, accurate Gaussian blur
return StaySequential(image).gaussblur(sigma, VImage::option()
->set("precision", precision));
->set("precision", precision)
->set("min_ampl", minAmpl));
}
}