From 6cdb7fae92bd7ed21ce38f5b66ebdd54df40b093 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 2 May 2018 13:52:40 +1000 Subject: [PATCH] Delete merge conflict backup file. --- .../Drawing/Processors/FillProcessor.cs.orig | 121 ------------------ 1 file changed, 121 deletions(-) delete mode 100644 src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs.orig diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs.orig b/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs.orig deleted file mode 100644 index 7da01b24f..000000000 --- a/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs.orig +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -using System; -using System.Threading.Tasks; -using SixLabors.ImageSharp.Advanced; -using SixLabors.ImageSharp.Memory; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.Primitives; - -namespace SixLabors.ImageSharp.Processing.Drawing.Processors -{ - /// - /// Using the brush as a source of pixels colors blends the brush color with source. - /// - /// The pixel format. - internal class FillProcessor : ImageProcessor - where TPixel : struct, IPixel - { - /// - /// The brush. - /// - private readonly IBrush brush; - private readonly GraphicsOptions options; - - /// - /// Initializes a new instance of the class. - /// - /// The brush to source pixel colors from. - /// The options - public FillProcessor(IBrush brush, GraphicsOptions options) - { - this.brush = brush; - this.options = options; - } - - /// - protected override void OnFrameApply(ImageFrame source, Rectangle sourceRectangle, Configuration configuration) - { - int startX = sourceRectangle.X; - int endX = sourceRectangle.Right; - int startY = sourceRectangle.Y; - int endY = sourceRectangle.Bottom; - - // Align start/end positions. - int minX = Math.Max(0, startX); - int maxX = Math.Min(source.Width, endX); - int minY = Math.Max(0, startY); - int maxY = Math.Min(source.Height, endY); - - int width = maxX - minX; - -<<<<<<< HEAD - var solidBrush = this.brush as SolidBrush; -======= - using (IBuffer amount = source.MemoryManager.Allocate(width)) - using (BrushApplicator applicator = this.brush.CreateApplicator( - source, - sourceRectangle, - this.options)) - { - amount.Span.Fill(1f); ->>>>>>> master - - // If there's no reason for blending, then avoid it. - 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( - minY, - maxY, - configuration.ParallelOptions, - y => - { - int offsetY = y - startY; - int offsetX = minX - startX; - source.GetPixelRowSpan(y).Slice(minX, width).Fill(solidBrush.Color); - }); - } - else - { - // Reset offset if necessary. - if (minX > 0) - { - startX = 0; - } - - if (minY > 0) - { - startY = 0; - } - - using (IBuffer amount = source.MemoryManager.Allocate(width)) - using (BrushApplicator applicator = this.brush.CreateApplicator( - source, - sourceRectangle, - this.options)) - { - amount.Span.Fill(this.options.BlendPercentage); - - Parallel.For( - minY, - maxY, - configuration.ParallelOptions, - y => - { - int offsetY = y - startY; - int offsetX = minX - startX; - - applicator.Apply(amount.Span, offsetX, offsetY); - }); - } - } - } - } -} \ No newline at end of file