Browse Source

- Code style fixes

af/merge-core
Lauri Kotilainen 8 years ago
parent
commit
bf8bd6832f
  1. 1
      src/ImageSharp.Drawing/Paths/ShapePath.cs
  2. 1
      src/ImageSharp.Drawing/Paths/ShapeRegion.cs
  3. 1
      src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegImagePostProcessor.cs
  4. 1
      src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigComponent.cs
  5. 1
      src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTable.cs
  6. 1
      src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsJpegPixelArea.cs
  7. 10
      src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsQuantizationTables.cs
  8. 6
      src/ImageSharp/Formats/Png/PngEncoder.cs
  9. 1
      src/ImageSharp/Formats/Png/PngEncoderCore.cs
  10. 5
      src/ImageSharp/IImageProcessingContext{TPixel}.cs
  11. 10
      src/ImageSharp/Image/ImageFrame{TPixel}.cs
  12. 1
      src/ImageSharp/Memory/ArrayPoolMemoryManager.cs
  13. 4
      src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs
  14. 4
      src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs
  15. 1
      src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs
  16. 1
      src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs
  17. 2
      src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs
  18. 1
      src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.Weights.cs
  19. 5
      src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs
  20. 2
      src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs

1
src/ImageSharp.Drawing/Paths/ShapePath.cs

@ -18,6 +18,7 @@ namespace SixLabors.ImageSharp.Drawing
/// <summary>
/// Initializes a new instance of the <see cref="ShapePath"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="shape">The shape.</param>
/// <param name="pen">The pen to apply to the shape.</param>
// SixLabors.shape willbe moving to a Span/ReadOnlySpan based API shortly use ToArray for now.

1
src/ImageSharp.Drawing/Paths/ShapeRegion.cs

