Skip to content

Commit

Permalink
Update the maximum values of the sharpen operation (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Jun 30, 2023
1 parent 85ee458 commit a82438c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/api/processors/sharpen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ VImage Sharpen::process(const VImage &image) const {
"sharp",
[](float s) {
// Sigma needs to be in range of
// 0.000001 - 10000
return s >= 0.000001 && s <= 10000;
// 0.000001 - 10, see:
// https://github.com/libvips/libvips/pull/3270
return s >= 0.000001 && s <= 10;
},
-1.0F);

Expand All @@ -37,18 +38,18 @@ VImage Sharpen::process(const VImage &image) const {
"sharpf",
[](float f) {
// Slope for flat areas needs to
// be in range of 0 - 10000
return f >= 0 && f <= 10000;
// be in range of 0 - 1000000
return f >= 0 && f <= 1000000;
},
1.0F);

// Slope for jaggy areas
auto jagged = query_->get_if<float>(
"sharpj",
[](float j) {
// Slope for jaggy areas needs
// to be in range of 0 - 10000
return j >= 0 && j <= 10000;
// Slope for jaggy areas needs to
// be in range of 0 - 1000000
return j >= 0 && j <= 1000000;
},
2.0F);

Expand Down

0 comments on commit a82438c

Please sign in to comment.