From 35561ccca4c3f571654ee19bfdcfbdce72371bcb Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Thu, 8 Aug 2019 17:32:59 +0200 Subject: [PATCH] [SL.Core] Fixed new StyleCop issues. --- src/SixLabors.Core/Constants.cs | 2 +- src/SixLabors.Core/Helpers/DebugGuard.cs | 8 +- src/SixLabors.Core/Helpers/Guard.cs | 2 +- src/SixLabors.Core/MathF.cs | 2 +- .../ArrayPoolMemoryAllocator.Buffer{T}.cs | 4 +- ...oolMemoryAllocator.CommonFactoryMethods.cs | 8 +- .../Memory/ArrayPoolMemoryAllocator.cs | 4 +- .../Memory/Internals/BasicArrayBuffer.cs | 14 +-- .../Memory/Internals/BasicByteBuffer.cs | 4 +- .../Memory/Internals/ManagedBufferBase.cs | 4 +- src/SixLabors.Core/Memory/MemoryAllocator.cs | 8 +- src/SixLabors.Core/Primitives/Point.cs | 48 +++++------ src/SixLabors.Core/Primitives/PointF.cs | 32 +++---- src/SixLabors.Core/Primitives/Rectangle.cs | 86 +++++++++---------- src/SixLabors.Core/Primitives/RectangleF.cs | 72 ++++++++-------- src/SixLabors.Core/Primitives/Size.cs | 40 ++++----- src/SixLabors.Core/Primitives/SizeF.cs | 22 ++--- .../Helpers/FloatRoundingComparer.cs | 4 +- .../Memory/ArrayPoolMemoryAllocatorTests.cs | 2 +- 19 files changed, 183 insertions(+), 183 deletions(-) diff --git a/src/SixLabors.Core/Constants.cs b/src/SixLabors.Core/Constants.cs index eda2f596f..b8699e2d1 100644 --- a/src/SixLabors.Core/Constants.cs +++ b/src/SixLabors.Core/Constants.cs @@ -4,7 +4,7 @@ namespace SixLabors { /// - /// Common constants used throughout the project + /// Common constants used throughout the project. /// internal static class Constants { diff --git a/src/SixLabors.Core/Helpers/DebugGuard.cs b/src/SixLabors.Core/Helpers/DebugGuard.cs index f1fc1c64c..bfc2a7a8d 100644 --- a/src/SixLabors.Core/Helpers/DebugGuard.cs +++ b/src/SixLabors.Core/Helpers/DebugGuard.cs @@ -18,8 +18,8 @@ namespace SixLabors /// /// The target object, which cannot be null. /// The name of the parameter that is to be checked. - /// is null - /// The type of the object to verify + /// is null. + /// The type of the object to verify. [Conditional("DEBUG")] public static void NotNull(T target, string parameterName) where T : class @@ -119,12 +119,12 @@ namespace SixLabors /// /// Verifies, that the `target` array has declared the length or longer. /// - /// The element type of the spans + /// The element type of the spans. /// The target array. /// The min length the array must have. /// The name of the parameter that is to be checked. /// - /// is true + /// is true. /// [Conditional("DEBUG")] public static void MustBeSizedAtLeast(T[] target, int minLength, string parameterName) diff --git a/src/SixLabors.Core/Helpers/Guard.cs b/src/SixLabors.Core/Helpers/Guard.cs index b50cd4ab0..d6616aa78 100644 --- a/src/SixLabors.Core/Helpers/Guard.cs +++ b/src/SixLabors.Core/Helpers/Guard.cs @@ -118,7 +118,7 @@ namespace SixLabors /// /// Verifies, that the `target` span has the length of 'minLength', or longer. /// - /// The element type of the spans + /// The element type of the spans. /// The target span. /// The minimum length. /// The name of the parameter that is to be checked. diff --git a/src/SixLabors.Core/MathF.cs b/src/SixLabors.Core/MathF.cs index b0d760ade..d4a493a4f 100644 --- a/src/SixLabors.Core/MathF.cs +++ b/src/SixLabors.Core/MathF.cs @@ -219,7 +219,7 @@ namespace System /// parameter Return value Zero or positive The positive square root of . /// Negative Equals /// Equals - /// + /// . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Sqrt(float f) diff --git a/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.Buffer{T}.cs b/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.Buffer{T}.cs index 0b0d6c4d4..5676ab23f 100644 --- a/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.Buffer{T}.cs +++ b/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.Buffer{T}.cs @@ -9,7 +9,7 @@ using SixLabors.Memory.Internals; namespace SixLabors.Memory { /// - /// Contains and + /// Contains and . /// public partial class ArrayPoolMemoryAllocator { @@ -20,7 +20,7 @@ namespace SixLabors.Memory where T : struct { /// - /// The length of the buffer + /// The length of the buffer. /// private readonly int length; diff --git a/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.CommonFactoryMethods.cs b/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.CommonFactoryMethods.cs index c56453b00..dd6e9a8f0 100644 --- a/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.CommonFactoryMethods.cs +++ b/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.CommonFactoryMethods.cs @@ -32,7 +32,7 @@ namespace SixLabors.Memory /// /// This is the default. Should be good for most use cases. /// - /// The memory manager + /// The memory manager. public static ArrayPoolMemoryAllocator CreateDefault() { return new ArrayPoolMemoryAllocator( @@ -45,7 +45,7 @@ namespace SixLabors.Memory /// /// For environments with very limited memory capabilities, only small buffers like image rows are pooled. /// - /// The memory manager + /// The memory manager. public static ArrayPoolMemoryAllocator CreateWithMinimalPooling() { return new ArrayPoolMemoryAllocator(64 * 1024, 32 * 1024, 8, 24); @@ -54,7 +54,7 @@ namespace SixLabors.Memory /// /// For environments with limited memory capabilities, only small array requests are pooled, which can result in reduced throughput. /// - /// The memory manager + /// The memory manager. public static ArrayPoolMemoryAllocator CreateWithModeratePooling() { return new ArrayPoolMemoryAllocator(1024 * 1024, 32 * 1024, 16, 24); @@ -63,7 +63,7 @@ namespace SixLabors.Memory /// /// For environments where memory capabilities are not an issue, the maximum amount of array requests are pooled which results in optimal throughput. /// - /// The memory manager + /// The memory manager. public static ArrayPoolMemoryAllocator CreateWithAggressivePooling() { return new ArrayPoolMemoryAllocator(128 * 1024 * 1024, 32 * 1024 * 1024, 16, 32); diff --git a/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.cs b/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.cs index 113e12785..0905948e0 100644 --- a/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.cs +++ b/src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.cs @@ -58,8 +58,8 @@ namespace SixLabors.Memory /// /// The maximum size of pooled arrays. Arrays over the thershold are gonna be always allocated. /// The threshold to pool arrays in which has less buckets for memory safety. - /// Max arrays per bucket for the large array pool - /// Max arrays per bucket for the normal array pool + /// Max arrays per bucket for the large array pool. + /// Max arrays per bucket for the normal array pool. public ArrayPoolMemoryAllocator(int maxPoolSizeInBytes, int poolSelectorThresholdInBytes, int maxArraysPerBucketLargePool, int maxArraysPerBucketNormalPool) { Guard.MustBeGreaterThan(maxPoolSizeInBytes, 0, nameof(maxPoolSizeInBytes)); diff --git a/src/SixLabors.Core/Memory/Internals/BasicArrayBuffer.cs b/src/SixLabors.Core/Memory/Internals/BasicArrayBuffer.cs index bc12d7c2f..c0d36afd5 100644 --- a/src/SixLabors.Core/Memory/Internals/BasicArrayBuffer.cs +++ b/src/SixLabors.Core/Memory/Internals/BasicArrayBuffer.cs @@ -14,10 +14,10 @@ namespace SixLabors.Memory.Internals where T : struct { /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class. /// - /// The array - /// The length of the buffer + /// The array. + /// The length of the buffer. public BasicArrayBuffer(T[] array, int length) { DebugGuard.MustBeLessThanOrEqualTo(length, array.Length, nameof(length)); @@ -26,21 +26,21 @@ namespace SixLabors.Memory.Internals } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class. /// - /// The array + /// The array. public BasicArrayBuffer(T[] array) : this(array, array.Length) { } /// - /// Gets the array + /// Gets the array. /// public T[] Array { get; } /// - /// Gets the length + /// Gets the length. /// public int Length { get; } diff --git a/src/SixLabors.Core/Memory/Internals/BasicByteBuffer.cs b/src/SixLabors.Core/Memory/Internals/BasicByteBuffer.cs index ee76c2ee3..fa6a5de4c 100644 --- a/src/SixLabors.Core/Memory/Internals/BasicByteBuffer.cs +++ b/src/SixLabors.Core/Memory/Internals/BasicByteBuffer.cs @@ -9,9 +9,9 @@ namespace SixLabors.Memory.Internals internal sealed class BasicByteBuffer : BasicArrayBuffer, IManagedByteBuffer { /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class. /// - /// The byte array + /// The byte array. internal BasicByteBuffer(byte[] array) : base(array) { diff --git a/src/SixLabors.Core/Memory/Internals/ManagedBufferBase.cs b/src/SixLabors.Core/Memory/Internals/ManagedBufferBase.cs index 9dadcf5a2..e1f131693 100644 --- a/src/SixLabors.Core/Memory/Internals/ManagedBufferBase.cs +++ b/src/SixLabors.Core/Memory/Internals/ManagedBufferBase.cs @@ -9,7 +9,7 @@ namespace SixLabors.Memory.Internals /// /// Provides a base class for implementations by implementing pinning logic for adaption. /// - /// The element type + /// The element type. internal abstract class ManagedBufferBase : MemoryManager where T : struct { @@ -39,7 +39,7 @@ namespace SixLabors.Memory.Internals /// /// Gets the object that should be pinned. /// - /// The pinnable + /// The pinnable . protected abstract object GetPinnableObject(); } } \ No newline at end of file diff --git a/src/SixLabors.Core/Memory/MemoryAllocator.cs b/src/SixLabors.Core/Memory/MemoryAllocator.cs index 36ce8fcce..24ed7bef3 100644 --- a/src/SixLabors.Core/Memory/MemoryAllocator.cs +++ b/src/SixLabors.Core/Memory/MemoryAllocator.cs @@ -13,8 +13,8 @@ namespace SixLabors.Memory /// /// Allocates an , holding a of length . /// - /// Type of the data stored in the buffer - /// Size of the buffer to allocate + /// Type of the data stored in the buffer. + /// Size of the buffer to allocate. /// The allocation options. /// A buffer of values of type . public abstract IMemoryOwner Allocate(int length, AllocationOptions options = AllocationOptions.None) @@ -23,9 +23,9 @@ namespace SixLabors.Memory /// /// Allocates an . /// - /// The requested buffer length + /// The requested buffer length. /// The allocation options. - /// The + /// The . public abstract IManagedByteBuffer AllocateManagedByteBuffer(int length, AllocationOptions options = AllocationOptions.None); /// diff --git a/src/SixLabors.Core/Primitives/Point.cs b/src/SixLabors.Core/Primitives/Point.cs index 77ebb62f6..ec5733041 100644 --- a/src/SixLabors.Core/Primitives/Point.cs +++ b/src/SixLabors.Core/Primitives/Point.cs @@ -49,7 +49,7 @@ namespace SixLabors.Primitives /// /// Initializes a new instance of the struct from the given . /// - /// The size + /// The size. public Point(Size size) { this.X = size.Width; @@ -75,21 +75,21 @@ namespace SixLabors.Primitives /// /// Creates a with the coordinates of the specified . /// - /// The point + /// The point. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator PointF(Point point) => new PointF(point.X, point.Y); /// /// Creates a with the coordinates of the specified . /// - /// The point + /// The point. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator Vector2(Point point) => new Vector2(point.X, point.Y); /// /// Creates a with the coordinates of the specified . /// - /// The point + /// The point. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Size(Point point) => new Size(point.X, point.Y); @@ -106,7 +106,7 @@ namespace SixLabors.Primitives /// The point on the left hand of the operand. /// The size on the right hand of the operand. /// - /// The + /// The . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point operator +(Point point, Size size) => Add(point, size); @@ -116,7 +116,7 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point operator -(Point point, Size size) => Subtract(point, size); @@ -172,16 +172,16 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Add(Point point, Size size) => new Point(unchecked(point.X + size.Width), unchecked(point.Y + size.Height)); /// - /// Translates a by the negative of a given value + /// Translates a by the negative of a given value. /// /// The point on the left hand of the operand. /// The value on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Multiply(Point point, int value) => new Point(unchecked(point.X * value), unchecked(point.Y * value)); @@ -190,56 +190,56 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Subtract(Point point, Size size) => new Point(unchecked(point.X - size.Width), unchecked(point.Y - size.Height)); /// /// Converts a to a by performing a ceiling operation on all the coordinates. /// - /// The point - /// The + /// The point. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Ceiling(PointF point) => new Point(unchecked((int)MathF.Ceiling(point.X)), unchecked((int)MathF.Ceiling(point.Y))); /// /// Converts a to a by performing a round operation on all the coordinates. /// - /// The point - /// The + /// The point. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Round(PointF point) => new Point(unchecked((int)MathF.Round(point.X)), unchecked((int)MathF.Round(point.Y))); /// /// Converts a to a by performing a round operation on all the coordinates. /// - /// The vector - /// The + /// The vector. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Round(Vector2 vector) => new Point(unchecked((int)MathF.Round(vector.X)), unchecked((int)MathF.Round(vector.Y))); /// /// Converts a to a by performing a truncate operation on all the coordinates. /// - /// The point - /// The + /// The point. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Truncate(PointF point) => new Point(unchecked((int)point.X), unchecked((int)point.Y)); /// /// Transforms a point by a specified 3x2 matrix. /// - /// The point to transform - /// The transformation matrix used - /// The transformed + /// The point to transform. + /// The transformation matrix used. + /// The transformed . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Transform(Point point, Matrix3x2 matrix) => Round(Vector2.Transform(new Vector2(point.X, point.Y), matrix)); /// - /// Deconstructs this point into two integers + /// Deconstructs this point into two integers. /// - /// The out value for X - /// The out value for Y + /// The out value for X. + /// The out value for Y. public void Deconstruct(out int x, out int y) { x = this.X; diff --git a/src/SixLabors.Core/Primitives/PointF.cs b/src/SixLabors.Core/Primitives/PointF.cs index 844a5f264..4a2da5cdc 100644 --- a/src/SixLabors.Core/Primitives/PointF.cs +++ b/src/SixLabors.Core/Primitives/PointF.cs @@ -38,7 +38,7 @@ namespace SixLabors.Primitives /// /// Initializes a new instance of the struct from the given . /// - /// The size + /// The size. public PointF(SizeF size) { this.X = size.Width; @@ -104,7 +104,7 @@ namespace SixLabors.Primitives /// The point on the left hand of the operand. /// The size on the right hand of the operand. /// - /// The + /// The . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF operator +(PointF point, SizeF size) => Add(point, size); @@ -114,7 +114,7 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF operator -(PointF point, PointF size) => Subtract(point, size); @@ -124,7 +124,7 @@ namespace SixLabors.Primitives /// The point on the left hand of the operand. /// The size on the right hand of the operand. /// - /// The + /// The . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF operator +(PointF point, PointF size) => Add(point, size); @@ -134,7 +134,7 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF operator -(PointF point, SizeF size) => Subtract(point, size); @@ -198,7 +198,7 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF Add(PointF point, SizeF size) => new PointF(point.X + size.Width, point.Y + size.Height); @@ -207,7 +207,7 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The point on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF Add(PointF point, PointF pointb) => new PointF(point.X + pointb.X, point.Y + pointb.Y); @@ -216,7 +216,7 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF Subtract(PointF point, SizeF size) => new PointF(point.X - size.Width, point.Y - size.Height); @@ -225,7 +225,7 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The point on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF Subtract(PointF point, PointF pointb) => new PointF(point.X - pointb.X, point.Y - pointb.Y); @@ -234,24 +234,24 @@ namespace SixLabors.Primitives /// /// The point on the left hand of the operand. /// The value on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF Multiply(PointF point, float right) => new PointF(point.X * right, point.Y * right); /// /// Transforms a point by a specified 3x2 matrix. /// - /// The point to transform - /// The transformation matrix used - /// The transformed + /// The point to transform. + /// The transformation matrix used. + /// The transformed . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF Transform(PointF point, Matrix3x2 matrix) => Vector2.Transform(point, matrix); /// - /// Deconstructs this point into two floats + /// Deconstructs this point into two floats. /// - /// The out value for X - /// The out value for Y + /// The out value for X. + /// The out value for Y. public void Deconstruct(out float x, out float y) { x = this.X; diff --git a/src/SixLabors.Core/Primitives/Rectangle.cs b/src/SixLabors.Core/Primitives/Rectangle.cs index 239813ac7..8600e2e4c 100644 --- a/src/SixLabors.Core/Primitives/Rectangle.cs +++ b/src/SixLabors.Core/Primitives/Rectangle.cs @@ -145,14 +145,14 @@ namespace SixLabors.Primitives /// /// Creates a with the coordinates of the specified . /// - /// The rectangle + /// The rectangle. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator RectangleF(Rectangle rectangle) => new RectangleF(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); /// /// Creates a with the coordinates of the specified . /// - /// The rectangle + /// The rectangle. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator Vector4(Rectangle rectangle) => new Vector4(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); @@ -180,21 +180,21 @@ namespace SixLabors.Primitives /// /// Creates a new with the specified location and size. - /// The left coordinate of the rectangle - /// The top coordinate of the rectangle - /// The right coordinate of the rectangle - /// The bottom coordinate of the rectangle - /// The + /// The left coordinate of the rectangle. + /// The top coordinate of the rectangle. + /// The right coordinate of the rectangle. + /// The bottom coordinate of the rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] // ReSharper disable once InconsistentNaming public static Rectangle FromLTRB(int left, int top, int right, int bottom) => new Rectangle(left, top, unchecked(right - left), unchecked(bottom - top)); /// - /// Returns the center point of the given + /// Returns the center point of the given . /// - /// The rectangle - /// The + /// The rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Point Center(Rectangle rectangle) => new Point(rectangle.Left + (rectangle.Width / 2), rectangle.Top + (rectangle.Height / 2)); @@ -202,9 +202,9 @@ namespace SixLabors.Primitives /// Creates a rectangle that represents the intersection between and /// . If there is no intersection, an empty rectangle is returned. /// - /// The first rectangle - /// The second rectangle - /// The + /// The first rectangle. + /// The second rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Rectangle Intersect(Rectangle a, Rectangle b) { @@ -224,10 +224,10 @@ namespace SixLabors.Primitives /// /// Creates a that is inflated by the specified amount. /// - /// The rectangle - /// The amount to inflate the width by - /// The amount to inflate the height by - /// A new + /// The rectangle. + /// The amount to inflate the width by. + /// The amount to inflate the height by. + /// A new . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Rectangle Inflate(Rectangle rectangle, int x, int y) { @@ -239,8 +239,8 @@ namespace SixLabors.Primitives /// /// Converts a to a by performing a ceiling operation on all the coordinates. /// - /// The rectangle - /// The + /// The rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Rectangle Ceiling(RectangleF rectangle) { @@ -270,8 +270,8 @@ namespace SixLabors.Primitives /// /// Converts a to a by performing a truncate operation on all the coordinates. /// - /// The rectangle - /// The + /// The rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Rectangle Truncate(RectangleF rectangle) { @@ -288,8 +288,8 @@ namespace SixLabors.Primitives /// /// Converts a to a by performing a round operation on all the coordinates. /// - /// The rectangle - /// The + /// The rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Rectangle Round(RectangleF rectangle) { @@ -306,9 +306,9 @@ namespace SixLabors.Primitives /// /// Creates a rectangle that represents the union between and . /// - /// The first rectangle - /// The second rectangle - /// The + /// The first rectangle. + /// The second rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Rectangle Union(Rectangle a, Rectangle b) { @@ -321,12 +321,12 @@ namespace SixLabors.Primitives } /// - /// Deconstructs this rectangle into four integers + /// Deconstructs this rectangle into four integers. /// - /// The out value for X - /// The out value for Y - /// The out value for the width - /// The out value for the height + /// The out value for X. + /// The out value for Y. + /// The out value for the width. + /// The out value for the height. public void Deconstruct(out int x, out int y, out int width, out int height) { x = this.X; @@ -338,7 +338,7 @@ namespace SixLabors.Primitives /// /// Creates a Rectangle that represents the intersection between this Rectangle and the . /// - /// The rectangle + /// The rectangle. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Intersect(Rectangle rectangle) { @@ -353,8 +353,8 @@ namespace SixLabors.Primitives /// /// Inflates this by the specified amount. /// - /// The width - /// The height + /// The width. + /// The height. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Inflate(int width, int height) { @@ -371,7 +371,7 @@ namespace SixLabors.Primitives /// /// Inflates this by the specified amount. /// - /// The size + /// The size. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Inflate(Size size) => this.Inflate(size.Width, size.Height); @@ -381,15 +381,15 @@ namespace SixLabors.Primitives /// /// The x-coordinate of the given point. /// The y-coordinate of the given point. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Contains(int x, int y) => this.X <= x && x < this.Right && this.Y <= y && y < this.Bottom; /// /// Determines if the specified point is contained within the rectangular region defined by this . /// - /// The point - /// The + /// The point. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Contains(Point point) => this.Contains(point.X, point.Y); @@ -397,8 +397,8 @@ namespace SixLabors.Primitives /// Determines if the rectangular region represented by is entirely contained /// within the rectangular region represented by this . /// - /// The rectangle - /// The + /// The rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Contains(Rectangle rectangle) => (this.X <= rectangle.X) && (rectangle.Right <= this.Right) && @@ -408,8 +408,8 @@ namespace SixLabors.Primitives /// Determines if the specfied intersects the rectangular region defined by /// this . /// - /// The other Rectange - /// The + /// The other Rectange. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IntersectsWith(Rectangle rectangle) => (rectangle.X < this.Right) && (this.X < rectangle.Right) && @@ -418,7 +418,7 @@ namespace SixLabors.Primitives /// /// Adjusts the location of this rectangle by the specified amount. /// - /// The point + /// The point. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Offset(Point point) => this.Offset(point.X, point.Y); diff --git a/src/SixLabors.Core/Primitives/RectangleF.cs b/src/SixLabors.Core/Primitives/RectangleF.cs index f212e5bcc..c8b58f4ed 100644 --- a/src/SixLabors.Core/Primitives/RectangleF.cs +++ b/src/SixLabors.Core/Primitives/RectangleF.cs @@ -145,7 +145,7 @@ namespace SixLabors.Primitives /// /// Creates a with the coordinates of the specified by truncating each coordinate. /// - /// The rectangle + /// The rectangle. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Rectangle(RectangleF rectangle) => Rectangle.Truncate(rectangle); @@ -173,21 +173,21 @@ namespace SixLabors.Primitives /// /// Creates a new with the specified location and size. - /// The left coordinate of the rectangle - /// The top coordinate of the rectangle - /// The right coordinate of the rectangle - /// The bottom coordinate of the rectangle - /// The + /// The left coordinate of the rectangle. + /// The top coordinate of the rectangle. + /// The right coordinate of the rectangle. + /// The bottom coordinate of the rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] // ReSharper disable once InconsistentNaming public static RectangleF FromLTRB(float left, float top, float right, float bottom) => new RectangleF(left, top, right - left, bottom - top); /// - /// Returns the center point of the given + /// Returns the center point of the given . /// - /// The rectangle - /// The + /// The rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static PointF Center(RectangleF rectangle) => new PointF(rectangle.Left + (rectangle.Width / 2), rectangle.Top + (rectangle.Height / 2)); @@ -195,9 +195,9 @@ namespace SixLabors.Primitives /// Creates a rectangle that represents the intersection between and /// . If there is no intersection, an empty rectangle is returned. /// - /// The first rectangle - /// The second rectangle - /// The + /// The first rectangle. + /// The second rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static RectangleF Intersect(RectangleF a, RectangleF b) { @@ -217,10 +217,10 @@ namespace SixLabors.Primitives /// /// Creates a that is inflated by the specified amount. /// - /// The rectangle - /// The amount to inflate the width by - /// The amount to inflate the height by - /// A new + /// The rectangle. + /// The amount to inflate the width by. + /// The amount to inflate the height by. + /// A new . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static RectangleF Inflate(RectangleF rectangle, float x, float y) { @@ -245,9 +245,9 @@ namespace SixLabors.Primitives /// /// Creates a rectangle that represents the union between and . /// - /// The first rectangle - /// The second rectangle - /// The + /// The first rectangle. + /// The second rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static RectangleF Union(RectangleF a, RectangleF b) { @@ -260,12 +260,12 @@ namespace SixLabors.Primitives } /// - /// Deconstructs this rectangle into four floats + /// Deconstructs this rectangle into four floats. /// - /// The out value for X - /// The out value for Y - /// The out value for the width - /// The out value for the height + /// The out value for X. + /// The out value for Y. + /// The out value for the width. + /// The out value for the height. public void Deconstruct(out float x, out float y, out float width, out float height) { x = this.X; @@ -277,7 +277,7 @@ namespace SixLabors.Primitives /// /// Creates a RectangleF that represents the intersection between this RectangleF and the . /// - /// The rectangle + /// The rectangle. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Intersect(RectangleF rectangle) { @@ -292,8 +292,8 @@ namespace SixLabors.Primitives /// /// Inflates this by the specified amount. /// - /// The width - /// The height + /// The width. + /// The height. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Inflate(float width, float height) { @@ -307,7 +307,7 @@ namespace SixLabors.Primitives /// /// Inflates this by the specified amount. /// - /// The size + /// The size. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Inflate(SizeF size) => this.Inflate(size.Width, size.Height); @@ -317,15 +317,15 @@ namespace SixLabors.Primitives /// /// The x-coordinate of the given point. /// The y-coordinate of the given point. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Contains(float x, float y) => this.X <= x && x < this.Right && this.Y <= y && y < this.Bottom; /// /// Determines if the specified point is contained within the rectangular region defined by this . /// - /// The point - /// The + /// The point. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Contains(PointF point) => this.Contains(point.X, point.Y); @@ -333,8 +333,8 @@ namespace SixLabors.Primitives /// Determines if the rectangular region represented by is entirely contained /// within the rectangular region represented by this . /// - /// The rectangle - /// The + /// The rectangle. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Contains(RectangleF rectangle) => (this.X <= rectangle.X) && (rectangle.Right <= this.Right) && @@ -344,8 +344,8 @@ namespace SixLabors.Primitives /// Determines if the specfied intersects the rectangular region defined by /// this . /// - /// The other Rectange - /// The + /// The other Rectange. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IntersectsWith(RectangleF rectangle) => (rectangle.X < this.Right) && (this.X < rectangle.Right) && @@ -354,7 +354,7 @@ namespace SixLabors.Primitives /// /// Adjusts the location of this rectangle by the specified amount. /// - /// The point + /// The point. [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Offset(PointF point) => this.Offset(point.X, point.Y); diff --git a/src/SixLabors.Core/Primitives/Size.cs b/src/SixLabors.Core/Primitives/Size.cs index 0c468a80b..e0eb6484c 100644 --- a/src/SixLabors.Core/Primitives/Size.cs +++ b/src/SixLabors.Core/Primitives/Size.cs @@ -25,7 +25,7 @@ namespace SixLabors.Primitives /// /// Initializes a new instance of the struct. /// - /// The width and height of the size + /// The width and height of the size. public Size(int value) : this() { @@ -47,7 +47,7 @@ namespace SixLabors.Primitives /// /// Initializes a new instance of the struct. /// - /// The size + /// The size. public Size(Size size) : this() { @@ -58,7 +58,7 @@ namespace SixLabors.Primitives /// /// Initializes a new instance of the struct from the given . /// - /// The point + /// The point. public Size(Point point) { this.Width = point.X; @@ -84,14 +84,14 @@ namespace SixLabors.Primitives /// /// Creates a with the dimensions of the specified . /// - /// The point + /// The point. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator SizeF(Size size) => new SizeF(size.Width, size.Height); /// /// Converts the given into a . /// - /// The size + /// The size. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Point(Size size) => new Point(size.Width, size.Height); @@ -101,7 +101,7 @@ namespace SixLabors.Primitives /// The size on the left hand of the operand. /// The size on the right hand of the operand. /// - /// The + /// The . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Size operator +(Size left, Size right) => Add(left, right); @@ -112,7 +112,7 @@ namespace SixLabors.Primitives /// The size on the left hand of the operand. /// The size on the right hand of the operand. /// - /// The + /// The . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Size operator -(Size left, Size right) => Subtract(left, right); @@ -201,39 +201,39 @@ namespace SixLabors.Primitives /// /// The size on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Size Add(Size left, Size right) => new Size(unchecked(left.Width + right.Width), unchecked(left.Height + right.Height)); /// - /// Contracts a by another + /// Contracts a by another . /// /// The size on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Size Subtract(Size left, Size right) => new Size(unchecked(left.Width - right.Width), unchecked(left.Height - right.Height)); /// /// Converts a to a by performing a ceiling operation on all the dimensions. /// - /// The size - /// The + /// The size. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Size Ceiling(SizeF size) => new Size(unchecked((int)MathF.Ceiling(size.Width)), unchecked((int)MathF.Ceiling(size.Height))); /// /// Converts a to a by performing a round operation on all the dimensions. /// - /// The size - /// The + /// The size. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Size Round(SizeF size) => new Size(unchecked((int)MathF.Round(size.Width)), unchecked((int)MathF.Round(size.Height))); /// /// Transforms a size by the given matrix. /// - /// The source size + /// The source size. /// The transformation matrix. /// A transformed size. public static SizeF Transform(Size size, Matrix3x2 matrix) @@ -246,16 +246,16 @@ namespace SixLabors.Primitives /// /// Converts a to a by performing a round operation on all the dimensions. /// - /// The size - /// The + /// The size. + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Size Truncate(SizeF size) => new Size(unchecked((int)size.Width), unchecked((int)size.Height)); /// - /// Deconstructs this size into two integers + /// Deconstructs this size into two integers. /// - /// The out value for the width - /// The out value for the height + /// The out value for the width. + /// The out value for the height. public void Deconstruct(out int width, out int height) { width = this.Width; diff --git a/src/SixLabors.Core/Primitives/SizeF.cs b/src/SixLabors.Core/Primitives/SizeF.cs index b7e15b5e3..5d503a705 100644 --- a/src/SixLabors.Core/Primitives/SizeF.cs +++ b/src/SixLabors.Core/Primitives/SizeF.cs @@ -36,7 +36,7 @@ namespace SixLabors.Primitives /// /// Initializes a new instance of the struct. /// - /// The size + /// The size. public SizeF(SizeF size) : this() { @@ -47,7 +47,7 @@ namespace SixLabors.Primitives /// /// Initializes a new instance of the struct from the given . /// - /// The point + /// The point. public SizeF(PointF point) { this.Width = point.X; @@ -93,7 +93,7 @@ namespace SixLabors.Primitives /// /// Converts the given into a . /// - /// The size + /// The size. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator PointF(SizeF size) => new PointF(size.Width, size.Height); @@ -103,7 +103,7 @@ namespace SixLabors.Primitives /// The size on the left hand of the operand. /// The size on the right hand of the operand. /// - /// The + /// The . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static SizeF operator +(SizeF left, SizeF right) => Add(left, right); @@ -114,7 +114,7 @@ namespace SixLabors.Primitives /// The size on the left hand of the operand. /// The size on the right hand of the operand. /// - /// The + /// The . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static SizeF operator -(SizeF left, SizeF right) => Subtract(left, right); @@ -171,16 +171,16 @@ namespace SixLabors.Primitives /// /// The size on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static SizeF Add(SizeF left, SizeF right) => new SizeF(left.Width + right.Width, left.Height + right.Height); /// - /// Contracts a by another + /// Contracts a by another . /// /// The size on the left hand of the operand. /// The size on the right hand of the operand. - /// The + /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] public static SizeF Subtract(SizeF left, SizeF right) => new SizeF(left.Width - right.Width, left.Height - right.Height); @@ -198,10 +198,10 @@ namespace SixLabors.Primitives } /// - /// Deconstructs this size into two floats + /// Deconstructs this size into two floats. /// - /// The out value for the width - /// The out value for the height + /// The out value for the width. + /// The out value for the height. public void Deconstruct(out float width, out float height) { width = this.Width; diff --git a/tests/SixLabors.Core.Tests/Helpers/FloatRoundingComparer.cs b/tests/SixLabors.Core.Tests/Helpers/FloatRoundingComparer.cs index a5c965b10..15220d4b1 100644 --- a/tests/SixLabors.Core.Tests/Helpers/FloatRoundingComparer.cs +++ b/tests/SixLabors.Core.Tests/Helpers/FloatRoundingComparer.cs @@ -15,7 +15,7 @@ namespace SixLabors.Tests.Helpers /// /// Initializes a new instance of the struct. /// - /// The number of decimal places (valid values: 0-7) + /// The number of decimal places (valid values: 0-7). public FloatRoundingComparer(int precision) { Guard.MustBeBetweenOrEqualTo(precision, 0, 7, nameof(precision)); @@ -23,7 +23,7 @@ namespace SixLabors.Tests.Helpers } /// - /// Gets the number of decimal places (valid values: 0-7) + /// Gets the number of decimal places (valid values: 0-7). /// public int Precision { get; } diff --git a/tests/SixLabors.Core.Tests/Memory/ArrayPoolMemoryAllocatorTests.cs b/tests/SixLabors.Core.Tests/Memory/ArrayPoolMemoryAllocatorTests.cs index e59590bae..6f95a4d78 100644 --- a/tests/SixLabors.Core.Tests/Memory/ArrayPoolMemoryAllocatorTests.cs +++ b/tests/SixLabors.Core.Tests/Memory/ArrayPoolMemoryAllocatorTests.cs @@ -22,7 +22,7 @@ namespace SixLabors.Memory.Tests new ArrayPoolMemoryAllocator(MaxPooledBufferSizeInBytes, PoolSelectorThresholdInBytes); /// - /// Rent a buffer -> return it -> re-rent -> verify if it's span points to the previous location + /// Rent a buffer -> return it -> re-rent -> verify if it's span points to the previous location. /// private bool CheckIsRentingPooledBuffer(int length) where T : struct