Add the Spiral operation and associated enums.

This commit is contained in:
Bauke 2024-02-29 13:58:33 +01:00
parent 5e160663e2
commit 745dfdc468
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 46 additions and 0 deletions

View File

@ -90,6 +90,20 @@ gegl_enum!(
WhiteOnBlack => "white-on-black",
);
gegl_enum!(
/// The spiral swirl direction for [`Spiral`][super::Spiral]
SpiralDirection,
Clockwise => "cw",
CounterClockwise => "ccw",
);
gegl_enum!(
/// The spiral type for [`Spiral`][super::Spiral]
SpiralType,
Linear => "linear",
Logarithmic => "logarithmic",
);
gegl_enum!(
/// The sampler type for [`StereographicProjection`][super::StereographicProjection].
StereographicProjectionSamplerType,

View File

@ -415,6 +415,38 @@ gegl_operation!(
),
);
gegl_operation!(
struct_name: Spiral,
gegl_name: "spiral",
append_crop: true,
values: (
/// The area balance between the two colors.
balance: f64, 0.0,
/// The logarithmic spiral base.
base: f64, 2.0,
/// The primary color.
color1: String, "#000".to_string(),
/// The secondary color.
color2: String, "#fff".to_string(),
/// The spiral swirl direction.
direction: SpiralDirection, SpiralDirection::Clockwise,
/// The height of the generated buffer.
height: i64, 768,
/// The spiral radius.
radius: f64, 100.0,
/// The spiral rotation.
rotation: f64, 0.0,
/// The spiral type.
spiral_type: SpiralType, SpiralType::Linear,
/// The X origin coordinate.
x: f64, 0.5,
/// The Y origin coordinate.
y: f64, 0.5,
/// The width of the generated buffer.
width: i64, 1024,
),
);
gegl_operation!(
struct_name: StereographicProjection,
gegl_name: "stereographic-projection",