Browse Source

Move drawing files into structured folders

pull/486/head
James Jackson-South 8 years ago
parent
commit
e1c258d3bf
  1. 0
      src/ImageSharp.Drawing/Drawing/Brushes/Brushes.cs
  2. 0
      src/ImageSharp.Drawing/Drawing/Brushes/IBrush.cs
  3. 5
      src/ImageSharp.Drawing/Drawing/Brushes/ImageBrush{TPixel}.cs
  4. 0
      src/ImageSharp.Drawing/Drawing/Brushes/PatternBrush{TPixel}.cs
  5. 10
      src/ImageSharp.Drawing/Drawing/Brushes/Processors/BrushApplicator.cs
  6. 21
      src/ImageSharp.Drawing/Drawing/Brushes/RecolorBrush{TPixel}.cs
  7. 3
      src/ImageSharp.Drawing/Drawing/Brushes/SolidBrush{TPixel}.cs
  8. 0
      src/ImageSharp.Drawing/Drawing/Pens/IPen.cs
  9. 0
      src/ImageSharp.Drawing/Drawing/Pens/Pens.cs
  10. 2
      src/ImageSharp.Drawing/Drawing/Pens/Pen{TPixel}.cs
  11. 2
      src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
  12. 3
      src/ImageSharp.Drawing/Primitives/Region.cs
  13. 0
      src/ImageSharp.Drawing/Processing/Overlays/DrawImage.cs
  14. 1
      src/ImageSharp.Drawing/Processing/Overlays/FillRegion.cs
  15. 0
      src/ImageSharp.Drawing/Processing/Overlays/Processors/DrawImageProcessor.cs
  16. 0
      src/ImageSharp.Drawing/Processing/Overlays/Processors/FillProcessor.cs
  17. 1
      src/ImageSharp.Drawing/Processing/Overlays/Processors/FillRegionProcessor.cs
  18. 4
      src/ImageSharp.Drawing/Processing/Paths/DrawBezierExtensions.cs
  19. 0
      src/ImageSharp.Drawing/Processing/Paths/DrawLines.cs
  20. 0
      src/ImageSharp.Drawing/Processing/Paths/DrawPath.cs
  21. 0
      src/ImageSharp.Drawing/Processing/Paths/DrawPathCollection.cs
  22. 0
      src/ImageSharp.Drawing/Processing/Paths/DrawPolygon.cs
  23. 0
      src/ImageSharp.Drawing/Processing/Paths/DrawRectangle.cs
  24. 0
      src/ImageSharp.Drawing/Processing/Paths/FillPathBuilder.cs
  25. 0
      src/ImageSharp.Drawing/Processing/Paths/FillPathCollection.cs
  26. 0
      src/ImageSharp.Drawing/Processing/Paths/FillPaths.cs
  27. 0
      src/ImageSharp.Drawing/Processing/Paths/FillPolygon.cs
  28. 0
      src/ImageSharp.Drawing/Processing/Paths/FillRectangle.cs
  29. 0
      src/ImageSharp.Drawing/Processing/Paths/ShapePath.cs
  30. 7
      src/ImageSharp.Drawing/Processing/Paths/ShapeRegion.cs
  31. 0
      src/ImageSharp.Drawing/Processing/Text/DrawText.Path.cs
  32. 0
      src/ImageSharp.Drawing/Processing/Text/DrawText.cs
  33. 0
      src/ImageSharp.Drawing/Processing/Text/TextGraphicsOptions.cs

0
src/ImageSharp.Drawing/Brushes/Brushes.cs → src/ImageSharp.Drawing/Drawing/Brushes/Brushes.cs

0
src/ImageSharp.Drawing/Brushes/IBrush.cs → src/ImageSharp.Drawing/Drawing/Brushes/IBrush.cs

5
src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs → src/ImageSharp.Drawing/Drawing/Brushes/ImageBrush{TPixel}.cs

@ -4,7 +4,6 @@
using System;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Drawing.Brushes.Processors;
using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
@ -43,9 +42,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
/// <inheritdoc />
public BrushApplicator<TPixel> CreateApplicator(ImageFrame<TPixel> source, RectangleF region, GraphicsOptions options)
{
return new ImageBrushApplicator(source, this.image, region, options);
}
=> new ImageBrushApplicator(source, this.image, region, options);
/// <summary>
/// The image brush applicator.

0
src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs → src/ImageSharp.Drawing/Drawing/Brushes/PatternBrush{TPixel}.cs

10
src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs → src/ImageSharp.Drawing/Drawing/Brushes/Processors/BrushApplicator.cs

