Add the Edge operation and associated enums.

This commit is contained in:
Bauke 2024-02-29 13:42:37 +01:00
parent 719c9c85e6
commit 8958e49168
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 35 additions and 0 deletions

View File

@ -2,6 +2,27 @@
use crate::gegl_enum;
gegl_enum!(
/// The abyss policy for various GEGL operations.
AbyssPolicy,
Black => "black",
Clamp => "clamp",
Loop => "loop",
None => "none",
White => "white",
);
gegl_enum!(
/// The detection algorithm for [`Edge`][super::Edge].
EdgeAlgorithm,
Differential => "differential",
Gradient => "gradient",
Laplace => "laplace",
PrewittCompass => "prewitt",
Roberts => "roberts",
Sobel => "sobel",
);
gegl_enum!(
/// The shape for [`FocusBlur`][super::FocusBlur].
FocusBlurShape,

View File

@ -111,6 +111,20 @@ gegl_operation!(
),
);
gegl_operation!(
struct_name: Edge,
gegl_name: "edge",
append_crop: false,
values: (
/// The edge detection algorithm to use.
algorithm: EdgeAlgorithm, EdgeAlgorithm::Sobel,
/// The amount of edge detection to perform.
amount: f64, 2.0,
/// The edge detection border behavior.
border_behavior: AbyssPolicy, AbyssPolicy::Clamp,
),
);
gegl_operation!(
struct_name: EdgeNeon,
gegl_name: "edge-neon",