|
|
@ -21,9 +21,9 @@ namespace ImageSharp |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|
|
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
/// <param name="percent">The new opacity of the image. Must be between 0 and 100.</param>
|
|
|
/// <param name="percent">The new opacity of the image. Must be between 0 and 1.</param>
|
|
|
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|
|
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|
|
public static Image<TPixel> Alpha<TPixel>(this Image<TPixel> source, int percent) |
|
|
public static Image<TPixel> Alpha<TPixel>(this Image<TPixel> source, float percent) |
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
{ |
|
|
{ |
|
|
return Alpha(source, percent, source.Bounds); |
|
|
return Alpha(source, percent, source.Bounds); |
|
|
@ -34,12 +34,12 @@ namespace ImageSharp |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|
|
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
/// <param name="percent">The new opacity of the image. Must be between 0 and 100.</param>
|
|
|
/// <param name="percent">The new opacity of the image. Must be between 0 and 1.</param>
|
|
|
/// <param name="rectangle">
|
|
|
/// <param name="rectangle">
|
|
|
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
|
|
|
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
|
|
|
/// </param>
|
|
|
/// </param>
|
|
|
/// <returns>The <see cref="Image"/>.</returns>
|
|
|
/// <returns>The <see cref="Image"/>.</returns>
|
|
|
public static Image<TPixel> Alpha<TPixel>(this Image<TPixel> source, int percent, Rectangle rectangle) |
|
|
public static Image<TPixel> Alpha<TPixel>(this Image<TPixel> source, float percent, Rectangle rectangle) |
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
{ |
|
|
{ |
|
|
source.ApplyProcessor(new AlphaProcessor<TPixel>(percent), rectangle); |
|
|
source.ApplyProcessor(new AlphaProcessor<TPixel>(percent), rectangle); |
|
|
|