@ -31,12 +31,12 @@ namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
}
/// <summary>
/// Gets the blendder
/// Gets the blender
/// </summary>
internal PixelBlender<TPixel> Blender { get; }
/// <summary>
/// Gets the destinaion
/// Gets the destination
/// </summary>
protected ImageFrame<TPixel> Target { get; }
@ -48,8 +48,8 @@ namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
/// <summary>
/// Gets the color for a single pixel.
/// </summary>
/// <param name="x">The x cordinate.</param>
/// <param name="y">The y cordinate.</param>
/// <param name="x">The x coordinate.</param>
/// <param name="y">The y coordinate.</param>
/// <returns>The a <typeparamref name="TPixel"/> that should be applied to the pixel.</returns>
internal abstract TPixel this[int x, int y] { get; }
@ -57,7 +57,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
public abstract void Dispose();
/// <summary>
/// Applies the opactiy weighting for each pixel in a scanline to the target based on the pattern contained in the brush.
/// Applies the opacity weighting for each pixel in a scanline to the target based on the pattern contained in the brush.
/// </summary>
/// <param name="scanline">The a collection of opacity values between 0 and 1 to be merged with the brushed color value before being applied to the target.</param>
/// <param name="x">The x position in the target pixel space that the start of the scanline data corresponds to.</param>

21
src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs → src/ImageSharp.Drawing/Drawing/Brushes/RecolorBrush{TPixel}.cs

@ -5,7 +5,6 @@ using System;
using System.Numerics;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Drawing.Brushes.Processors;
using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
@ -23,21 +22,18 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
/// Initializes a new instance of the <see cref="RecolorBrush{TPixel}" /> class.
/// </summary>
/// <param name="sourceColor">Color of the source.</param>
/// <param name="targeTPixel">Color of the target.</param>
/// <param name="targetColor">Color of the target.</param>
/// <param name="threshold">The threshold as a value between 0 and 1.</param>
public RecolorBrush(TPixel sourceColor, TPixel targeTPixel, float threshold)
public RecolorBrush(TPixel sourceColor, TPixel targetColor, float threshold)
{
this.SourceColor = sourceColor;
this.Threshold = threshold;
this.TargeTPixel = targeTPixel;
this.TargetColor = targetColor;
}
/// <summary>
/// Gets the threshold.
/// </summary>
/// <value>
/// The threshold.
/// </value>
public float Threshold { get; }
/// <summary>
@ -51,15 +47,12 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
/// <summary>
/// Gets the target color.
/// </summary>
/// <value>
/// The color of the target.
/// </value>
public TPixel TargeTPixel { get; }
public TPixel TargetColor { get; }
/// <inheritdoc />
public BrushApplicator<TPixel> CreateApplicator(ImageFrame<TPixel> source, RectangleF region, GraphicsOptions options)
{
return new RecolorBrushApplicator(source, this.SourceColor, this.TargeTPixel, this.Threshold, options);
return new RecolorBrushApplicator(source, this.SourceColor, this.TargetColor, this.Threshold, options);
}
/// <summary>
@ -158,8 +151,8 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
int offsetX = x + i;
// no doubt this one can be optermised further but I can't imagine its
// actually being used and can probably be removed/interalised for now
// No doubt this one can be optimized further but I can't imagine its
// actually being used and can probably be removed/internalized for now
overlaySpan[i] = this[offsetX, y];
}

3
src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs → src/ImageSharp.Drawing/Drawing/Brushes/SolidBrush{TPixel}.cs

@ -2,10 +2,9 @@
// Licensed under the Apache License, Version 2.0.
using System;
using System.Numerics;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Drawing.Brushes.Processors;
using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;

0
src/ImageSharp.Drawing/Pens/IPen.cs → src/ImageSharp.Drawing/Drawing/Pens/IPen.cs

0
src/ImageSharp.Drawing/Pens/Pens.cs → src/ImageSharp.Drawing/Drawing/Pens/Pens.cs

2
src/ImageSharp.Drawing/Pens/Pen{TPixel}.cs → src/ImageSharp.Drawing/Drawing/Pens/Pen{TPixel}.cs

@ -19,7 +19,7 @@ namespace SixLabors.ImageSharp.Drawing.Pens
/// section 1 will be width long (making a square) and will be filled by the brush
/// section 2 will be width * 2 long and will be empty
/// section 3 will be width/2 long and will be filled
/// the the pattern will imidiatly repeat without gap.
/// the the pattern will immediately repeat without gap.
/// </remarks>
public class Pen<TPixel> : IPen<TPixel>
where TPixel : struct, IPixel<TPixel>

2
src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

@ -46,7 +46,7 @@
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\ImageSharp.ruleset</CodeAnalysisRuleSet>
<RootNamespace>SixLabors.ImageSharp.Drawing</RootNamespace>
<RootNamespace>SixLabors.ImageSharp</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

3
src/ImageSharp.Drawing/Region.cs → src/ImageSharp.Drawing/Primitives/Region.cs

