Browse Source

Processed Scott's review comment.

af/merge-core
woutware 8 years ago
parent
commit
e7f125d5fe
  1. 6
      src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs
  2. 24
      src/ImageSharp/PixelFormats/PixelBlenderMode.cs

6
src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs

@ -55,7 +55,11 @@ namespace SixLabors.ImageSharp.Processing.Drawing.Processors
var solidBrush = this.brush as SolidBrush<TPixel>; var solidBrush = this.brush as SolidBrush<TPixel>;
// If there's no reason for blending, then avoid it. // If there's no reason for blending, then avoid it.
if (solidBrush != null && this.options.BlendPercentage == 1f && solidBrush.Color.ToVector4().W == 1f) if (solidBrush != null &&
(
(this.options.BlenderMode == PixelBlenderMode.Normal && this.options.BlendPercentage == 1f && solidBrush.Color.ToVector4().W == 1f) ||
(this.options.BlenderMode == PixelBlenderMode.Over && this.options.BlendPercentage == 1f && solidBrush.Color.ToVector4().W == 1f) ||
(this.options.BlenderMode == PixelBlenderMode.Src)))
{ {
Parallel.For( Parallel.For(
minY, minY,

24
src/ImageSharp/PixelFormats/PixelBlenderMode.cs

@ -54,62 +54,62 @@ namespace SixLabors.ImageSharp.PixelFormats
HardLight, HardLight,
/// <summary> /// <summary>
/// returns the source colors /// returns the source colors.
/// </summary> /// </summary>
Src, Src,
/// <summary> /// <summary>
/// returns the source over the destination /// returns the source over the destination.
/// </summary> /// </summary>
Atop, Atop,
/// <summary> /// <summary>
/// returns the detination over the source /// returns the destination over the source.
/// </summary> /// </summary>
Over, Over,
/// <summary> /// <summary>
/// the source where the desitnation and source overlap /// The source where the destination and source overlap.
/// </summary> /// </summary>
In, In,
/// <summary> /// <summary>
/// the destination where the desitnation and source overlap /// The destination where the destination and source overlap.
/// </summary> /// </summary>
Out, Out,
/// <summary> /// <summary>
/// the destination where the source does not overlap it /// The destination where the source does not overlap it.
/// </summary> /// </summary>
Dest, Dest,
/// <summary> /// <summary>
/// the source where they dont overlap othersie dest in overlapping parts /// The source where they don't overlap othersie dest in overlapping parts.
/// </summary> /// </summary>
DestAtop, DestAtop,
/// <summary> /// <summary>
/// the destnation over the source /// The destination over the source.
/// </summary> /// </summary>
DestOver, DestOver,
/// <summary> /// <summary>
/// the destination where the desitnation and source overlap /// The destination where the destination and source overlap.
/// </summary> /// </summary>
DestIn, DestIn,
/// <summary> /// <summary>
/// the source where the desitnation and source overlap /// The source where the destination and source overlap.
/// </summary> /// </summary>
DestOut, DestOut,
/// <summary> /// <summary>
/// the clear. /// The clear.
/// </summary> /// </summary>
Clear, Clear,
/// <summary> /// <summary>
/// clear where they overlap /// Clear where they overlap.
/// </summary> /// </summary>
Xor Xor
} }

Loading…
Cancel
Save