Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit 686bcdc

Browse files
committed
Merge pull request #16 from tparnell8/reanameCIEUCS
rename CIEUCS
2 parents 73713bd + 2114f0f commit 686bcdc

File tree

6 files changed

+23
-31
lines changed

6 files changed

+23
-31
lines changed

ColorSharp/ColorSharp.csproj

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -58,7 +58,7 @@
5858
<Compile Include="src\ColorSpaces\CIExyY.cs" />
5959
<Compile Include="src\InternalUtils\Comparers.cs" />
6060
<Compile Include="src\InternalUtils\Structs.cs" />
61-
<Compile Include="src\ColorSpaces\CIEUCS.cs" />
61+
<Compile Include="src\ColorSpaces\CIE1960.cs" />
6262
<Compile Include="src\Illuminants\CIE_D65.cs" />
6363
<Compile Include="src\Illuminants\CIE_A.cs" />
6464
<Compile Include="src\InternalUtils\IRealInterpolatedFunctionWithFiniteSupport.cs" />
@@ -88,15 +88,7 @@
8888
<Compile Include="src\Strategies\LMSStrategy.cs" />
8989
</ItemGroup>
9090
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
91-
<ItemGroup>
92-
<Folder Include="src\" />
93-
<Folder Include="src\ColorSpaces\" />
94-
<Folder Include="src\LightSpectrums\" />
95-
<Folder Include="src\MatchingFunctions\" />
96-
<Folder Include="src\InternalUtils\" />
97-
<Folder Include="src\Illuminants\" />
98-
<Folder Include="src\Strategies\" />
99-
</ItemGroup>
91+
<ItemGroup />
10092
<ItemGroup>
10193
<None Include="ColorSharp.nuspec" />
10294
<None Include="build_nuget_pkg.sh" />

ColorSharp/src/ColorSpaces/AConvertibleColor.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ AConvertibleColor InnerConvertTo (Type t)
108108
return ToCIEXYZ ();
109109
if (t == typeof(CIExyY))
110110
return ToCIExyY();
111-
if (t == typeof(CIEUCS))
111+
if (t == typeof(CIE1960))
112112
return ToCIEUCS ();
113113
if (t == typeof(SRGB))
114114
return ToSRGB ();
@@ -183,9 +183,9 @@ public virtual CIExyY ToCIExyY ()
183183
/**
184184
* <summary>Converts the color sample to a CIE's 1960 UCS color sample.</summary>
185185
*/
186-
public virtual CIEUCS ToCIEUCS ()
186+
public virtual CIE1960 ToCIEUCS ()
187187
{
188-
return (DataSource as CIEUCS) ?? ToCIEXYZ ().ToCIEUCS ();
188+
return (DataSource as CIE1960) ?? ToCIEXYZ ().ToCIEUCS ();
189189
}
190190

