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

Commit c529754

Browse files
committed
Added CIE B, C and D50 illuminants
1 parent 308b1b8 commit c529754

File tree

5 files changed

+425
-4
lines changed

5 files changed

+425
-4
lines changed

ColorSharp/ColorSharp.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
<Compile Include="src\MatchingFunctions\CIE1964XYZ5Nm10DegZ.cs" />
8282
<Compile Include="src\ColorSpaces\ColorStrategy.cs" />
8383
<Compile Include="src\LightSpectrums\SpectrumStrategy.cs" />
84+
<Compile Include="src\Illuminants\CIE_B.cs" />
85+
<Compile Include="src\Illuminants\CIE_C.cs" />
86+
<Compile Include="src\Illuminants\CIE_D50.cs" />
8487
</ItemGroup>
8588
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
8689
<ItemGroup>

ColorSharp/src/Illuminants/CIE_B.cs

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/*
2+
* The MIT License (MIT)
3+
* Copyright (c) 2014 Andrés Correa Casablanca
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
/*
25+
* Contributors:
26+
* - Andrés Correa Casablanca <castarco@gmail.com , castarco@litipk.com>
27+
*/
28+
29+
30+
using Litipk.ColorSharp.ColorSpaces;
31+
using Litipk.ColorSharp.LightSpectrums;
32+
33+
34+
namespace Litipk.ColorSharp
35+
{
36+
namespace Illuminants
37+
{
38+
/**
39+
* <summary>
40+
* The CIE Illuminant B is a (deprecated) daylight simulator intended to represent direct
41+
* noon sunlight with a correlated colour temperature of 4874 K.
42+
* </summary>
43+
*/
44+
public static class CIE_B
45+
{
46+
/**
47+
* <value>'B' expressed in its 'original form', a light spectrum.</value>
48+
*/
49+
public static readonly RegularLightSpectrum spectrum_Sample = new RegularLightSpectrum(
50+
340, 770, new [] {
51+
2.40,
52+
4.00,
53+
5.60,
54+
7.60,
55+
9.60,
56+
12.40,
57+
15.20,
58+
18.80,
59+
22.40,
60+
26.85,
61+
31.30,
62+
36.18,
63+
41.30,
64+
46.62,
65+
52.10,
66+
57.70,
67+
63.20,
68+
68.37,
69+
73.10,
70+
77.31,
71+
80.80,
72+
83.44,
73+
85.40,
74+
86.88,
75+
88.30,
76+
90.08,
77+
92.00,
78+
93.75,
79+
95.20,
80+
96.23,
81+
96.50,
82+
95.71,
83+
94.20,
84+
92.37,
85+
90.70,
86+
89.65,
87+
89.50,
88+
90.43,
89+
92.20,
90+
94.46,
91+
96.90,
92+
99.16,
93+
101.00,
94+
102.20,
95+
102.80,
96+
102.92,
97+
102.60,
98+
101.90,
99+
101.00,
100+
100.07,
101+
99.20,
102+
98.44,
103+
98.00,
104+
98.08,
105+
98.50,
106+
99.06,
107+
99.70,
108+
100.36,
109+
101.00,
110+
101.56,
111+
102.20,
112+
103.05,
113+
103.90,
114+
104.59,
115+
105.00,
116+
105.08,
117+
104.90,
118+
104.55,
119+
103.90,
120+
102.84,
121+
101.60,
122+
100.38,
123+
99.10,
124+
97.70,
125+
96.20,
126+
94.60,
127+
92.90,
128+
91.10,
129+
89.40,
130+
88.00,
131+
86.90,
132+
85.90,
133+
85.20,
134+
84.80,
135+
84.70,
136+
84.90,
137+
85.40
138+
}
139+
);
140+
}
141+
}
142+
}
143+
144+

ColorSharp/src/Illuminants/CIE_C.cs

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
/*
2+
* The MIT License (MIT)
3+
* Copyright (c) 2014 Andrés Correa Casablanca
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
23+
24+
/*
25+
* Contributors:
26+
* - Andrés Correa Casablanca <castarco@gmail.com , castarco@litipk.com>
27+
*/
28+
29+
30+
using Litipk.ColorSharp.ColorSpaces;
31+
using Litipk.ColorSharp.LightSpectrums;
32+
33+
34+
namespace Litipk.ColorSharp
35+
{
36+
namespace Illuminants
37+
{
38+
/**
39+
* <summary>
40+
* The CIE illuminant C is a (deprecated) daylight simulator intended to represent
41+
* average daylight with a correlated colour temperature of 6774 K.
42+
* </summary>
43+
*/
44+
public static class CIE_C
45+
{
46+
/**
47+
* <value>'C' expressed in its 'original form', a light spectrum.</value>
48+
*/
49+
public static readonly RegularLightSpectrum spectrum_Sample = new RegularLightSpectrum(
50+
380, 780, new [] {
51+
33.00,
52+
39.92,
53+
47.40,
54+
55.17,
55+
63.30,
56+
71.81,
57+
80.60,
58+
89.53,
59+
98.10,
60+
105.80,
61+
112.40,
62+
117.75,
63+
121.50,
64+
123.45,
65+
124.00,
66+
123.60,
67+
123.10,
68+
123.30,
69+
123.80,
70+
124.09,
71+
123.90,
72+
122.92,
73+
120.70,
74+
116.90,
75+
112.10,
76+
106.98,
77+
102.30,
78+
98.81,
79+
96.90,
80+
96.78,
81+
98.00,
82+
99.94,
83+
102.10,
84+
103.95,
85+
105.20,
86+
105.67,
87+
105.30,
88+
104.11,
89+
102.30,
90+
100.15,
91+
97.80,
92+
95.43,
93+
93.20,
94+
91.22,
95+
89.70,
96+
88.83,
97+
88.40,
98+
88.19,
99+
88.10,
100+
88.06,
101+
88.00,
102+
87.86,
103+
87.80,
104+
87.99,
105+
88.20,
106+
88.20,
107+
87.90,
108+
87.22,
109+
86.30,
110+
85.30,
111+
84.00,
112+
82.21,
113+
80.20,
114+
78.24,
115+
76.30,
116+
74.36,
117+
72.40,
118+
70.40,
119+
68.30,
120+
66.30,
121+
64.40,
122+
62.80,
123+
61.50,
124+
60.20,
125+
59.20,
126+
58.50,
127+
58.10,
128+
58.00,
129+
58.20,
130+
58.50,
131+
59.10
132+
}
133+
);
134+
}
135+
}
136+
}
137+
138+
139+

0 commit comments

Comments
 (0)