This repository was archived by the owner on Dec 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 13 files changed +128
-54
lines changed Expand file tree Collapse file tree 13 files changed +128
-54
lines changed Original file line number Diff line number Diff line change 1
1
ColorSharp's Changelog
2
2
======================
3
3
4
+ ## 2014-12-19 : 0.8.3 Release
5
+
6
+ ### Contributors
7
+ * Andrés Correa Casablanca <castarco@gmail.com , castarco@litipk.com >
8
+
9
+ ### Changes
10
+ * Updated MathNet.Numerics dependency
11
+ * Added HashCode to light spectrum objects
12
+ * Minor performance tweaks
13
+
14
+
4
15
## 2014-12-05 : 0.8.2 Release
5
16
6
17
### Contributors
7
18
* Andrés Correa Casablanca <castarco@gmail.com , castarco@litipk.com >
8
19
9
- ## Minor changes
20
+ ### Minor changes
10
21
* Added new constructor to the RegularLightSpectrum class.
11
22
12
23
## 2014-11-12 : 0.8.1 Release
Original file line number Diff line number Diff line change 34
34
$0 .VersionControlPolicy = $2
35
35
$2 .inheritsSet = Mono
36
36
description = A .Net /Mono library to handle color spaces (and light spectrums !)
37
- version = 0.8.2
37
+ version = 0.8.3
38
38
EndGlobalSection
39
39
EndGlobal
Original file line number Diff line number Diff line change 11
11
<SignAssembly >true</SignAssembly >
12
12
<DelaySign >false</DelaySign >
13
13
<AssemblyOriginatorKeyFile >colorsharp.snk</AssemblyOriginatorKeyFile >
14
- <ReleaseVersion >0.8.2 </ReleaseVersion >
14
+ <ReleaseVersion >0.8.3 </ReleaseVersion >
15
15
</PropertyGroup >
16
16
<PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " >
17
17
<DebugSymbols >true</DebugSymbols >
42
42
</PropertyGroup >
43
43
<ItemGroup >
44
44
<Reference Include =" System" />
45
+ <Reference Include =" System.Numerics" />
45
46
<Reference Include =" MathNet.Numerics" >
46
- <HintPath >..\packages\MathNet.Numerics.Signed.3.2.3 \lib\net40\MathNet.Numerics.dll</HintPath >
47
+ <HintPath >..\packages\MathNet.Numerics.Signed.3.3.0 \lib\net40\MathNet.Numerics.dll</HintPath >
47
48
</Reference >
48
- <Reference Include =" System.Numerics" />
49
49
</ItemGroup >
50
50
<ItemGroup >
51
51
<Compile Include =" Properties\AssemblyInfo.cs" />
81
81
<Folder Include =" src\Illuminants\" />
82
82
</ItemGroup >
83
83
<ItemGroup >
84
- <None Include =" packages.config" />
85
84
<None Include =" ColorSharp.nuspec" />
86
85
<None Include =" build_nuget_pkg.sh" />
87
86
<None Include =" colorsharp.pub" />
87
+ <None Include =" packages.config" />
88
88
</ItemGroup >
89
89
</Project >
Original file line number Diff line number Diff line change 11
11
<requireLicenseAcceptance >false</requireLicenseAcceptance >
12
12
<description >$description$</description >
13
13
<releaseNotes >
14
- - Bugfix in the D65 Illuminant (spectrum sample)
14
+ - Updated MathNet.Numerics dependency
15
+ - Added HashCode to light spectrum objects
16
+ - Minor performance tweaks
15
17
</releaseNotes >
16
18
<copyright >Copyright 2014</copyright >
17
19
<tags >Light Color Colour CIEXYZ CIExyY sRGB</tags >
Original file line number Diff line number Diff line change 46
46
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
47
47
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
48
48
49
- [ assembly: AssemblyVersion ( "0.8.2 .*" ) ]
49
+ [ assembly: AssemblyVersion ( "0.8.3 .*" ) ]
50
50
51
51
// The following attributes are used to specify the signing key for the assembly,
52
52
// if desired. See the Mono documentation for more information about signing.
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<packages >
3
- <package id =" MathNet.Numerics.Signed" version =" 3.2.3 " targetFramework =" net40" />
3
+ <package id =" MathNet.Numerics.Signed" version =" 3.3.0 " targetFramework =" net40" />
4
4
</packages >
Original file line number Diff line number Diff line change @@ -164,28 +164,26 @@ public override bool Equals(Object obj)
164
164
{
165
165
CIEXYZ xyzObj = obj as CIEXYZ ;
166
166
167
- if ( xyzObj == null || GetHashCode ( ) != obj . GetHashCode ( ) )
167
+ if ( xyzObj == this ) {
168
+ return true ;
169
+ }
170
+ if ( xyzObj == null || GetHashCode ( ) != obj . GetHashCode ( ) ) {
168
171
return false ;
172
+ }
169
173
170
- return (
171
- Math . Abs ( X - xyzObj . X ) <= double . Epsilon &&
172
- Math . Abs ( Y - xyzObj . Y ) <= double . Epsilon &&
173
- Math . Abs ( Z - xyzObj . Z ) <= double . Epsilon
174
- ) ;
174
+ return ( X == xyzObj . X && Y == xyzObj . Y && Z == xyzObj . Z ) ;
175
175
}
176
176
177
177
/**
178
178
* <inheritdoc />
179
179
*/
180
180
public override int GetHashCode ( )
181
181
{
182
- int hash = 23 ;
182
+ int hash = 30967 + X . GetHashCode ( ) ; // 30967 == 173 * 179
183
183
184
- hash = hash * 57 + X . GetHashCode ( ) ;
185
- hash = hash * 57 + Y . GetHashCode ( ) ;
186
- hash = hash * 57 + Z . GetHashCode ( ) ;
184
+ hash = hash * 179 + Y . GetHashCode ( ) ;
187
185
188
- return hash ;
186
+ return hash * 179 + Z . GetHashCode ( ) ;
189
187
}
190
188
191
189
#endregion
Original file line number Diff line number Diff line change @@ -196,28 +196,26 @@ public override bool Equals(Object obj)
196
196
{
197
197
CIExyY xyYObj = obj as CIExyY ;
198
198
199
- if ( xyYObj == null || GetHashCode ( ) != obj . GetHashCode ( ) )
199
+ if ( xyYObj == this ) {
200
+ return true ;
201
+ }
202
+ if ( xyYObj == null || GetHashCode ( ) != obj . GetHashCode ( ) ) {
200
203
return false ;
204
+ }
201
205
202
- return (
203
- Math . Abs ( x - xyYObj . x ) <= double . Epsilon &&
204
- Math . Abs ( y - xyYObj . y ) <= double . Epsilon &&
205
- Math . Abs ( Y - xyYObj . Y ) <= double . Epsilon
206
- ) ;
206
+ return ( x == xyYObj . x && y == xyYObj . y && Y == xyYObj . Y ) ;
207
207
}
208
208
209
209
/**
210
210
* <inheritdoc />
211
211
*/
212
212
public override int GetHashCode ( )
213
213
{
214
- int hash = 19 ;
214
+ int hash = 28891 + x . GetHashCode ( ) ; // 28891 == 167 * 173
215
215
216
- hash = hash * 31 + x . GetHashCode ( ) ;
217
- hash = hash * 31 + y . GetHashCode ( ) ;
218
- hash = hash * 31 + Y . GetHashCode ( ) ;
216
+ hash = hash * 173 + y . GetHashCode ( ) ;
219
217
220
- return hash ;
218
+ return hash * 173 + Y . GetHashCode ( ) ;
221
219
}
222
220
223
221
#endregion
Original file line number Diff line number Diff line change @@ -140,28 +140,26 @@ public override bool Equals(Object obj)
140
140
{
141
141
SRGB srgbObj = obj as SRGB ;
142
142
143
- if ( srgbObj == null || GetHashCode ( ) != obj . GetHashCode ( ) )
143
+ if ( srgbObj == this ) {
144
+ return true ;
145
+ }
146
+ if ( srgbObj == null || GetHashCode ( ) != obj . GetHashCode ( ) ) {
144
147
return false ;
148
+ }
145
149
146
- return (
147
- Math . Abs ( R - srgbObj . R ) <= double . Epsilon &&
148
- Math . Abs ( G - srgbObj . G ) <= double . Epsilon &&
149
- Math . Abs ( B - srgbObj . B ) <= double . Epsilon
150
- ) ;
150
+ return ( R == srgbObj . R && G == srgbObj . G && B == srgbObj . B ) ;
151
151
}
152
152
153
153
/**
154
154
* <inheritdoc />
155
155
*/
156
156
public override int GetHashCode ( )
157
157
{
158
- int hash = 17 ;
158
+ int hash = 32399 + R . GetHashCode ( ) ; // 32399 == 179 * 181
159
159
160
- hash = hash * 19 + R . GetHashCode ( ) ;
161
- hash = hash * 19 + G . GetHashCode ( ) ;
162
- hash = hash * 19 + B . GetHashCode ( ) ;
160
+ hash = hash * 181 + G . GetHashCode ( ) ;
163
161
164
- return hash ;
162
+ return hash * 181 + B . GetHashCode ( ) ;
165
163
}
166
164
167
165
#endregion
Original file line number Diff line number Diff line change 27
27
*/
28
28
29
29
30
- using System ;
31
- using System . Collections . Generic ;
30
+ using Litipk . ColorSharp . ColorSpaces ;
31
+ using Litipk . ColorSharp . MatchingFunctions ;
32
+ using Litipk . ColorSharp . InternalUtils ;
32
33
33
34
34
35
namespace Litipk . ColorSharp
35
36
{
36
- using ColorSpaces ;
37
- using MatchingFunctions ;
38
- using InternalUtils ;
39
-
40
37
namespace LightSpectrums
41
38
{
42
39
/**
You can’t perform that action at this time.
0 commit comments