Skip to content

Commit 6385a01

Browse files
author
Wayfarer
committed
add more facade
1 parent 7298154 commit 6385a01

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

Imaging/ImagingFacade.cs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,20 @@ public static Bitmap Crop(Bitmap image, int x, int y, int width, int height)
201201
=> new ImageRender().FilterImage(image, filter);
202202

203203
/// <summary>
204-
/// Applies a filter to a specified area of the bitmap with optional shape masking.
204+
/// Applies a filter to a specified area of the bitmap with optional shape masking.
205205
/// </summary>
206206
/// <param name="image">The source bitmap.</param>
207207
/// <param name="filter">The filter type.</param>
208208
/// <param name="shape">The mask shape.</param>
209209
/// <param name="shapeParams">Optional parameters for the mask shape.</param>
210210
/// <param name="startPoint">Optional start point for the filter.</param>
211-
/// <returns>The filtered <see cref="Bitmap"/>.</returns>
212-
public static Bitmap ApplyFilterArea(Bitmap image, FiltersType filter, MaskShape shape, object shapeParams,
211+
/// <returns>
212+
/// The filtered <see cref="Bitmap" />.
213+
/// </returns>
214+
215+
public static Bitmap? ApplyFilterArea(Bitmap image, FiltersType filter, MaskShape shape, object? shapeParams = null,
213216
Point? startPoint = null)
214-
=> new ImageRender().FilterImageArea(image, null, null, filter, shape, shapeParams, startPoint);
217+
=> new FilterGenerator().GenerateFilterOverlay(image, image.Width, image.Height, filter, shape, startPoint, shapeParams);
215218

216219
#endregion
217220

@@ -340,6 +343,21 @@ public static void CreateGif(IEnumerable<FrameInfo>? frames, string target)
340343

341344
#region Textures
342345

346+
/// <summary>
347+
/// Generates a standalone procedural texture.
348+
/// </summary>
349+
/// <param name="image">The image.</param>
350+
/// <param name="type">The type.</param>
351+
/// <param name="shape">The shape.</param>
352+
/// <param name="shapeParams">The shape parameters.</param>
353+
/// <param name="startPoint">The start point.</param>
354+
/// <returns>
355+
/// The generated texture as a <see cref="Bitmap" />.
356+
/// </returns>
357+
public static Bitmap? GenerateTextureOverlay(Bitmap image, TextureType type, MaskShape shape,
358+
object? shapeParams = null, Point? startPoint = null)
359+
=> new TextureGenerator().GenerateTextureOverlay(image, image.Width, image.Height, type, shape, startPoint, shapeParams);
360+
343361
/// <summary>
344362
/// Generates a procedural texture using the specified type, mask shape, and parameters.
345363
/// </summary>

0 commit comments

Comments
 (0)