From ba2e3e1a153d7f3f9528a5dda5d180eecf91fd8e Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sat, 22 Apr 2017 09:18:18 +1000 Subject: [PATCH] Fix pixel xml docs to add ranges and remove duplication --- src/ImageSharp/PixelFormats/Alpha8.cs | 3 ++- src/ImageSharp/PixelFormats/Argb32.cs | 1 + src/ImageSharp/PixelFormats/Bgr565.cs | 1 + src/ImageSharp/PixelFormats/Bgra4444.cs | 1 + src/ImageSharp/PixelFormats/Byte4.cs | 1 + src/ImageSharp/PixelFormats/HalfSingle.cs | 1 + src/ImageSharp/PixelFormats/HalfVector2.cs | 1 + src/ImageSharp/PixelFormats/HalfVector4.cs | 1 + src/ImageSharp/PixelFormats/NormalizedByte2.cs | 1 + src/ImageSharp/PixelFormats/NormalizedByte4.cs | 1 + src/ImageSharp/PixelFormats/NormalizedShort2.cs | 1 + src/ImageSharp/PixelFormats/NormalizedShort4.cs | 1 + src/ImageSharp/PixelFormats/Rg32.cs | 1 + src/ImageSharp/PixelFormats/Rgba1010102.cs | 1 + src/ImageSharp/PixelFormats/Rgba32.BulkOperations.cs | 11 +++-------- .../PixelFormats/Rgba32.ColorspaceTransforms.cs | 11 +++-------- src/ImageSharp/PixelFormats/Rgba32.Definitions.cs | 11 +++-------- src/ImageSharp/PixelFormats/Rgba32.Transforms.cs | 11 +++-------- src/ImageSharp/PixelFormats/Rgba32.cs | 1 + src/ImageSharp/PixelFormats/Rgba64.cs | 1 + .../PixelFormats/RgbaVector.BulkOperations.cs | 11 +++-------- src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs | 11 +++-------- src/ImageSharp/PixelFormats/RgbaVector.Transforms.cs | 11 +++-------- src/ImageSharp/PixelFormats/RgbaVector.cs | 1 + src/ImageSharp/PixelFormats/Short2.cs | 1 + src/ImageSharp/PixelFormats/Short4.cs | 1 + src/ImageSharp/PixelFormats/Vector4BlendTransforms.cs | 2 +- 27 files changed, 42 insertions(+), 58 deletions(-) diff --git a/src/ImageSharp/PixelFormats/Alpha8.cs b/src/ImageSharp/PixelFormats/Alpha8.cs index a7b464b1a..5e2fff5d0 100644 --- a/src/ImageSharp/PixelFormats/Alpha8.cs +++ b/src/ImageSharp/PixelFormats/Alpha8.cs @@ -10,7 +10,8 @@ namespace ImageSharp.PixelFormats using System.Runtime.CompilerServices; /// - /// Packed pixel type containing a single 8 bit normalized W values ranging from 0 to 1. + /// Packed pixel type containing a single 8 bit normalized W values. + /// Ranges from <0, 0, 0, 0> to <0, 0, 0, 1> in vector form. /// public struct Alpha8 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/Argb32.cs b/src/ImageSharp/PixelFormats/Argb32.cs index 3cad9e957..a6db505bb 100644 --- a/src/ImageSharp/PixelFormats/Argb32.cs +++ b/src/ImageSharp/PixelFormats/Argb32.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. /// The color components are stored in alpha, red, green, and blue order. + /// Ranges from <0, 0, 0, 0> to <1, 1, 1, 1> in vector form. /// /// /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, diff --git a/src/ImageSharp/PixelFormats/Bgr565.cs b/src/ImageSharp/PixelFormats/Bgr565.cs index f99b55816..a3d8cbcf2 100644 --- a/src/ImageSharp/PixelFormats/Bgr565.cs +++ b/src/ImageSharp/PixelFormats/Bgr565.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing unsigned normalized values ranging from 0 to 1. The x and z components use 5 bits, and the y component uses 6 bits. + /// Ranges from <0, 0, 0, 1> to <1, 1, 1, 1> in vector form. /// public struct Bgr565 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/Bgra4444.cs b/src/ImageSharp/PixelFormats/Bgra4444.cs index ea188e7c5..8d4e9b4f4 100644 --- a/src/ImageSharp/PixelFormats/Bgra4444.cs +++ b/src/ImageSharp/PixelFormats/Bgra4444.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing unsigned normalized values, ranging from 0 to 1, using 4 bits each for x, y, z, and w. + /// Ranges from <0, 0, 0, 0> to <1, 1, 1, 1> in vector form. /// public struct Bgra4444 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/Byte4.cs b/src/ImageSharp/PixelFormats/Byte4.cs index 884f8331b..acb73dd1c 100644 --- a/src/ImageSharp/PixelFormats/Byte4.cs +++ b/src/ImageSharp/PixelFormats/Byte4.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing four 8-bit unsigned integer values, ranging from 0 to 255. + /// Ranges from <0, 0, 0, 0> to <1, 1, 1, 1> in vector form. /// public struct Byte4 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/HalfSingle.cs b/src/ImageSharp/PixelFormats/HalfSingle.cs index c9a27382a..893667fc7 100644 --- a/src/ImageSharp/PixelFormats/HalfSingle.cs +++ b/src/ImageSharp/PixelFormats/HalfSingle.cs @@ -10,6 +10,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing a single 16 bit floating point value. + /// Ranges from <0, 0, 0, 1> to <1, 0, 0, 1> in vector form. /// public struct HalfSingle : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/HalfVector2.cs b/src/ImageSharp/PixelFormats/HalfVector2.cs index 85feea582..bd3cda55d 100644 --- a/src/ImageSharp/PixelFormats/HalfVector2.cs +++ b/src/ImageSharp/PixelFormats/HalfVector2.cs @@ -10,6 +10,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing two 16-bit floating-point values. + /// Ranges from <0, 0, 0, 1> to <1, 0, 0, 1> in vector form. /// public struct HalfVector2 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/HalfVector4.cs b/src/ImageSharp/PixelFormats/HalfVector4.cs index ef844253b..03e4326b7 100644 --- a/src/ImageSharp/PixelFormats/HalfVector4.cs +++ b/src/ImageSharp/PixelFormats/HalfVector4.cs @@ -10,6 +10,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing four 16-bit floating-point values. + /// Ranges from <0, 0, 0, 0> to <1, 1, 1, 1> in vector form. /// public struct HalfVector4 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/NormalizedByte2.cs b/src/ImageSharp/PixelFormats/NormalizedByte2.cs index 779b26a7a..dab113ae7 100644 --- a/src/ImageSharp/PixelFormats/NormalizedByte2.cs +++ b/src/ImageSharp/PixelFormats/NormalizedByte2.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed packed pixel type containing two 8-bit signed normalized values, ranging from −1 to 1. + /// Ranges from <-1, -1, 0, 1> to <1, 1, 0, 1> in vector form. /// public struct NormalizedByte2 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/NormalizedByte4.cs b/src/ImageSharp/PixelFormats/NormalizedByte4.cs index f7fe36cea..0cb5c756b 100644 --- a/src/ImageSharp/PixelFormats/NormalizedByte4.cs +++ b/src/ImageSharp/PixelFormats/NormalizedByte4.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing four 8-bit signed normalized values, ranging from −1 to 1. + /// Ranges from <-1, -1, -1, -1> to <1, 1, 1, 1> in vector form. /// public struct NormalizedByte4 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/NormalizedShort2.cs b/src/ImageSharp/PixelFormats/NormalizedShort2.cs index f0fba66e5..86d80cbad 100644 --- a/src/ImageSharp/PixelFormats/NormalizedShort2.cs +++ b/src/ImageSharp/PixelFormats/NormalizedShort2.cs @@ -10,6 +10,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing two 16-bit signed normalized values, ranging from −1 to 1. + /// Ranges from <-1, -1, 0, 1> to <1, 1, 0, 1> in vector form. /// public struct NormalizedShort2 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/NormalizedShort4.cs b/src/ImageSharp/PixelFormats/NormalizedShort4.cs index 6701aab03..8512d4131 100644 --- a/src/ImageSharp/PixelFormats/NormalizedShort4.cs +++ b/src/ImageSharp/PixelFormats/NormalizedShort4.cs @@ -10,6 +10,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing four 16-bit signed normalized values, ranging from −1 to 1. + /// Ranges from <-1, -1, -1, -1> to <1, 1, 1, 1> in vector form. /// public struct NormalizedShort4 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/Rg32.cs b/src/ImageSharp/PixelFormats/Rg32.cs index b0134d9b6..a4bfc5823 100644 --- a/src/ImageSharp/PixelFormats/Rg32.cs +++ b/src/ImageSharp/PixelFormats/Rg32.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing two 16-bit unsigned normalized values ranging from 0 to 1. + /// Ranges from <0, 0, 0, 1> to <1, 1, 0, 1> in vector form. /// public struct Rg32 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/Rgba1010102.cs b/src/ImageSharp/PixelFormats/Rgba1010102.cs index f014dbb8d..cfd60f410 100644 --- a/src/ImageSharp/PixelFormats/Rgba1010102.cs +++ b/src/ImageSharp/PixelFormats/Rgba1010102.cs @@ -12,6 +12,7 @@ namespace ImageSharp.PixelFormats /// /// Packed vector type containing unsigned normalized values ranging from 0 to 1. /// The x, y and z components use 10 bits, and the w component uses 2 bits. + /// Ranges from <0, 0, 0, 0> to <1, 1, 1, 1> in vector form. /// public struct Rgba1010102 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/Rgba32.BulkOperations.cs b/src/ImageSharp/PixelFormats/Rgba32.BulkOperations.cs index 42b37bebd..df21cdc70 100644 --- a/src/ImageSharp/PixelFormats/Rgba32.BulkOperations.cs +++ b/src/ImageSharp/PixelFormats/Rgba32.BulkOperations.cs @@ -10,14 +10,9 @@ namespace ImageSharp.PixelFormats using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - /// - /// Unpacked pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - /// The color components are stored in red, green, blue, and alpha order. - /// - /// - /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - /// as it avoids the need to create new values for modification operations. - /// + /// + /// Provides optimized overrides for bulk operations. + /// public partial struct Rgba32 { /// diff --git a/src/ImageSharp/PixelFormats/Rgba32.ColorspaceTransforms.cs b/src/ImageSharp/PixelFormats/Rgba32.ColorspaceTransforms.cs index f896eb69b..45d3489b7 100644 --- a/src/ImageSharp/PixelFormats/Rgba32.ColorspaceTransforms.cs +++ b/src/ImageSharp/PixelFormats/Rgba32.ColorspaceTransforms.cs @@ -9,14 +9,9 @@ namespace ImageSharp.PixelFormats using System.Numerics; using Colors.Spaces; - /// - /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - /// The color components are stored in red, green, blue, and alpha order. - /// - /// - /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - /// as it avoids the need to create new values for modification operations. - /// + /// + /// Provides implicit colorspace transformation. + /// public partial struct Rgba32 { /// diff --git a/src/ImageSharp/PixelFormats/Rgba32.Definitions.cs b/src/ImageSharp/PixelFormats/Rgba32.Definitions.cs index 3ba5f6133..be02d0875 100644 --- a/src/ImageSharp/PixelFormats/Rgba32.Definitions.cs +++ b/src/ImageSharp/PixelFormats/Rgba32.Definitions.cs @@ -5,14 +5,9 @@ namespace ImageSharp.PixelFormats { - /// - /// Packed vector type containing four 8-bit unsigned normalized values ranging from 0 to 255. - /// The color components are stored in red, green, blue, and alpha order. - /// - /// - /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - /// as it avoids the need to create new values for modification operations. - /// + /// + /// Provides standardized deifinitions for named colors. + /// public partial struct Rgba32 { /// diff --git a/src/ImageSharp/PixelFormats/Rgba32.Transforms.cs b/src/ImageSharp/PixelFormats/Rgba32.Transforms.cs index 86638b814..bd13a2de1 100644 --- a/src/ImageSharp/PixelFormats/Rgba32.Transforms.cs +++ b/src/ImageSharp/PixelFormats/Rgba32.Transforms.cs @@ -8,14 +8,9 @@ namespace ImageSharp.PixelFormats using System.Numerics; using System.Runtime.CompilerServices; - /// - /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - /// The color components are stored in red, green, blue, and alpha order. - /// - /// - /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - /// as it avoids the need to create new values for modification operations. - /// + /// + /// Provides operators and composition algorithms. + /// public partial struct Rgba32 { /// diff --git a/src/ImageSharp/PixelFormats/Rgba32.cs b/src/ImageSharp/PixelFormats/Rgba32.cs index 18759bce0..d668be76f 100644 --- a/src/ImageSharp/PixelFormats/Rgba32.cs +++ b/src/ImageSharp/PixelFormats/Rgba32.cs @@ -12,6 +12,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. /// The color components are stored in red, green, blue, and alpha order. + /// Ranges from <0, 0, 0, 0> to <1, 1, 1, 1> in vector form. /// /// /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, diff --git a/src/ImageSharp/PixelFormats/Rgba64.cs b/src/ImageSharp/PixelFormats/Rgba64.cs index a5f3e087c..20bba9f41 100644 --- a/src/ImageSharp/PixelFormats/Rgba64.cs +++ b/src/ImageSharp/PixelFormats/Rgba64.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing four 16-bit unsigned normalized values ranging from 0 to 1. + /// Ranges from <0, 0, 0, 0> to <1, 1, 1, 1> in vector form. /// public struct Rgba64 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/RgbaVector.BulkOperations.cs b/src/ImageSharp/PixelFormats/RgbaVector.BulkOperations.cs index 353412dd1..9dcfc9074 100644 --- a/src/ImageSharp/PixelFormats/RgbaVector.BulkOperations.cs +++ b/src/ImageSharp/PixelFormats/RgbaVector.BulkOperations.cs @@ -7,14 +7,9 @@ namespace ImageSharp.PixelFormats { using System.Numerics; - /// - /// Unpacked pixel type containing four 16-bit unsigned normalized values typically ranging from 0 to 1. - /// The color components are stored in red, green, blue, and alpha order. - /// - /// - /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - /// as it avoids the need to create new values for modification operations. - /// + /// + /// Provides optimized overrides for bulk operations. + /// public partial struct RgbaVector { /// diff --git a/src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs b/src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs index 61d24d191..dc965f9ff 100644 --- a/src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs +++ b/src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs @@ -5,14 +5,9 @@ namespace ImageSharp.PixelFormats { - /// - /// Unpacked pixel type containing four 16-bit floating-point values typically ranging from 0 to 1. - /// The color components are stored in red, green, blue, and alpha order. - /// - /// - /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - /// as it avoids the need to create new values for modification operations. - /// + /// + /// Provides operators and composition algorithms. + /// public partial struct RgbaVector { /// diff --git a/src/ImageSharp/PixelFormats/RgbaVector.Transforms.cs b/src/ImageSharp/PixelFormats/RgbaVector.Transforms.cs index 03b344721..fec1aa346 100644 --- a/src/ImageSharp/PixelFormats/RgbaVector.Transforms.cs +++ b/src/ImageSharp/PixelFormats/RgbaVector.Transforms.cs @@ -8,14 +8,9 @@ namespace ImageSharp.PixelFormats using System.Numerics; using System.Runtime.CompilerServices; - /// - /// Unpacked pixel type containing four 16-bit floating-point values typically ranging from 0 to 1. - /// The color components are stored in red, green, blue, and alpha order. - /// - /// - /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - /// as it avoids the need to create new values for modification operations. - /// + /// + /// Provides operators and composition algorithms. + /// public partial struct RgbaVector { /// diff --git a/src/ImageSharp/PixelFormats/RgbaVector.cs b/src/ImageSharp/PixelFormats/RgbaVector.cs index df5b231f3..c59e93259 100644 --- a/src/ImageSharp/PixelFormats/RgbaVector.cs +++ b/src/ImageSharp/PixelFormats/RgbaVector.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Unpacked pixel type containing four 16-bit floating-point values typically ranging from 0 to 1. /// The color components are stored in red, green, blue, and alpha order. + /// Ranges from <0, 0, 0, 0> to <1, 1, 1, 1> in vector form. /// /// /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance, diff --git a/src/ImageSharp/PixelFormats/Short2.cs b/src/ImageSharp/PixelFormats/Short2.cs index 0721718ff..60fbb5b35 100644 --- a/src/ImageSharp/PixelFormats/Short2.cs +++ b/src/ImageSharp/PixelFormats/Short2.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing two 16-bit signed integer values. + /// Ranges from <-32767, -32767, 0, 1> to <32767, 32767, 0, 1> in vector form. /// public struct Short2 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/Short4.cs b/src/ImageSharp/PixelFormats/Short4.cs index b5b4287df..65ce51eb2 100644 --- a/src/ImageSharp/PixelFormats/Short4.cs +++ b/src/ImageSharp/PixelFormats/Short4.cs @@ -11,6 +11,7 @@ namespace ImageSharp.PixelFormats /// /// Packed pixel type containing four 16-bit signed integer values. + /// Ranges from <-37267, -37267, -37267, -37267> to <37267, 37267, 37267, 37267> in vector form. /// public struct Short4 : IPixel, IPackedVector { diff --git a/src/ImageSharp/PixelFormats/Vector4BlendTransforms.cs b/src/ImageSharp/PixelFormats/Vector4BlendTransforms.cs index 17e1c7db5..87c7a289e 100644 --- a/src/ImageSharp/PixelFormats/Vector4BlendTransforms.cs +++ b/src/ImageSharp/PixelFormats/Vector4BlendTransforms.cs @@ -289,4 +289,4 @@ namespace ImageSharp.PixelFormats return b + s - (2F * b * s); } } -} +} \ No newline at end of file