From 35d7279f2ca4a7c28eba6dbed84931a783ce8bf1 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 28 Jul 2016 10:01:09 +1000 Subject: [PATCH] Fix Color Former-commit-id: ccebbd4c9cf2d42c17a76d82af8081cc4ac3080f Former-commit-id: 04ba5ac8e84a81a2b8f11b5d73eefe2278aa8899 Former-commit-id: 7e6ad2c1f3967b97a86c681d0678b6a5a8942722 --- .../Colors/PackedVector/Color.cs | 34 +++++++++---------- .../Jpg/JpegDecoderCore.cs.REMOVED.git-id | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/ImageProcessorCore/Colors/PackedVector/Color.cs b/src/ImageProcessorCore/Colors/PackedVector/Color.cs index cc6664c0d..4e4e817a8 100644 --- a/src/ImageProcessorCore/Colors/PackedVector/Color.cs +++ b/src/ImageProcessorCore/Colors/PackedVector/Color.cs @@ -54,33 +54,33 @@ namespace ImageProcessorCore /// /// Initializes a new instance of the struct. /// - /// The blue component. - /// The green component. /// The red component. + /// The green component. + /// The blue component. /// The alpha component. - public Color(float b, float g, float r, float a) + public Color(float r, float g, float b, float a) : this() { - Vector4 clamped = Vector4.Clamp(new Vector4(b, g, r, a), Vector4.Zero, Vector4.One) * 255F; - this.B = (byte)Math.Round(clamped.X); + Vector4 clamped = Vector4.Clamp(new Vector4(r, g, b, a), Vector4.Zero, Vector4.One) * 255F; + this.R = (byte)Math.Round(clamped.X); this.G = (byte)Math.Round(clamped.Y); - this.R = (byte)Math.Round(clamped.Z); + this.B = (byte)Math.Round(clamped.Z); this.A = (byte)Math.Round(clamped.W); } /// /// Initializes a new instance of the struct. /// - /// The blue component. - /// The green component. /// The red component. + /// The green component. + /// The blue component. /// The alpha component. - public Color(byte b, byte g, byte r, byte a) + public Color(byte r, byte g, byte b, byte a) : this() { - this.B = b; - this.G = g; this.R = r; + this.G = g; + this.B = b; this.A = a; } @@ -140,31 +140,31 @@ namespace ImageProcessorCore public void PackVector(Vector4 vector) { Vector4 clamped = Vector4.Clamp(vector, Vector4.Zero, Vector4.One) * 255F; - this.B = (byte)Math.Round(clamped.X); + this.R = (byte)Math.Round(clamped.X); this.G = (byte)Math.Round(clamped.Y); - this.R = (byte)Math.Round(clamped.Z); + this.B = (byte)Math.Round(clamped.Z); this.A = (byte)Math.Round(clamped.W); } /// public void PackBytes(byte x, byte y, byte z, byte w) { - this.B = x; + this.R = x; this.G = y; - this.R = z; + this.B = z; this.A = w; } /// public Vector4 ToVector4() { - return new Vector4(this.B, this.G, this.R, this.A) / 255F; + return new Vector4(this.R, this.G, this.B, this.A) / 255F; } /// public byte[] ToBytes() { - return new[] { this.B, this.G, this.R, this.A }; + return new[] { this.R, this.G, this.B, this.A }; } /// diff --git a/src/ImageProcessorCore/Formats/Jpg/JpegDecoderCore.cs.REMOVED.git-id b/src/ImageProcessorCore/Formats/Jpg/JpegDecoderCore.cs.REMOVED.git-id index 9e20e51de..de448dbb1 100644 --- a/src/ImageProcessorCore/Formats/Jpg/JpegDecoderCore.cs.REMOVED.git-id +++ b/src/ImageProcessorCore/Formats/Jpg/JpegDecoderCore.cs.REMOVED.git-id @@ -1 +1 @@ -45c6fbb81e384c9f75e75efc01c269f6e2b20006 \ No newline at end of file +09cbf92c0d7d3e4659626b60663612836e1e90e7 \ No newline at end of file