From 493d91c671e5a2e95f118676563960d3485dbf24 Mon Sep 17 00:00:00 2001 From: James South Date: Sat, 2 Apr 2016 22:40:11 +1100 Subject: [PATCH] Clean up colors Former-commit-id: ef3fb067f37be5af30955604ef8f7e788c060fc8 Former-commit-id: fdf15de4bf1184ae07ffdeb37e0219e960dd9db5 Former-commit-id: 6ab66cdb8fd7f82c38b6ddc5ac11364c09accd97 --- src/ImageProcessorCore/Colors/Color.cs | 13 +----- .../Colors/Colorspaces/Bgra32.cs | 43 +++---------------- 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/src/ImageProcessorCore/Colors/Color.cs b/src/ImageProcessorCore/Colors/Color.cs index a33ee7c82..b86a2dfa0 100644 --- a/src/ImageProcessorCore/Colors/Color.cs +++ b/src/ImageProcessorCore/Colors/Color.cs @@ -34,17 +34,6 @@ namespace ImageProcessorCore /// private Vector4 backingVector; - /// - /// Initializes a new instance of the struct with the alpha component set to 1. - /// - /// The red component of this . - /// The green component of this . - /// The blue component of this . - public Color(float r, float g, float b) - : this(r, g, b, 1) - { - } - /// /// Initializes a new instance of the struct. /// @@ -52,7 +41,7 @@ namespace ImageProcessorCore /// The green component of this . /// The blue component of this . /// The alpha component of this . - public Color(float r, float g, float b, float a) + public Color(float r, float g, float b, float a = 1) : this() { this.backingVector = new Vector4(r, g, b, a); diff --git a/src/ImageProcessorCore/Colors/Colorspaces/Bgra32.cs b/src/ImageProcessorCore/Colors/Colorspaces/Bgra32.cs index 919b358f7..e31d693bb 100644 --- a/src/ImageProcessorCore/Colors/Colorspaces/Bgra32.cs +++ b/src/ImageProcessorCore/Colors/Colorspaces/Bgra32.cs @@ -24,17 +24,6 @@ namespace ImageProcessorCore /// private Vector4 backingVector; - /// - /// Initializes a new instance of the struct. - /// - /// The blue component of this . - /// The green component of this . - /// The red component of this . - public Bgra32(byte b, byte g, byte r) - : this(b, g, r, 255) - { - } - /// /// Initializes a new instance of the struct. /// @@ -42,7 +31,7 @@ namespace ImageProcessorCore /// The green component of this . /// The red component of this . /// The alpha component of this . - public Bgra32(byte b, byte g, byte r, byte a) + public Bgra32(byte b, byte g, byte r, byte a = 255) : this() { this.backingVector = Vector4.Clamp(new Vector4(b, g, r, a), Vector4.Zero, new Vector4(255)); @@ -129,13 +118,7 @@ namespace ImageProcessorCore return !left.Equals(right); } - /// - /// Indicates whether this instance and a specified object are equal. - /// - /// - /// true if and this instance are the same type and represent the same value; otherwise, false. - /// - /// Another object to compare to. + /// public override bool Equals(object obj) { if (obj is Bgra32) @@ -148,23 +131,13 @@ namespace ImageProcessorCore return false; } - /// - /// Returns the hash code for this instance. - /// - /// - /// A 32-bit signed integer that is the hash code for this instance. - /// + /// public override int GetHashCode() { return GetHashCode(this); } - /// - /// Returns the fully qualified type name of this instance. - /// - /// - /// A containing a fully qualified type name. - /// + /// public override string ToString() { if (this.IsEmpty) @@ -175,13 +148,7 @@ namespace ImageProcessorCore return $"Bgra32 [ B={this.B}, G={this.G}, R={this.R}, A={this.A} ]"; } - /// - /// Indicates whether the current object is equal to another object of the same type. - /// - /// - /// True if the current object is equal to the parameter; otherwise, false. - /// - /// An object to compare with this object. + /// public bool Equals(Bgra32 other) { return this.backingVector.Equals(other.backingVector);