public void Brightness_amount_BrightnessProcessorDefaultsSet() { this.operations.Brightness(1.5F); BrightnessProcessor <Rgba32> processor = this.Verify <BrightnessProcessor <Rgba32> >(); Assert.Equal(1.5F, processor.Amount); }
public void Brightness_amount_rect_BrightnessProcessorDefaultsSet() { this.operations.Brightness(1.5F, this.rect); BrightnessProcessor processor = this.Verify <BrightnessProcessor>(this.rect); Assert.Equal(1.5F, processor.Amount); }
/// <summary> /// Alters the brightness component of the image. /// </summary> /// <typeparam name="T">The pixel format.</typeparam> /// <typeparam name="TP">The packed format. <example>long, float.</example></typeparam> /// <param name="source">The image this method extends.</param> /// <param name="amount">The new brightness of the image. Must be between -100 and 100.</param> /// <param name="rectangle"> /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter. /// </param> /// <param name="progressHandler">A delegate which is called as progress is made processing the image.</param> /// <returns>The <see cref="Image{T,TP}"/>.</returns> public static Image <T, TP> Brightness <T, TP>(this Image <T, TP> source, int amount, Rectangle rectangle, ProgressEventHandler progressHandler = null) where T : IPackedVector <TP> where TP : struct { BrightnessProcessor <T, TP> processor = new BrightnessProcessor <T, TP>(amount); processor.OnProgress += progressHandler; try { return(source.Process(rectangle, processor)); } finally { processor.OnProgress -= progressHandler; } }