From c6a52884b95a116dc954492d860effee02b95c29 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 5 Jun 2017 04:57:25 +0200 Subject: [PATCH] removed unnecessary warnings, added source headers --- src/ImageSharp/PixelFormats/Bgr24.cs | 7 +++- src/ImageSharp/PixelFormats/Bgra32.cs | 7 +++- src/ImageSharp/PixelFormats/Bgra4444.cs | 42 +++++++++---------- .../PixelFormats/NormalizedByte2.cs | 16 +++---- .../PixelFormats/NormalizedByte4.cs | 28 ++++++------- src/ImageSharp/PixelFormats/Rgb24.cs | 5 +++ src/Shared/stylecop.json | 6 --- 7 files changed, 60 insertions(+), 51 deletions(-) diff --git a/src/ImageSharp/PixelFormats/Bgr24.cs b/src/ImageSharp/PixelFormats/Bgr24.cs index cc7720044..aaed5c385 100644 --- a/src/ImageSharp/PixelFormats/Bgr24.cs +++ b/src/ImageSharp/PixelFormats/Bgr24.cs @@ -1,4 +1,9 @@ -namespace ImageSharp.PixelFormats +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.PixelFormats { using System; using System.Numerics; diff --git a/src/ImageSharp/PixelFormats/Bgra32.cs b/src/ImageSharp/PixelFormats/Bgra32.cs index 8146321b9..f1ac20b56 100644 --- a/src/ImageSharp/PixelFormats/Bgra32.cs +++ b/src/ImageSharp/PixelFormats/Bgra32.cs @@ -1,4 +1,9 @@ -namespace ImageSharp.PixelFormats +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.PixelFormats { using System; using System.Numerics; diff --git a/src/ImageSharp/PixelFormats/Bgra4444.cs b/src/ImageSharp/PixelFormats/Bgra4444.cs index d10ea58c7..746e1062b 100644 --- a/src/ImageSharp/PixelFormats/Bgra4444.cs +++ b/src/ImageSharp/PixelFormats/Bgra4444.cs @@ -79,10 +79,10 @@ namespace ImageSharp.PixelFormats const float Max = 1 / 15F; return new Vector4( - ((this.PackedValue >> 8) & 0x0F) * Max, - ((this.PackedValue >> 4) & 0x0F) * Max, - (this.PackedValue & 0x0F) * Max, - ((this.PackedValue >> 12) & 0x0F) * Max); + ((this.PackedValue >> 8) & 0x0F) * Max, + ((this.PackedValue >> 4) & 0x0F) * Max, + (this.PackedValue & 0x0F) * Max, + ((this.PackedValue >> 12) & 0x0F) * Max); } /// @@ -104,9 +104,9 @@ namespace ImageSharp.PixelFormats public void ToRgb24(ref Rgb24 dest) { Vector4 vector = this.ToVector4() * 255F; - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); - dest.B = (byte)MathF.Round(vector.Z); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; + dest.B = (byte)vector.Z; } /// @@ -114,10 +114,10 @@ namespace ImageSharp.PixelFormats public void ToRgba32(ref Rgba32 dest) { Vector4 vector = this.ToVector4() * 255F; - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); - dest.B = (byte)MathF.Round(vector.Z); - dest.A = (byte)MathF.Round(vector.W); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; + dest.B = (byte)vector.Z; + dest.A = (byte)vector.W; } /// @@ -125,9 +125,9 @@ namespace ImageSharp.PixelFormats public void ToBgr24(ref Bgr24 dest) { Vector4 vector = this.ToVector4() * 255F; - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); - dest.B = (byte)MathF.Round(vector.Z); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; + dest.B = (byte)vector.Z; } /// @@ -135,10 +135,10 @@ namespace ImageSharp.PixelFormats public void ToBgra32(ref Bgra32 dest) { Vector4 vector = this.ToVector4() * 255F; - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); - dest.B = (byte)MathF.Round(vector.Z); - dest.A = (byte)MathF.Round(vector.W); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; + dest.B = (byte)vector.Z; + dest.A = (byte)vector.W; } /// @@ -179,9 +179,9 @@ namespace ImageSharp.PixelFormats private static ushort Pack(float x, float y, float z, float w) { return (ushort)((((int)Math.Round(w.Clamp(0, 1) * 15F) & 0x0F) << 12) | - (((int)Math.Round(x.Clamp(0, 1) * 15F) & 0x0F) << 8) | - (((int)Math.Round(y.Clamp(0, 1) * 15F) & 0x0F) << 4) | - ((int)Math.Round(z.Clamp(0, 1) * 15F) & 0x0F)); + (((int)Math.Round(x.Clamp(0, 1) * 15F) & 0x0F) << 8) | + (((int)Math.Round(y.Clamp(0, 1) * 15F) & 0x0F) << 4) | + ((int)Math.Round(z.Clamp(0, 1) * 15F) & 0x0F)); } } } diff --git a/src/ImageSharp/PixelFormats/NormalizedByte2.cs b/src/ImageSharp/PixelFormats/NormalizedByte2.cs index 387cb6f41..992986f92 100644 --- a/src/ImageSharp/PixelFormats/NormalizedByte2.cs +++ b/src/ImageSharp/PixelFormats/NormalizedByte2.cs @@ -137,8 +137,8 @@ namespace ImageSharp.PixelFormats public void ToRgb24(ref Rgb24 dest) { Vector4 vector = this.ToScaledVector4(); - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; dest.B = 0; } @@ -147,8 +147,8 @@ namespace ImageSharp.PixelFormats public void ToRgba32(ref Rgba32 dest) { Vector4 vector = this.ToScaledVector4(); - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; dest.B = 0; dest.A = 255; } @@ -158,8 +158,8 @@ namespace ImageSharp.PixelFormats public void ToBgr24(ref Bgr24 dest) { Vector4 vector = this.ToScaledVector4(); - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; dest.B = 0; } @@ -168,8 +168,8 @@ namespace ImageSharp.PixelFormats public void ToBgra32(ref Bgra32 dest) { Vector4 vector = this.ToScaledVector4(); - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; dest.B = 0; dest.A = 255; } diff --git a/src/ImageSharp/PixelFormats/NormalizedByte4.cs b/src/ImageSharp/PixelFormats/NormalizedByte4.cs index 90657c3ac..99f603f69 100644 --- a/src/ImageSharp/PixelFormats/NormalizedByte4.cs +++ b/src/ImageSharp/PixelFormats/NormalizedByte4.cs @@ -130,9 +130,9 @@ namespace ImageSharp.PixelFormats public void ToRgb24(ref Rgb24 dest) { Vector4 vector = this.ToScaledVector4(); - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); - dest.B = (byte)MathF.Round(vector.Z); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; + dest.B = (byte)vector.Z; } /// @@ -140,10 +140,10 @@ namespace ImageSharp.PixelFormats public void ToRgba32(ref Rgba32 dest) { Vector4 vector = this.ToScaledVector4(); - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); - dest.B = (byte)MathF.Round(vector.Z); - dest.A = (byte)MathF.Round(vector.W); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; + dest.B = (byte)vector.Z; + dest.A = (byte)vector.W; } /// @@ -151,9 +151,9 @@ namespace ImageSharp.PixelFormats public void ToBgr24(ref Bgr24 dest) { Vector4 vector = this.ToScaledVector4(); - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); - dest.B = (byte)MathF.Round(vector.Z); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; + dest.B = (byte)vector.Z; } /// @@ -161,10 +161,10 @@ namespace ImageSharp.PixelFormats public void ToBgra32(ref Bgra32 dest) { Vector4 vector = this.ToScaledVector4(); - dest.R = (byte)MathF.Round(vector.X); - dest.G = (byte)MathF.Round(vector.Y); - dest.B = (byte)MathF.Round(vector.Z); - dest.A = (byte)MathF.Round(vector.W); + dest.R = (byte)vector.X; + dest.G = (byte)vector.Y; + dest.B = (byte)vector.Z; + dest.A = (byte)vector.W; } /// diff --git a/src/ImageSharp/PixelFormats/Rgb24.cs b/src/ImageSharp/PixelFormats/Rgb24.cs index 47dd96055..b8cc8dc24 100644 --- a/src/ImageSharp/PixelFormats/Rgb24.cs +++ b/src/ImageSharp/PixelFormats/Rgb24.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + namespace ImageSharp.PixelFormats { using System; diff --git a/src/Shared/stylecop.json b/src/Shared/stylecop.json index 4f8205d06..df8f120a5 100644 --- a/src/Shared/stylecop.json +++ b/src/Shared/stylecop.json @@ -4,12 +4,6 @@ "documentationRules": { "companyName": "James Jackson-South", "copyrightText": "Copyright (c) James Jackson-South and contributors.\nLicensed under the Apache License, Version 2.0." - //, - //"documentInterfaces": false, - //"documentInternalElements": false, - //"documentExposedElements": false, - //"documentPrivateElements": false, - //"documentPrivateFields": false } } } \ No newline at end of file