@ -1,10 +1,9 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using SixLabors.Primitives;
namespace SixLabors.ImageSharp.Drawing
namespace SixLabors.ImageSharp.Primitives
{
/// <summary>
/// Represents a region of an image.

0
src/ImageSharp.Drawing/DrawImage.cs → src/ImageSharp.Drawing/Processing/Overlays/DrawImage.cs

1
src/ImageSharp.Drawing/FillRegion.cs → src/ImageSharp.Drawing/Processing/Overlays/FillRegion.cs

@ -5,6 +5,7 @@ using SixLabors.ImageSharp.Drawing;
using SixLabors.ImageSharp.Drawing.Brushes;
using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Primitives;
using SixLabors.ImageSharp.Processing;
namespace SixLabors.ImageSharp

0
src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs → src/ImageSharp.Drawing/Processing/Overlays/Processors/DrawImageProcessor.cs

0
src/ImageSharp.Drawing/Processors/FillProcessor.cs → src/ImageSharp.Drawing/Processing/Overlays/Processors/FillProcessor.cs

1
src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs → src/ImageSharp.Drawing/Processing/Overlays/Processors/FillRegionProcessor.cs

@ -7,6 +7,7 @@ using SixLabors.ImageSharp.Drawing.Brushes;
using SixLabors.ImageSharp.Drawing.Brushes.Processors;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Primitives;
using SixLabors.ImageSharp.Processing.Processors;
using SixLabors.Primitives;

4
src/ImageSharp.Drawing/Paths/DrawBeziers.cs → src/ImageSharp.Drawing/Processing/Paths/DrawBezierExtensions.cs

@ -13,9 +13,9 @@ using SixLabors.Shapes;
namespace SixLabors.ImageSharp
{
/// <summary>
/// Extension methods for the <see cref="Image{TPixel}"/> type.
/// EAdds extensions that allow the drawing of Bezier paths to the <see cref="Image{TPixel}"/> type.
/// </summary>
public static partial class ImageExtensions
public static class DrawBezierExtensions
{
/// <summary>
/// Draws the provided Points as an open Bezier path at the provided thickness with the supplied brush

0
src/ImageSharp.Drawing/Paths/DrawLines.cs → src/ImageSharp.Drawing/Processing/Paths/DrawLines.cs

0
src/ImageSharp.Drawing/Paths/DrawPath.cs → src/ImageSharp.Drawing/Processing/Paths/DrawPath.cs

0
src/ImageSharp.Drawing/Paths/DrawPathCollection.cs → src/ImageSharp.Drawing/Processing/Paths/DrawPathCollection.cs

0
src/ImageSharp.Drawing/Paths/DrawPolygon.cs → src/ImageSharp.Drawing/Processing/Paths/DrawPolygon.cs

0
src/ImageSharp.Drawing/Paths/DrawRectangle.cs → src/ImageSharp.Drawing/Processing/Paths/DrawRectangle.cs

0
src/ImageSharp.Drawing/Paths/FillPathBuilder.cs → src/ImageSharp.Drawing/Processing/Paths/FillPathBuilder.cs

0
src/ImageSharp.Drawing/Paths/FillPathCollection.cs → src/ImageSharp.Drawing/Processing/Paths/FillPathCollection.cs

0
src/ImageSharp.Drawing/Paths/FillPaths.cs → src/ImageSharp.Drawing/Processing/Paths/FillPaths.cs

0
src/ImageSharp.Drawing/Paths/FillPolygon.cs → src/ImageSharp.Drawing/Processing/Paths/FillPolygon.cs

0
src/ImageSharp.Drawing/Paths/FillRectangle.cs → src/ImageSharp.Drawing/Processing/Paths/FillRectangle.cs

0
src/ImageSharp.Drawing/Paths/ShapePath.cs → src/ImageSharp.Drawing/Processing/Paths/ShapePath.cs

7
src/ImageSharp.Drawing/Paths/ShapeRegion.cs → src/ImageSharp.Drawing/Processing/Paths/ShapeRegion.cs

@ -2,9 +2,8 @@
// Licensed under the Apache License, Version 2.0.
using System;
using System.Buffers;
using System.Numerics;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.Primitives;
using SixLabors.Primitives;
using SixLabors.Shapes;
@ -48,7 +47,7 @@ namespace SixLabors.ImageSharp.Drawing
var end = new PointF(this.Bounds.Right + 1, y);
// TODO: This is a temporary workaround because of the lack of Span<T> API-s on IPath. We should use MemoryManager.Allocate() here!
PointF[] innerBuffer = new PointF[buffer.Length];
var innerBuffer = new PointF[buffer.Length];
int count = this.Shape.FindIntersections(start, end, innerBuffer, 0);
for (int i = 0; i < count; i++)

0
src/ImageSharp.Drawing/Text/DrawText.Path.cs → src/ImageSharp.Drawing/Processing/Text/DrawText.Path.cs

0
src/ImageSharp.Drawing/Text/DrawText.cs → src/ImageSharp.Drawing/Processing/Text/DrawText.cs

0
src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs → src/ImageSharp.Drawing/Processing/Text/TextGraphicsOptions.cs

Loading…
Cancel
Save