@ -20,6 +20,7 @@ namespace SixLabors.ImageSharp.Drawing
/// <summary>
/// Initializes a new instance of the <see cref="ShapeRegion"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="shape">The shape.</param>
public ShapeRegion(MemoryManager memoryManager, IPath shape)
{

1
src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegImagePostProcessor.cs

@ -44,6 +44,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Common.Decoder
/// <summary>
/// Initializes a new instance of the <see cref="JpegImagePostProcessor"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="rawJpeg">The <see cref="IRawJpegData"/> representing the uncompressed spectral Jpeg data</param>
public JpegImagePostProcessor(MemoryManager memoryManager, IRawJpegData rawJpeg)
{

1
src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigComponent.cs

@ -54,6 +54,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder
/// <summary>
/// Initializes <see cref="SpectralBlocks"/>
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="decoder">The <see cref="OrigJpegDecoderCore"/> instance</param>
public void InitializeDerivedData(MemoryManager memoryManager, OrigJpegDecoderCore decoder)
{

1
src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTable.cs

@ -20,6 +20,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
/// <summary>
/// Initializes a new instance of the <see cref="PdfJsHuffmanTable"/> struct.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="lengths">The code lengths</param>
/// <param name="values">The huffman values</param>
public PdfJsHuffmanTable(MemoryManager memoryManager, byte[] lengths, byte[] values)

1
src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsJpegPixelArea.cs

@ -27,6 +27,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
/// <summary>
/// Initializes a new instance of the <see cref="PdfJsJpegPixelArea"/> struct.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="imageWidth">The image width</param>
/// <param name="imageHeight">The image height</param>
/// <param name="numberOfComponents">The number of components</param>

10
src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsQuantizationTables.cs

@ -12,6 +12,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
/// </summary>
internal sealed class PdfJsQuantizationTables : IDisposable
{
public PdfJsQuantizationTables(MemoryManager memoryManager)
{
this.Tables = memoryManager.Allocate2D<short>(64, 4);
}
/// <summary>
/// Gets the ZigZag scan table
/// </summary>
@ -40,11 +45,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
63
};
public PdfJsQuantizationTables(MemoryManager memoryManager)
{
this.Tables = memoryManager.Allocate2D<short>(64, 4);
}
/// <summary>
/// Gets or sets the quantization tables.
/// </summary>

6
src/ImageSharp/Formats/Png/PngEncoder.cs

@ -16,11 +16,15 @@ namespace SixLabors.ImageSharp.Formats.Png
{
private readonly MemoryManager memoryManager;
/// <summary>
/// Initializes a new instance of the <see cref="PngEncoder"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
public PngEncoder(MemoryManager memoryManager)
{
this.memoryManager = memoryManager;
}
/// <summary>
/// Gets or sets a value indicating whether the metadata should be ignored when the image is being encoded.
/// </summary>

1
src/ImageSharp/Formats/Png/PngEncoderCore.cs

@ -150,6 +150,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <summary>
/// Initializes a new instance of the <see cref="PngEncoderCore"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="options">The options for influancing the encoder</param>
public PngEncoderCore(MemoryManager memoryManager, IPngEncoderOptions options)
{

5
src/ImageSharp/IImageProcessingContext{TPixel}.cs

@ -30,6 +30,11 @@ namespace SixLabors.ImageSharp
/// <returns>The current operations class to allow chaining of operations.</returns>
IImageProcessingContext<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor);
/// <summary>
/// Returns a reference to the <see cref="MemoryManager" /> used to allocate buffers
/// for this context.
/// </summary>
/// <returns>A <see cref="MemoryManager"/> to use for buffer allocations.</returns>
MemoryManager GetMemoryManager();
}

10
src/ImageSharp/Image/ImageFrame{TPixel}.cs

@ -20,8 +20,6 @@ namespace SixLabors.ImageSharp
public sealed class ImageFrame<TPixel> : IPixelSource<TPixel>, IDisposable
where TPixel : struct, IPixel<TPixel>
{
public MemoryManager MemoryManager { get; }
/// <summary>
/// The image pixels. Not private as Buffer2D requires an array in its constructor.
/// </summary>
@ -32,6 +30,7 @@ namespace SixLabors.ImageSharp
/// <summary>
/// Initializes a new instance of the <see cref="ImageFrame{TPixel}" /> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param>
internal ImageFrame(MemoryManager memoryManager, int width, int height)
@ -42,6 +41,7 @@ namespace SixLabors.ImageSharp
/// <summary>
/// Initializes a new instance of the <see cref="ImageFrame{TPixel}" /> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param>
/// <param name="metaData">The meta data.</param>
@ -60,6 +60,7 @@ namespace SixLabors.ImageSharp
/// <summary>
/// Initializes a new instance of the <see cref="ImageFrame{TPixel}" /> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="source">The source.</param>
internal ImageFrame(MemoryManager memoryManager, ImageFrame<TPixel> source)
{
@ -69,6 +70,11 @@ namespace SixLabors.ImageSharp
this.MetaData = source.MetaData.Clone();
}
/// <summary>
/// Gets the <see cref="MemoryManager" /> to use for buffer allocations.
/// </summary>
public MemoryManager MemoryManager { get; }
/// <inheritdoc/>
Buffer2D<TPixel> IPixelSource<TPixel>.PixelBuffer => this.pixelBuffer;

1
src/ImageSharp/Memory/ArrayPoolMemoryManager.cs

@ -4,7 +4,6 @@ using System.Runtime.InteropServices;
namespace SixLabors.ImageSharp.Memory
{
/// <summary>
/// Implements <see cref="MemoryManager"/> by allocating memory from <see cref="ArrayPool{T}"/>.
/// </summary>

4
src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs

@ -25,8 +25,10 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="LomographProcessor{TPixel}" /> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="options">The options effecting blending and composition.</param>
public LomographProcessor(MemoryManager memoryManager, GraphicsOptions options) {
public LomographProcessor(MemoryManager memoryManager, GraphicsOptions options)
{
this.memoryManager = memoryManager;
this.options = options;
}

4
src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs

@ -26,8 +26,10 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="PolaroidProcessor{TPixel}" /> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="options">The options effecting blending and composition.</param>
public PolaroidProcessor(MemoryManager memoryManager, GraphicsOptions options) {
public PolaroidProcessor(MemoryManager memoryManager, GraphicsOptions options)
{
this.memoryManager = memoryManager;
this.options = options;
}

1
src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs

@ -24,6 +24,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="BackgroundColorProcessor{TPixel}"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="color">The <typeparamref name="TPixel"/> to set the background color to.</param>
/// <param name="options">The options defining blending algorithum and amount.</param>
public BackgroundColorProcessor(MemoryManager memoryManager, TPixel color, GraphicsOptions options)

1
src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs

@ -27,6 +27,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="GlowProcessor{TPixel}" /> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="color">The color or the glow.</param>
/// <param name="radius">The radius of the glow.</param>
/// <param name="options">The options effecting blending and composition.</param>

2
src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs

@ -27,6 +27,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="VignetteProcessor{TPixel}" /> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="color">The color of the vignette.</param>
/// <param name="radiusX">The x-radius.</param>
/// <param name="radiusY">The y-radius.</param>
@ -44,6 +45,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="VignetteProcessor{TPixel}" /> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="color">The color of the vignette.</param>
/// <param name="options">The options effecting blending and composition.</param>
public VignetteProcessor(MemoryManager memoryManager, TPixel color, GraphicsOptions options)

1
src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.Weights.cs

@ -162,6 +162,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="WeightsBuffer"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="sourceSize">The size of the source window</param>
/// <param name="destinationSize">The size of the destination window</param>
public WeightsBuffer(MemoryManager memoryManager, int sourceSize, int destinationSize)

5
src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs

@ -21,6 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="ResamplingWeightedProcessor{TPixel}"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="sampler">The sampler to perform the resize operation.</param>
/// <param name="width">The target width.</param>
/// <param name="height">The target height.</param>
@ -40,7 +41,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
this.Height = height;
this.ResizeRectangle = resizeRectangle;
}
/// <summary>
/// Gets the sampler to perform the resize operation.
/// </summary>
@ -60,7 +61,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// Gets or sets the resize rectangle.
/// </summary>
public Rectangle ResizeRectangle { get; protected set; }
protected MemoryManager MemoryManager { get; }
/// <summary>

2
src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs

@ -23,6 +23,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="ResizeProcessor{TPixel}"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="sampler">The sampler to perform the resize operation.</param>
/// <param name="width">The target width.</param>
/// <param name="height">The target height.</param>
@ -34,6 +35,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <summary>
/// Initializes a new instance of the <see cref="ResizeProcessor{TPixel}"/> class.
/// </summary>
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
/// <param name="sampler">The sampler to perform the resize operation.</param>
/// <param name="width">The target width.</param>
/// <param name="height">The target height.</param>

Loading…
Cancel
Save