191191
/**

ColorSharp/src/ColorSpaces/CIEUCS.cs ColorSharp/src/ColorSpaces/CIE1960.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace ColorSpaces
4141
/**
4242
* <summary>CIE's 1960 UCS Color Space. Also named CIE's 1960 Yuv Color Space.</summary>
4343
*/
44-
public sealed class CIEUCS : AConvertibleColor
44+
public sealed class CIE1960 : AConvertibleColor
4545
{
4646
#region properties
4747

@@ -78,7 +78,7 @@ public sealed class CIEUCS : AConvertibleColor
7878
*/
7979
public double Y { get { return V; } }
8080

81-
static List<CIEUCS> TemperatureChromaticities = null;
81+
static List<CIE1960> TemperatureChromaticities = null;
8282

8383
double CCT = double.NaN;
8484

@@ -96,7 +96,7 @@ public sealed class CIEUCS : AConvertibleColor
9696
* <param name="W">CIE's 1960 UCS W coordinate</param>
9797
* <param name="dataSource">If you aren't working with ColorSharp internals, don't use this parameter</param>
9898
*/
99-
public CIEUCS (double U, double V, double W, AConvertibleColor dataSource=null) : base(dataSource)
99+
public CIE1960 (double U, double V, double W, AConvertibleColor dataSource=null) : base(dataSource)
100100
{
101101
if (U < 0.0 || V < 0.0 || W < 0.0) {
102102
throw new ArgumentException ("Invalid color point");
@@ -120,7 +120,7 @@ public CIEUCS (double U, double V, double W, AConvertibleColor dataSource=null)
120120
* <param name="W">CIE's 1960 UCS W coordinate</param>
121121
* <param name="dataSource">If you aren't working with ColorSharp internals, don't use this parameter</param>
122122
*/
123-
public CIEUCS (AConvertibleColor dataSource, double u, double v, double W) : base(dataSource)
123+
public CIE1960 (AConvertibleColor dataSource, double u, double v, double W) : base(dataSource)
124124
{
125125
if (u < 0.0 || v < 0.0 || W < 0 || u + v > 1.0) {
126126
throw new ArgumentException ("Invalid color point");
@@ -150,7 +150,7 @@ public CIEUCS (AConvertibleColor dataSource, double u, double v, double W) : bas
150150
* <param name="W">CIE's 1960 UCS W coordinate</param>
151151
* <param name="dataSource">If you aren't working with ColorSharp internals, don't use this parameter</param>
152152
*/
153-
public CIEUCS (double U, double V, double u, double v, double W, AConvertibleColor dataSource=null) : base(dataSource)
153+
public CIE1960 (double U, double V, double u, double v, double W, AConvertibleColor dataSource=null) : base(dataSource)
154154
{
155155
if (U < 0.0 || V < 0.0 || W < 0.0 || u < 0.0 || v < 0.0) {
156156
throw new ArgumentException ("Invalid color point");
@@ -203,7 +203,7 @@ public override double GetCCT ()
203203
// Precomputing interpolation tables...
204204
if (TemperatureChromaticities == null) {
205205
// Oversized to improve alignment (needs 302).
206-
TemperatureChromaticities = new List<CIEUCS> (512);
206+
TemperatureChromaticities = new List<CIE1960> (512);
207207

208208
// From 1000º K to 20000º K
209209
for (double t = 1000.0; t < 20001.0; t *= 1.01) {
@@ -286,7 +286,7 @@ public override CIEXYZ ToCIEXYZ ()
286286
/**
287287
* <inheritdoc />
288288
*/
289-
public override CIEUCS ToCIEUCS ()
289+
public override CIE1960 ToCIEUCS ()
290290
{
291291
return this;
292292
}
@@ -301,7 +301,7 @@ public override CIEUCS ToCIEUCS ()
301301
*/
302302
public override bool Equals(Object obj)
303303
{
304-
CIEUCS ucsObj = obj as CIEUCS;
304+
CIE1960 ucsObj = obj as CIE1960;
305305

306306
if (ucsObj == this) {
307307
return true;

ColorSharp/src/ColorSpaces/CIEXYZ.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ public override CIExyY ToCIExyY ()
137137
/**
138138
* <inheritdoc />
139139
*/
140-
public override CIEUCS ToCIEUCS ()
140+
public override CIE1960 ToCIEUCS ()
141141
{
142-
return (DataSource as CIEUCS) ?? new CIEUCS (
142+
return (DataSource as CIE1960) ?? new CIE1960 (
143143
2.0 * X / 3.0, // U
144144
Y, // V
145145
4 * X / (X + 15 * Y + 3 * Z), // u

ColorSharp/src/ColorSpaces/CIExyY.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ public override CIExyY ToCIExyY ()
193193
/**
194194
* <inheritdoc />
195195
*/
196-
public override CIEUCS ToCIEUCS ()
196+
public override CIE1960 ToCIEUCS ()
197197
{
198-
if (DataSource is CIEUCS) {
199-
return DataSource as CIEUCS;
198+
if (DataSource is CIE1960) {
199+
return DataSource as CIE1960;
200200
}
201201

202202
// Warning, it's not a good idea to do it with other types, we do with CIEXYZ bacause
@@ -208,7 +208,7 @@ public override CIEUCS ToCIEUCS ()
208208
double div = (12 * y - 2 * x + 3);
209209
double yy = Y / y;
210210

211-
return new CIEUCS (
211+
return new CIE1960 (
212212
DataSource ?? this,
213213
4 * x / div, 6 * y / div, 0.5 * (-x * yy + 3 * Y + yy * (1.0 - x - y))
214214
);

ColorSharpTests/tests/ColorSpaces/AColorTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public void TestConversionSimpleChains()
5050
);
5151

5252
Assert.AreEqual (
53-
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIEUCS> (),
54-
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIExyY> ().ConvertTo<CIEUCS> ()
53+
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIE1960> (),
54+
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIExyY> ().ConvertTo<CIE1960> ()
5555
);
5656

5757
Assert.AreEqual (
5858
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIExyY> (),
59-
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIEUCS> ().ConvertTo<CIExyY> ()
59+
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIE1960> ().ConvertTo<CIExyY> ()
6060
);
6161

6262
// From xyY

0 commit comments

Comments
 (0)