/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <param name="source">The image this method extends.</param> /// <param name="options">The options effecting things like blending.</param> /// <param name="color">The color to set as the glow.</param> /// <param name="radius">The the radius.</param> /// <param name="rectangle"> /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter. /// </param> /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns> public static IImageProcessingContext Glow( this IImageProcessingContext source, GraphicsOptions options, Color color, float radius, Rectangle rectangle) => source.Glow(options, color, ValueSize.Absolute(radius), rectangle);
protected override void Apply(IImageProcessingContext ctx, Rectangle rect) => ctx.Glow(rect);
protected override void Apply(IImageProcessingContext ctx, float radiusX, float radiusY) => ctx.Glow(radiusX);
protected override void Apply(IImageProcessingContext ctx, Color color) => ctx.Glow(color);
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <typeparam name="TPixel">The pixel format.</typeparam> /// <param name="source">The image this method extends.</param> /// <param name="options">The options effecting things like blending.</param> /// <param name="color">The color to set as the glow.</param> /// <returns>The <see cref="Image{TPixel}"/>.</returns> public static IImageProcessingContext <TPixel> Glow <TPixel>(this IImageProcessingContext <TPixel> source, GraphicsOptions options, TPixel color) where TPixel : struct, IPixel <TPixel> => source.Glow(options, color, ValueSize.PercentageOfWidth(0.5f));
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <typeparam name="TPixel">The pixel format.</typeparam> /// <param name="source">The image this method extends.</param> /// <param name="color">The color to set as the glow.</param> /// <param name="radius">The the radius.</param> /// <param name="rectangle"> /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter. /// </param> /// <returns>The <see cref="Image{TPixel}"/>.</returns> public static IImageProcessingContext <TPixel> Glow <TPixel>(this IImageProcessingContext <TPixel> source, TPixel color, float radius, Rectangle rectangle) where TPixel : struct, IPixel <TPixel> => source.Glow(GraphicsOptions.Default, color, ValueSize.Absolute(radius), rectangle);
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <typeparam name="TPixel">The pixel format.</typeparam> /// <param name="source">The image this method extends.</param> /// <param name="rectangle"> /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter. /// </param> /// <returns>The <see cref="Image{TPixel}"/>.</returns> public static IImageProcessingContext <TPixel> Glow <TPixel>(this IImageProcessingContext <TPixel> source, Rectangle rectangle) where TPixel : struct, IPixel <TPixel> => source.Glow(GraphicsOptions.Default, rectangle);
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <typeparam name="TPixel">The pixel format.</typeparam> /// <param name="source">The image this method extends.</param> /// <param name="options">The options effecting things like blending.</param> /// <param name="rectangle"> /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter. /// </param> /// <returns>The <see cref="Image{TPixel}"/>.</returns> public static IImageProcessingContext <TPixel> Glow <TPixel>(this IImageProcessingContext <TPixel> source, GraphicsOptions options, Rectangle rectangle) where TPixel : struct, IPixel <TPixel> => source.Glow(options, NamedColors <TPixel> .Black, ValueSize.PercentageOfWidth(0.5f), rectangle);
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <typeparam name="TPixel">The pixel format.</typeparam> /// <param name="source">The image this method extends.</param> /// <param name="options">The options effecting things like blending.</param> /// <param name="radius">The the radius.</param> /// <returns>The <see cref="Image{TPixel}"/>.</returns> public static IImageProcessingContext <TPixel> Glow <TPixel>(this IImageProcessingContext <TPixel> source, GraphicsOptions options, float radius) where TPixel : struct, IPixel <TPixel> => source.Glow(options, NamedColors <TPixel> .Black, ValueSize.Absolute(radius));
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <param name="source">The image this method extends.</param> /// <param name="options">The options effecting things like blending.</param> /// <param name="color">The color to set as the glow.</param> /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns> public static IImageProcessingContext Glow( this IImageProcessingContext source, GraphicsOptions options, Color color) => source.Glow(options, color, ValueSize.PercentageOfWidth(0.5f));
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <param name="source">The image this method extends.</param> /// <param name="rectangle"> /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter. /// </param> /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns> public static IImageProcessingContext Glow(this IImageProcessingContext source, Rectangle rectangle) => source.Glow(new GraphicsOptions(), rectangle);
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <param name="source">The image this method extends.</param> /// <param name="options">The options effecting things like blending.</param> /// <param name="rectangle"> /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter. /// </param> /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns> public static IImageProcessingContext Glow( this IImageProcessingContext source, GraphicsOptions options, Rectangle rectangle) => source.Glow(options, Color.Black, ValueSize.PercentageOfWidth(0.5f), rectangle);
/// <summary> /// Applies a radial glow effect to an image. /// </summary> /// <param name="source">The image this method extends.</param> /// <param name="options">The options effecting things like blending.</param> /// <param name="radius">The the radius.</param> /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns> public static IImageProcessingContext Glow( this IImageProcessingContext source, GraphicsOptions options, float radius) => source.Glow(options, Color.Black, ValueSize.Absolute(radius));
protected override void Apply <T>(IImageProcessingContext <T> ctx, T color) => ctx.Glow(color);