// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageSharp { using System; using Processing; using Processing.Processors; /// /// Extension methods for the type. /// public static partial class ImageExtensions { /// /// Alters the saturation component of the image. /// /// The pixel format. /// The image this method extends. /// The new saturation of the image. Must be between -100 and 100. /// The . public static Image Saturation(this Image source, int amount) where TColor : struct, IPackedPixel, IEquatable { return Saturation(source, amount, source.Bounds); } /// /// Alters the saturation component of the image. /// /// The pixel format. /// The image this method extends. /// The new saturation of the image. Must be between -100 and 100. /// /// The structure that specifies the portion of the image object to alter. /// /// The . public static Image Saturation(this Image source, int amount, Rectangle rectangle) where TColor : struct, IPackedPixel, IEquatable { source.ApplyProcessor(new SaturationProcessor(amount), rectangle); return source; } } }