Rework the gegl_operation macro to get doc comments directly.
This commit is contained in:
		
							parent
							
								
									849588a96b
								
							
						
					
					
						commit
						95d611afdb
					
				| 
						 | 
					@ -7,13 +7,18 @@ macro_rules! gegl_operation {
 | 
				
			||||||
    struct_name: $struct_name:ident,
 | 
					    struct_name: $struct_name:ident,
 | 
				
			||||||
    gegl_name: $gegl_name:expr,
 | 
					    gegl_name: $gegl_name:expr,
 | 
				
			||||||
    append_crop: $append_crop:expr,
 | 
					    append_crop: $append_crop:expr,
 | 
				
			||||||
    values: ($($key:ident: $key_type:ty, $key_default:expr, $key_doc:expr),*,),
 | 
					    values: (
 | 
				
			||||||
 | 
					      $(
 | 
				
			||||||
 | 
					        $(#[$key_meta:meta])*
 | 
				
			||||||
 | 
					        $key:ident: $key_type:ty, $key_default:expr
 | 
				
			||||||
 | 
					      ),*,
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
  ) => {
 | 
					  ) => {
 | 
				
			||||||
    #[doc = concat!(" The `gegl:", $gegl_name, "` operation.")]
 | 
					    #[doc = concat!(" The `gegl:", $gegl_name, "` operation.")]
 | 
				
			||||||
    #[derive(Debug)]
 | 
					    #[derive(Debug)]
 | 
				
			||||||
    pub struct $struct_name {
 | 
					    pub struct $struct_name {
 | 
				
			||||||
      $(
 | 
					      $(
 | 
				
			||||||
        #[doc = concat!(" ", $key_doc)]
 | 
					        $(#[$key_meta])*
 | 
				
			||||||
        pub $key: $key_type,
 | 
					        pub $key: $key_type,
 | 
				
			||||||
      )*
 | 
					      )*
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,11 +12,16 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "bloom",
 | 
					  gegl_name: "bloom",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    limit_exposure: bool, false, "Don't over-expose highlights.",
 | 
					    /// Don't over-expose highlights.
 | 
				
			||||||
    radius: f64, 10.0, "Glow radius.",
 | 
					    limit_exposure: bool, false,
 | 
				
			||||||
    softness: f64, 25.0, "Glow-area edge softness.",
 | 
					    /// Glow radius.
 | 
				
			||||||
    strength: f64, 50.0, "Glow strength.",
 | 
					    radius: f64, 10.0,
 | 
				
			||||||
    threshold: f64, 50.0, "Glow-area brightness threshold.",
 | 
					    /// Glow-area edge softness.
 | 
				
			||||||
 | 
					    softness: f64, 25.0,
 | 
				
			||||||
 | 
					    /// Glow strength.
 | 
				
			||||||
 | 
					    strength: f64, 50.0,
 | 
				
			||||||
 | 
					    /// Glow-area brightness threshold.
 | 
				
			||||||
 | 
					    threshold: f64, 50.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,8 +30,10 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "cartoon",
 | 
					  gegl_name: "cartoon",
 | 
				
			||||||
  append_crop: true,
 | 
					  append_crop: true,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    mask_radius: f64, 7.0, "The mask radius.",
 | 
					    /// The mask radius.
 | 
				
			||||||
    pct_black: f64, 0.2, "The percentage of black.",
 | 
					    mask_radius: f64, 7.0,
 | 
				
			||||||
 | 
					    /// The percentage of black.
 | 
				
			||||||
 | 
					    pct_black: f64, 0.2,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,12 +42,18 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "cell-noise",
 | 
					  gegl_name: "cell-noise",
 | 
				
			||||||
  append_crop: true,
 | 
					  append_crop: true,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    iterations: i64, 1, "The number of noise octaves.",
 | 
					    /// The number of noise octaves.
 | 
				
			||||||
    palettize: bool, false, "Fill each cell with a random color.",
 | 
					    iterations: i64, 1,
 | 
				
			||||||
    rank: i64, 1, "Select the n-th closest point",
 | 
					    /// Fill each cell with a random color.
 | 
				
			||||||
    scale: f64, 1.0, "The scale of the noise function.",
 | 
					    palettize: bool, false,
 | 
				
			||||||
    seed: f64, 0.0, "The random seed for the noise function.",
 | 
					    /// Select the n-th closest point
 | 
				
			||||||
    shape: f64, 2.0, "Interpolate between Manhattan and Euclidean distance.",
 | 
					    rank: i64, 1,
 | 
				
			||||||
 | 
					    /// The scale of the noise function.
 | 
				
			||||||
 | 
					    scale: f64, 1.0,
 | 
				
			||||||
 | 
					    /// The random seed for the noise function.
 | 
				
			||||||
 | 
					    seed: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Interpolate between Manhattan and Euclidean distance.
 | 
				
			||||||
 | 
					    shape: f64, 2.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -49,11 +62,16 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "crop",
 | 
					  gegl_name: "crop",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    height: f64, 0.0, "The wanted height of the buffer.",
 | 
					    /// The wanted height of the buffer.
 | 
				
			||||||
    reset_origin: bool, false, "Reset the origin for the coordinates.",
 | 
					    height: f64, 0.0,
 | 
				
			||||||
    width: f64, 0.0, "The wanted width of the buffer.",
 | 
					    /// Reset the origin for the coordinates.
 | 
				
			||||||
    x: f64, 0.0, "The X coordinate to start from.",
 | 
					    reset_origin: bool, false,
 | 
				
			||||||
    y: f64, 0.0, "The Y coordinate to start from.",
 | 
					    /// The wanted width of the buffer.
 | 
				
			||||||
 | 
					    width: f64, 0.0,
 | 
				
			||||||
 | 
					    /// The X coordinate to start from.
 | 
				
			||||||
 | 
					    x: f64, 0.0,
 | 
				
			||||||
 | 
					    /// The Y coordinate to start from.
 | 
				
			||||||
 | 
					    y: f64, 0.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,20 +80,34 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "diffraction-patterns",
 | 
					  gegl_name: "diffraction-patterns",
 | 
				
			||||||
  append_crop: true,
 | 
					  append_crop: true,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    blue_contours: f64, 0.97, "Number of contours (blue);",
 | 
					    /// Number of contours (blue);
 | 
				
			||||||
    blue_frequency: f64, 1.12, "Light frequency (blue).",
 | 
					    blue_contours: f64, 0.97,
 | 
				
			||||||
    blue_sedges: f64, 0.64, "Number of sharp edges (blue).",
 | 
					    /// Light frequency (blue).
 | 
				
			||||||
    brightness: f64, 0.07, "Brightness and shifting/fattening of contours.",
 | 
					    blue_frequency: f64, 1.12,
 | 
				
			||||||
    green_contours: f64, 0.82, "Number of contours (green);",
 | 
					    /// Number of sharp edges (blue).
 | 
				
			||||||
    green_frequency: f64, 1.22, "Light frequency (green).",
 | 
					    blue_sedges: f64, 0.64,
 | 
				
			||||||
    green_sedges: f64, 0.68, "Number of sharp edges (green).",
 | 
					    /// Brightness and shifting/fattening of contours.
 | 
				
			||||||
    height: i64, 200, "Height of the generated buffer.",
 | 
					    brightness: f64, 0.07,
 | 
				
			||||||
    polarization: f64, -0.47, "Polarization.",
 | 
					    /// Number of contours (green);
 | 
				
			||||||
    red_contours: f64, 0.82, "Number of contours (red);",
 | 
					    green_contours: f64, 0.82,
 | 
				
			||||||
    red_frequency: f64, 0.81, "Light frequency (red).",
 | 
					    /// Light frequency (green).
 | 
				
			||||||
    red_sedges: f64, 0.61, "Number of sharp edges (red).",
 | 
					    green_frequency: f64, 1.22,
 | 
				
			||||||
    scattering: f64, 37.13, "Scattering (speed vs. quality).",
 | 
					    /// Number of sharp edges (green).
 | 
				
			||||||
    width: i64, 200, "Width of the generated buffer.",
 | 
					    green_sedges: f64, 0.68,
 | 
				
			||||||
 | 
					    /// Height of the generated buffer.
 | 
				
			||||||
 | 
					    height: i64, 200,
 | 
				
			||||||
 | 
					    /// Polarization.
 | 
				
			||||||
 | 
					    polarization: f64, -0.47,
 | 
				
			||||||
 | 
					    /// Number of contours (red);
 | 
				
			||||||
 | 
					    red_contours: f64, 0.82,
 | 
				
			||||||
 | 
					    /// Light frequency (red).
 | 
				
			||||||
 | 
					    red_frequency: f64, 0.81,
 | 
				
			||||||
 | 
					    /// Number of sharp edges (red).
 | 
				
			||||||
 | 
					    red_sedges: f64, 0.61,
 | 
				
			||||||
 | 
					    /// Scattering (speed vs. quality).
 | 
				
			||||||
 | 
					    scattering: f64, 37.13,
 | 
				
			||||||
 | 
					    /// Width of the generated buffer.
 | 
				
			||||||
 | 
					    width: i64, 200,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,20 +116,34 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "focus-blur",
 | 
					  gegl_name: "focus-blur",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    aspect_ratio: f64, 0.0, "The aspect ratio of the focus region.",
 | 
					    /// The aspect ratio of the focus region.
 | 
				
			||||||
    blur_radius: f64, 25.0, "Out-of-focus blur radius.",
 | 
					    aspect_ratio: f64, 0.0,
 | 
				
			||||||
    blur_type: FocusBlurType, FocusBlurType::Gaussian, "The blur type.",
 | 
					    /// Out-of-focus blur radius.
 | 
				
			||||||
    focus: f64, 0.25, "The focus region's inner limit.",
 | 
					    blur_radius: f64, 25.0,
 | 
				
			||||||
    highlight_factor: f64, 0.0, "Relative highlight strength.",
 | 
					    /// The blur type.
 | 
				
			||||||
    highlight_threshold_high: f64, 1.0, "Highlight threshold (high).",
 | 
					    blur_type: FocusBlurType, FocusBlurType::Gaussian,
 | 
				
			||||||
    highlight_threshold_low: f64, 0.0, "Highlight threshold (low).",
 | 
					    /// The focus region's inner limit.
 | 
				
			||||||
    high_quality: bool, false, "Generate more accurate and consistent output.",
 | 
					    focus: f64, 0.25,
 | 
				
			||||||
    midpoint: f64, 0.5, "The focus region's transition midpoint.",
 | 
					    /// Relative highlight strength.
 | 
				
			||||||
    radius: f64, 0.75, "The focus region's outer radius.",
 | 
					    highlight_factor: f64, 0.0,
 | 
				
			||||||
    rotation: f64, 0.0, "The rotation of the focus region.",
 | 
					    /// Highlight threshold (high).
 | 
				
			||||||
    shape: FocusBlurShape, FocusBlurShape::Circle, "The blur shape.",
 | 
					    highlight_threshold_high: f64, 1.0,
 | 
				
			||||||
    x: f64, 0.5, "The X coordinate for the center of the blur.",
 | 
					    /// Highlight threshold (low).
 | 
				
			||||||
    y: f64, 0.5, "The Y coordinate for the center of the blur.",
 | 
					    highlight_threshold_low: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Generate more accurate and consistent output.
 | 
				
			||||||
 | 
					    high_quality: bool, false,
 | 
				
			||||||
 | 
					    /// The focus region's transition midpoint.
 | 
				
			||||||
 | 
					    midpoint: f64, 0.5,
 | 
				
			||||||
 | 
					    /// The focus region's outer radius.
 | 
				
			||||||
 | 
					    radius: f64, 0.75,
 | 
				
			||||||
 | 
					    /// The rotation of the focus region.
 | 
				
			||||||
 | 
					    rotation: f64, 0.0,
 | 
				
			||||||
 | 
					    /// The blur shape.
 | 
				
			||||||
 | 
					    shape: FocusBlurShape, FocusBlurShape::Circle,
 | 
				
			||||||
 | 
					    /// The X coordinate for the center of the blur.
 | 
				
			||||||
 | 
					    x: f64, 0.5,
 | 
				
			||||||
 | 
					    /// The Y coordinate for the center of the blur.
 | 
				
			||||||
 | 
					    y: f64, 0.5,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -106,13 +152,20 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "maze",
 | 
					  gegl_name: "maze",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    algorithm_type: MazeAlgorithmType, MazeAlgorithmType::DepthFirst, "Maze algorithm type",
 | 
					    /// Maze algorithm type
 | 
				
			||||||
    bg_color: String, "#fff".to_string(), "The background color.",
 | 
					    algorithm_type: MazeAlgorithmType, MazeAlgorithmType::DepthFirst,
 | 
				
			||||||
    fg_color: String, "#000".to_string(), "The foreground color.",
 | 
					    /// The background color.
 | 
				
			||||||
    seed: f64, 0.0, "The random seed.",
 | 
					    bg_color: String, "#fff".to_string(),
 | 
				
			||||||
    tileable: bool, false, "Whether the maze should be tileable.",
 | 
					    /// The foreground color.
 | 
				
			||||||
    x: i64, 16, "Horizontal width of cells pixels.",
 | 
					    fg_color: String, "#000".to_string(),
 | 
				
			||||||
    y: i64, 16, "Vertical width of cells pixels.",
 | 
					    /// The random seed.
 | 
				
			||||||
 | 
					    seed: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Whether the maze should be tileable.
 | 
				
			||||||
 | 
					    tileable: bool, false,
 | 
				
			||||||
 | 
					    /// Horizontal width of cells pixels.
 | 
				
			||||||
 | 
					    x: i64, 16,
 | 
				
			||||||
 | 
					    /// Vertical width of cells pixels.
 | 
				
			||||||
 | 
					    y: i64, 16,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -121,12 +174,19 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "median-blur",
 | 
					  gegl_name: "median-blur",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    abyss_policy: MedianBlurAbyssPolicy, MedianBlurAbyssPolicy::Clamp, "How image edges are handled.",
 | 
					    /// How image edges are handled.
 | 
				
			||||||
    alpha_percentile: f64, 50.0, "Neighborhood alpha percentile.",
 | 
					    abyss_policy: MedianBlurAbyssPolicy, MedianBlurAbyssPolicy::Clamp,
 | 
				
			||||||
    high_precision: bool, false, "Avoid clipping and quantization",
 | 
					    /// Neighborhood alpha percentile.
 | 
				
			||||||
    neighborhood: MedianBlurNeighborhood, MedianBlurNeighborhood::Circle, "Neighborhood type.",
 | 
					    alpha_percentile: f64, 50.0,
 | 
				
			||||||
    percentile: f64, 50.0, "Neighborhood color percentile.",
 | 
					    /// Avoid clipping and quantization
 | 
				
			||||||
    radius: f64, 3.0, "Neighborhood radius, a negative value will calculate with inverted percentiles.",
 | 
					    high_precision: bool, false,
 | 
				
			||||||
 | 
					    /// Neighborhood type.
 | 
				
			||||||
 | 
					    neighborhood: MedianBlurNeighborhood, MedianBlurNeighborhood::Circle,
 | 
				
			||||||
 | 
					    /// Neighborhood color percentile.
 | 
				
			||||||
 | 
					    percentile: f64, 50.0,
 | 
				
			||||||
 | 
					    /// Neighborhood radius, a negative value will calculate with inverted
 | 
				
			||||||
 | 
					    /// percentiles.
 | 
				
			||||||
 | 
					    radius: f64, 3.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -135,19 +195,32 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "mirrors",
 | 
					  gegl_name: "mirrors",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    clip: bool, true, "Clip result to input size.",
 | 
					    /// Clip result to input size.
 | 
				
			||||||
    c_x: f64, 0.5, "X coordinate of symmetry center in output.",
 | 
					    clip: bool, true,
 | 
				
			||||||
    c_y: f64, 0.5, "Y coordinate of symmetry center in output.",
 | 
					    /// X coordinate of symmetry center in output.
 | 
				
			||||||
    input_scale: f64, 100.0, "Scale factor to make rendering size bigger.",
 | 
					    c_x: f64, 0.5,
 | 
				
			||||||
    m_angle: f64, 0.0, "Rotation applied to the mirrors.",
 | 
					    /// Y coordinate of symmetry center in output.
 | 
				
			||||||
    n_segs: i64, 6, "Number of mirrors to use.",
 | 
					    c_y: f64, 0.5,
 | 
				
			||||||
    output_scale: f64, 1.0, "Scale factor to make rendering size bigger.",
 | 
					    /// Scale factor to make rendering size bigger.
 | 
				
			||||||
    o_x: f64, 0.0, "X axis ratio for the center of mirroring",
 | 
					    input_scale: f64, 100.0,
 | 
				
			||||||
    o_y: f64, 0.0, "Y axis ratio for the center of mirroring",
 | 
					    /// Rotation applied to the mirrors.
 | 
				
			||||||
    r_angle: f64, 0.0, "Rotation applied to the result.",
 | 
					    m_angle: f64, 0.0,
 | 
				
			||||||
    trim_x: f64, 0.0, "X axis ratio for trimming mirror expanse",
 | 
					    /// Number of mirrors to use.
 | 
				
			||||||
    trim_y: f64, 0.0, "Y axis ratio for trimming mirror expanse",
 | 
					    n_segs: i64, 6,
 | 
				
			||||||
    warp: bool, true, "Fill full output area.",
 | 
					    /// Scale factor to make rendering size bigger.
 | 
				
			||||||
 | 
					    output_scale: f64, 1.0,
 | 
				
			||||||
 | 
					    /// X axis ratio for the center of mirroring
 | 
				
			||||||
 | 
					    o_x: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Y axis ratio for the center of mirroring
 | 
				
			||||||
 | 
					    o_y: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Rotation applied to the result.
 | 
				
			||||||
 | 
					    r_angle: f64, 0.0,
 | 
				
			||||||
 | 
					    /// X axis ratio for trimming mirror expanse
 | 
				
			||||||
 | 
					    trim_x: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Y axis ratio for trimming mirror expanse
 | 
				
			||||||
 | 
					    trim_y: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Fill full output area.
 | 
				
			||||||
 | 
					    warp: bool, true,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -156,20 +229,34 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "mosaic",
 | 
					  gegl_name: "mosaic",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    antialiasing: bool, true, "Enables smoother tile output.",
 | 
					    /// Enables smoother tile output.
 | 
				
			||||||
    color_averaging: bool, true, "Tile color based on average of subsumed pixels.",
 | 
					    antialiasing: bool, true,
 | 
				
			||||||
    color_variation: f64, 0.2, "Magnitude of random color variations.",
 | 
					    /// Tile color based on average of subsumed pixels.
 | 
				
			||||||
    joints_color: String, "#000".to_string(), "Joints color.",
 | 
					    color_averaging: bool, true,
 | 
				
			||||||
    light_color: String, "#fff".to_string(), "Light color.",
 | 
					    /// Magnitude of random color variations.
 | 
				
			||||||
    light_dir: f64, 135.0, "Direction of light-source (in degrees).",
 | 
					    color_variation: f64, 0.2,
 | 
				
			||||||
    seed: f64, 0.0, "Random seed.",
 | 
					    /// Joints color.
 | 
				
			||||||
    tile_allow_split: bool, true, "Allows splitting tiles at hard edges.",
 | 
					    joints_color: String, "#000".to_string(),
 | 
				
			||||||
    tile_height: f64, 4.0, "Apparent height of each tile (in pixels).",
 | 
					    /// Light color.
 | 
				
			||||||
    tile_neatness: f64, 0.65, "Deviation from perfectly formed tiles.",
 | 
					    light_color: String, "#fff".to_string(),
 | 
				
			||||||
    tile_size: f64, 15.0, "Average diameter of each tile (in pixels).",
 | 
					    /// Direction of light-source (in degrees).
 | 
				
			||||||
    tile_spacing: f64, 1.0, "Inter-tile spacing (in pixels).",
 | 
					    light_dir: f64, 135.0,
 | 
				
			||||||
    tile_surface: bool, false, "Surface characteristics.",
 | 
					    /// Random seed.
 | 
				
			||||||
    tile_type: MosaicTileType, MosaicTileType::Hexagons, "What shape to use for tiles.",
 | 
					    seed: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Allows splitting tiles at hard edges.
 | 
				
			||||||
 | 
					    tile_allow_split: bool, true,
 | 
				
			||||||
 | 
					    /// Apparent height of each tile (in pixels).
 | 
				
			||||||
 | 
					    tile_height: f64, 4.0,
 | 
				
			||||||
 | 
					    /// Deviation from perfectly formed tiles.
 | 
				
			||||||
 | 
					    tile_neatness: f64, 0.65,
 | 
				
			||||||
 | 
					    /// Average diameter of each tile (in pixels).
 | 
				
			||||||
 | 
					    tile_size: f64, 15.0,
 | 
				
			||||||
 | 
					    /// Inter-tile spacing (in pixels).
 | 
				
			||||||
 | 
					    tile_spacing: f64, 1.0,
 | 
				
			||||||
 | 
					    /// Surface characteristics.
 | 
				
			||||||
 | 
					    tile_surface: bool, false,
 | 
				
			||||||
 | 
					    /// What shape to use for tiles.
 | 
				
			||||||
 | 
					    tile_type: MosaicTileType, MosaicTileType::Hexagons,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -178,24 +265,49 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "newsprint",
 | 
					  gegl_name: "newsprint",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    aa_samples: i64, 16, "Number of samples that are averaged for antialiasing the result.",
 | 
					    /// Number of samples that are averaged for antialiasing the result.
 | 
				
			||||||
    angle: f64, 75.0, "Black angle.",
 | 
					    aa_samples: i64, 16,
 | 
				
			||||||
    angle2: f64, 15.0, "Red and cyan angle.",
 | 
					    /// Black angle.
 | 
				
			||||||
    angle3: f64, 45.0, "Green and magenta angle.",
 | 
					    angle: f64, 75.0,
 | 
				
			||||||
    angle4: f64, 0.0, "Blue and yellow angle.",
 | 
					    /// Red and cyan angle.
 | 
				
			||||||
    angleboost: f64, 0.0, "Multiplication factor for desired rotation of the local space for texture, the way this is computed makes it weak for desaturated colors and possibly stronger where there is color.",
 | 
					    angle2: f64, 15.0,
 | 
				
			||||||
    black_pullout: f64, 1.0, "How much of common gray to pull out of CMY.",
 | 
					    /// Green and magenta angle.
 | 
				
			||||||
    blocksize: f64, -1.0, "Number of periods per tile, this tiling avoids high frequency anomaly that angle boost causes.",
 | 
					    angle3: f64, 45.0,
 | 
				
			||||||
    color_model: NewsprintColorModel, NewsprintColorModel::BlackOnWhite, "How many inks to use.",
 | 
					    /// Blue and yellow angle.
 | 
				
			||||||
    pattern: NewsprintPattern, NewsprintPattern::Line, "Black halftoning/dot pattern to use.",
 | 
					    angle4: f64, 0.0,
 | 
				
			||||||
    pattern2: NewsprintPattern, NewsprintPattern::Line, "Red and cyan halftoning/dot pattern to use.",
 | 
					    /// Multiplication factor for desired rotation of the local space for
 | 
				
			||||||
    pattern3: NewsprintPattern, NewsprintPattern::Line, "Green and magenta halftoning/dot pattern to use.",
 | 
					    /// texture, the way this is computed makes it weak for desaturated colors
 | 
				
			||||||
    pattern4: NewsprintPattern, NewsprintPattern::Line, "Blue and yellow halftoning/dot pattern to use.",
 | 
					    /// and possibly stronger where there is color.
 | 
				
			||||||
    period: f64, 12.0, "Black number of pixels across one repetition of a base pattern at base resolution.",
 | 
					    angleboost: f64, 0.0,
 | 
				
			||||||
    period2: f64, 12.0, "Red and cyan number of pixels across one repetition of a base pattern at base resolution.",
 | 
					    /// How much of common gray to pull out of CMY.
 | 
				
			||||||
    period3: f64, 12.0, "Green and magenta number of pixels across one repetition of a base pattern at base resolution.",
 | 
					    black_pullout: f64, 1.0,
 | 
				
			||||||
    period4: f64, 12.0, "Blue and yellow number of pixels across one repetition of a base pattern at base resolution.",
 | 
					    /// Number of periods per tile, this tiling avoids high frequency anomaly
 | 
				
			||||||
    turbulence: f64, 0.0, "Color saturation dependent compression of period.",
 | 
					    /// that angle boost causes.
 | 
				
			||||||
 | 
					    blocksize: f64, -1.0,
 | 
				
			||||||
 | 
					    /// How many inks to use.
 | 
				
			||||||
 | 
					    color_model: NewsprintColorModel, NewsprintColorModel::BlackOnWhite,
 | 
				
			||||||
 | 
					    /// Black halftoning/dot pattern to use.
 | 
				
			||||||
 | 
					    pattern: NewsprintPattern, NewsprintPattern::Line,
 | 
				
			||||||
 | 
					    /// Red and cyan halftoning/dot pattern to use.
 | 
				
			||||||
 | 
					    pattern2: NewsprintPattern, NewsprintPattern::Line,
 | 
				
			||||||
 | 
					    /// Green and magenta halftoning/dot pattern to use.
 | 
				
			||||||
 | 
					    pattern3: NewsprintPattern, NewsprintPattern::Line,
 | 
				
			||||||
 | 
					    /// Blue and yellow halftoning/dot pattern to use.
 | 
				
			||||||
 | 
					    pattern4: NewsprintPattern, NewsprintPattern::Line,
 | 
				
			||||||
 | 
					    /// Black number of pixels across one repetition of a base pattern at base
 | 
				
			||||||
 | 
					    /// resolution.
 | 
				
			||||||
 | 
					    period: f64, 12.0,
 | 
				
			||||||
 | 
					    /// Red and cyan number of pixels across one repetition of a base pattern at
 | 
				
			||||||
 | 
					    /// base resolution.
 | 
				
			||||||
 | 
					    period2: f64, 12.0,
 | 
				
			||||||
 | 
					    /// Green and magenta number of pixels across one repetition of a base pattern
 | 
				
			||||||
 | 
					    /// at base resolution.
 | 
				
			||||||
 | 
					    period3: f64, 12.0,
 | 
				
			||||||
 | 
					    /// Blue and yellow number of pixels across one repetition of a base pattern
 | 
				
			||||||
 | 
					    /// at base resolution.
 | 
				
			||||||
 | 
					    period4: f64, 12.0,
 | 
				
			||||||
 | 
					    /// Color saturation dependent compression of period.
 | 
				
			||||||
 | 
					    turbulence: f64, 0.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -204,9 +316,12 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "noise-pick",
 | 
					  gegl_name: "noise-pick",
 | 
				
			||||||
  append_crop: true,
 | 
					  append_crop: true,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    pct_random: f64, 50.0, "Randomization percentage.",
 | 
					    /// Randomization percentage.
 | 
				
			||||||
    repeat: i64, 1, "Amount of repetitions to make.",
 | 
					    pct_random: f64, 50.0,
 | 
				
			||||||
    seed: f64, 0.0, "Random seed.",
 | 
					    /// Amount of repetitions to make.
 | 
				
			||||||
 | 
					    repeat: i64, 1,
 | 
				
			||||||
 | 
					    /// Random seed.
 | 
				
			||||||
 | 
					    seed: f64, 0.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -215,10 +330,14 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "oilify",
 | 
					  gegl_name: "oilify",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    exponent: i64, 8, "Exponent for processing, controls smoothness.",
 | 
					    /// Exponent for processing, controls smoothness.
 | 
				
			||||||
    intensities: i64, 128, "Histogram size.",
 | 
					    exponent: i64, 8,
 | 
				
			||||||
    mask_radius: i64, 4, "Radius of circle around pixel.",
 | 
					    /// Histogram size.
 | 
				
			||||||
    use_inten: bool, true, "Use pixel luminance values.",
 | 
					    intensities: i64, 128,
 | 
				
			||||||
 | 
					    /// Radius of circle around pixel.
 | 
				
			||||||
 | 
					    mask_radius: i64, 4,
 | 
				
			||||||
 | 
					    /// Use pixel luminance values.
 | 
				
			||||||
 | 
					    use_inten: bool, true,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -227,12 +346,18 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "plasma",
 | 
					  gegl_name: "plasma",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    height: i64, 768, "Height of the generated buffer",
 | 
					    /// Height of the generated buffer.
 | 
				
			||||||
    seed: f64, 0.0, "Random seed.",
 | 
					    height: i64, 768,
 | 
				
			||||||
    turbulence: f64, 1.0, "High values give more variation in details.",
 | 
					    /// Random seed.
 | 
				
			||||||
    width: i64, 1024, "Width of the generated buffer.",
 | 
					    seed: f64, 0.0,
 | 
				
			||||||
    x: i64, 0, "X coordinate start of the generated buffer.",
 | 
					    /// High values give more variation in details.
 | 
				
			||||||
    y: i64, 0, "Y coordinate start of the generated buffer.",
 | 
					    turbulence: f64, 1.0,
 | 
				
			||||||
 | 
					    /// Width of the generated buffer.
 | 
				
			||||||
 | 
					    width: i64, 1024,
 | 
				
			||||||
 | 
					    /// X coordinate start of the generated buffer.
 | 
				
			||||||
 | 
					    x: i64, 0,
 | 
				
			||||||
 | 
					    /// Y coordinate start of the generated buffer.
 | 
				
			||||||
 | 
					    y: i64, 0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -241,9 +366,12 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "simplex-noise",
 | 
					  gegl_name: "simplex-noise",
 | 
				
			||||||
  append_crop: true,
 | 
					  append_crop: true,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    iterations: i64, 1, "The number of noise octaves.",
 | 
					    /// The number of noise octaves.
 | 
				
			||||||
    scale: f64, 1.0, "The scale of the noise function.",
 | 
					    iterations: i64, 1,
 | 
				
			||||||
    seed: f64, 1.0, "The random seed for the noise function.",
 | 
					    /// The scale of the noise function.
 | 
				
			||||||
 | 
					    scale: f64, 1.0,
 | 
				
			||||||
 | 
					    /// The random seed for the noise function.
 | 
				
			||||||
 | 
					    seed: f64, 1.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -252,9 +380,12 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "softglow",
 | 
					  gegl_name: "softglow",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    brightness: f64, 0.3, "Brightness intensity.",
 | 
					    /// Brightness intensity.
 | 
				
			||||||
    glow_radius: f64, 10.0, "Glow radius.",
 | 
					    brightness: f64, 0.3,
 | 
				
			||||||
    sharpness: f64, 0.85, "Sharpness of the highlights.",
 | 
					    /// Glow radius.
 | 
				
			||||||
 | 
					    glow_radius: f64, 10.0,
 | 
				
			||||||
 | 
					    /// Sharpness of the highlights.
 | 
				
			||||||
 | 
					    sharpness: f64, 0.85,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -263,14 +394,22 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "stereographic-projection",
 | 
					  gegl_name: "stereographic-projection",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    height: i64, -1, "Output/rendering height in pixels, -1 for input height.",
 | 
					    /// Output/rendering height in pixels, -1 for input height.
 | 
				
			||||||
    inverse: bool, false, "Do the inverse mapping.",
 | 
					    height: i64, -1,
 | 
				
			||||||
    pan: f64, 0.0, "Horizontal camera panning.",
 | 
					    /// Do the inverse mapping.
 | 
				
			||||||
    sampler_type: StereographicProjectionSamplerType, StereographicProjectionSamplerType::Nearest, "Image resampling method to use.",
 | 
					    inverse: bool, false,
 | 
				
			||||||
    spin: f64, 0., "Spin angle around camera axis.",
 | 
					    /// Horizontal camera panning.
 | 
				
			||||||
    tilt: f64, 90., "Vertical camera panning.",
 | 
					    pan: f64, 0.0,
 | 
				
			||||||
    width: i64, -1, "Output/rendering width in pixels, -1 for input width.",
 | 
					    /// Image resampling method to use.
 | 
				
			||||||
    zoom: f64, 100.0, "Zoom level.",
 | 
					    sampler_type: StereographicProjectionSamplerType, StereographicProjectionSamplerType::Nearest,
 | 
				
			||||||
 | 
					    /// Spin angle around camera axis.
 | 
				
			||||||
 | 
					    spin: f64, 0.,
 | 
				
			||||||
 | 
					    /// Vertical camera panning.
 | 
				
			||||||
 | 
					    tilt: f64, 90.,
 | 
				
			||||||
 | 
					    /// Output/rendering width in pixels, -1 for input width.
 | 
				
			||||||
 | 
					    width: i64, -1,
 | 
				
			||||||
 | 
					    /// Zoom level.
 | 
				
			||||||
 | 
					    zoom: f64, 100.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -279,8 +418,10 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "tile-glass",
 | 
					  gegl_name: "tile-glass",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    tile_height: i64, 25, "Tile height.",
 | 
					    /// Tile height.
 | 
				
			||||||
    tile_width: i64, 25, "Tile width.",
 | 
					    tile_height: i64, 25,
 | 
				
			||||||
 | 
					    /// Tile width.
 | 
				
			||||||
 | 
					    tile_width: i64, 25,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -296,10 +437,15 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "waterpixels",
 | 
					  gegl_name: "waterpixels",
 | 
				
			||||||
  append_crop: false,
 | 
					  append_crop: false,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    fill: WaterpixelsFill, WaterpixelsFill::Average, "How to fill superpixels.",
 | 
					    /// How to fill superpixels.
 | 
				
			||||||
    regularization: i64, 0, "Spatial regularization, trade-off between superpixel regularity and adherence to object boundaries.",
 | 
					    fill: WaterpixelsFill, WaterpixelsFill::Average,
 | 
				
			||||||
    size: i64, 32, "Superpixels size.",
 | 
					    /// Spatial regularization, trade-off between superpixel regularity and
 | 
				
			||||||
    smoothness: f64, 1.0, "Gradient smoothness.",
 | 
					    /// adherence to object boundaries.
 | 
				
			||||||
 | 
					    regularization: i64, 0,
 | 
				
			||||||
 | 
					    /// Superpixels size.
 | 
				
			||||||
 | 
					    size: i64, 32,
 | 
				
			||||||
 | 
					    /// Gradient smoothness.
 | 
				
			||||||
 | 
					    smoothness: f64, 1.0,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -308,13 +454,21 @@ gegl_operation!(
 | 
				
			||||||
  gegl_name: "waves",
 | 
					  gegl_name: "waves",
 | 
				
			||||||
  append_crop: true,
 | 
					  append_crop: true,
 | 
				
			||||||
  values: (
 | 
					  values: (
 | 
				
			||||||
    amplitude: f64, 25.0, "Amplitude of the wave ripples.",
 | 
					    /// Amplitude of the wave ripples.
 | 
				
			||||||
    aspect: f64, 1.0, "Aspect ratio.",
 | 
					    amplitude: f64, 25.0,
 | 
				
			||||||
    clamp: bool, false, "Limit deformation in the image area.",
 | 
					    /// Aspect ratio.
 | 
				
			||||||
    period: f64, 100.0, "Period/wavelength of the ripples.",
 | 
					    aspect: f64, 1.0,
 | 
				
			||||||
    phi: f64, 0.0, "Phase shift of the waves.",
 | 
					    /// Limit deformation in the image area.
 | 
				
			||||||
    sampler_type: WavesSamplerType, WavesSamplerType::Cubic, "Mathematical method for reconstructing pixel values.",
 | 
					    clamp: bool, false,
 | 
				
			||||||
    x: f64, 0.5, "Center X coordinate to start the waves from.",
 | 
					    /// Period/wavelength of the ripples.
 | 
				
			||||||
    y: f64, 0.5, "Center Y coordinate to start the waves from.",
 | 
					    period: f64, 100.0,
 | 
				
			||||||
 | 
					    /// Phase shift of the waves.
 | 
				
			||||||
 | 
					    phi: f64, 0.0,
 | 
				
			||||||
 | 
					    /// Mathematical method for reconstructing pixel values.
 | 
				
			||||||
 | 
					    sampler_type: WavesSamplerType, WavesSamplerType::Cubic,
 | 
				
			||||||
 | 
					    /// Center X coordinate to start the waves from.
 | 
				
			||||||
 | 
					    x: f64, 0.5,
 | 
				
			||||||
 | 
					    /// Center Y coordinate to start the waves from.
 | 
				
			||||||
 | 
					    y: f64, 0.5,
 | 
				
			||||||
  ),
 | 
					  ),
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in New Issue