Browse Source

removed unnecessary warnings, added source headers

af/merge-core
Anton Firszov 9 years ago
parent
commit
c6a52884b9
  1. 7
      src/ImageSharp/PixelFormats/Bgr24.cs
  2. 7
      src/ImageSharp/PixelFormats/Bgra32.cs
  3. 42
      src/ImageSharp/PixelFormats/Bgra4444.cs
  4. 16
      src/ImageSharp/PixelFormats/NormalizedByte2.cs
  5. 28
      src/ImageSharp/PixelFormats/NormalizedByte4.cs
  6. 5
      src/ImageSharp/PixelFormats/Rgb24.cs
  7. 6
      src/Shared/stylecop.json

7
src/ImageSharp/PixelFormats/Bgr24.cs

@ -1,4 +1,9 @@
namespace ImageSharp.PixelFormats
// <copyright file="Bgr24.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.PixelFormats
{
using System;
using System.Numerics;

7
src/ImageSharp/PixelFormats/Bgra32.cs

@ -1,4 +1,9 @@
namespace ImageSharp.PixelFormats
// <copyright file="Bgra32.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.PixelFormats
{
using System;
using System.Numerics;

42
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);
}
/// <inheritdoc />
@ -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;
}
/// <inheritdoc />
@ -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;
}
/// <inheritdoc />
@ -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;
}
/// <inheritdoc />
@ -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;
}
/// <inheritdoc />
@ -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));
}
}
}

16
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;
}

28
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;
}
/// <inheritdoc />
@ -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;
}
/// <inheritdoc />
@ -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;
}
/// <inheritdoc />
@ -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;
}
/// <inheritdoc />

5
src/ImageSharp/PixelFormats/Rgb24.cs

@ -1,3 +1,8 @@
// <copyright file="Rgb24.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.PixelFormats
{
using System;

6
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
}
}
}
Loading…
Cancel
Save