@flock/wirespec 0.9.24 → 0.9.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.js +12 -12
- package/arrow-arrow-core.js +124 -123
- package/arrow-arrow-core.js.map +1 -1
- package/clikt-clikt.js +1836 -1867
- package/clikt-clikt.js.map +1 -1
- package/colormath-root-colormath.js +809 -544
- package/colormath-root-colormath.js.map +1 -1
- package/kotlin-kotlin-stdlib.js +2149 -2007
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kotlin-openapi-bindings.js +5008 -5008
- package/kotlin-openapi-bindings.js.map +1 -1
- package/kotlin-rgxgen.js +1879 -1879
- package/{kotlinx-serialization-kotlinx-serialization-core-js-ir.js → kotlinx-serialization-kotlinx-serialization-core.js} +2202 -2130
- package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-json.js +5122 -0
- package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
- package/markdown.js +2123 -2017
- package/markdown.js.map +1 -1
- package/mordant-mordant.js +8910 -8389
- package/mordant-mordant.js.map +1 -1
- package/package.json +1 -1
- package/wirespec-src-compiler-core.js +2069 -2069
- package/wirespec-src-compiler-core.js.map +1 -1
- package/wirespec-src-compiler-lib.js +492 -819
- package/wirespec-src-compiler-lib.js.map +1 -1
- package/wirespec-src-converter-openapi.js +603 -603
- package/wirespec-src-converter-openapi.js.map +1 -1
- package/wirespec-src-plugin-arguments.js +94 -94
- package/wirespec-src-plugin-cli.js +164 -164
- package/wirespec-src-plugin-npm.d.ts +32 -71
- package/wirespec-src-plugin-npm.js +126 -50
- package/wirespec-src-plugin-npm.js.map +1 -1
- package/wirespec-src-tools-generator.js +36 -36
- package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +0 -1
- package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +0 -4583
- package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +0 -1
|
@@ -14,77 +14,81 @@
|
|
|
14
14
|
//region block: imports
|
|
15
15
|
var imul = Math.imul;
|
|
16
16
|
var log2 = Math.log2;
|
|
17
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
17
|
+
var protoOf = kotlin_kotlin.$_$.ua;
|
|
18
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.x9;
|
|
19
|
+
var toString = kotlin_kotlin.$_$.ya;
|
|
20
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.h1;
|
|
18
21
|
var initMetadataForClass = kotlin_kotlin.$_$.u9;
|
|
19
22
|
var getStringHashCode = kotlin_kotlin.$_$.s9;
|
|
20
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
23
|
+
var THROW_CCE = kotlin_kotlin.$_$.ff;
|
|
21
24
|
var initMetadataForObject = kotlin_kotlin.$_$.z9;
|
|
25
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l;
|
|
22
26
|
var charSequenceLength = kotlin_kotlin.$_$.j9;
|
|
23
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.k;
|
|
24
27
|
var charSequenceGet = kotlin_kotlin.$_$.i9;
|
|
25
|
-
var
|
|
26
|
-
var Unit_instance = kotlin_kotlin.$_$.
|
|
27
|
-
var
|
|
28
|
-
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.w1;
|
|
29
|
-
var plus = kotlin_kotlin.$_$.q7;
|
|
30
|
-
var asList = kotlin_kotlin.$_$.b5;
|
|
31
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.h5;
|
|
28
|
+
var toString_0 = kotlin_kotlin.$_$.z1;
|
|
29
|
+
var Unit_instance = kotlin_kotlin.$_$.g4;
|
|
30
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.v1;
|
|
32
31
|
var arrayConcat = kotlin_kotlin.$_$.a;
|
|
33
32
|
var listOf = kotlin_kotlin.$_$.f7;
|
|
34
|
-
var withSign = kotlin_kotlin.$_$.
|
|
35
|
-
var trimMargin = kotlin_kotlin.$_$.
|
|
33
|
+
var withSign = kotlin_kotlin.$_$.ab;
|
|
34
|
+
var trimMargin = kotlin_kotlin.$_$.je;
|
|
36
35
|
var hashCode = kotlin_kotlin.$_$.t9;
|
|
37
36
|
var equals = kotlin_kotlin.$_$.n9;
|
|
38
37
|
var VOID = kotlin_kotlin.$_$.g;
|
|
39
|
-
var toString_0 = kotlin_kotlin.$_$.xa;
|
|
40
38
|
var initMetadataForCompanion = kotlin_kotlin.$_$.v9;
|
|
41
|
-
var coerceAtLeast = kotlin_kotlin.$_$.
|
|
39
|
+
var coerceAtLeast = kotlin_kotlin.$_$.eb;
|
|
42
40
|
var getNumberHashCode = kotlin_kotlin.$_$.q9;
|
|
43
41
|
var numberToDouble = kotlin_kotlin.$_$.qa;
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var coerceIn = kotlin_kotlin.$_$.
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var toInt = kotlin_kotlin.$_$.ud;
|
|
42
|
+
var roundToInt = kotlin_kotlin.$_$.za;
|
|
43
|
+
var DoubleCompanionObject_instance = kotlin_kotlin.$_$.q3;
|
|
44
|
+
var coerceIn = kotlin_kotlin.$_$.ib;
|
|
45
|
+
var Char = kotlin_kotlin.$_$.pe;
|
|
46
|
+
var toInt = kotlin_kotlin.$_$.ae;
|
|
50
47
|
var numberRangeToNumber = kotlin_kotlin.$_$.oa;
|
|
51
|
-
var slice = kotlin_kotlin.$_$.
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
48
|
+
var slice = kotlin_kotlin.$_$.jd;
|
|
49
|
+
var startsWith = kotlin_kotlin.$_$.md;
|
|
50
|
+
var isInterface = kotlin_kotlin.$_$.ia;
|
|
51
|
+
var contentEquals = kotlin_kotlin.$_$.k5;
|
|
52
|
+
var coerceAtLeast_0 = kotlin_kotlin.$_$.gb;
|
|
53
|
+
var objectCreate = kotlin_kotlin.$_$.ta;
|
|
56
54
|
//endregion
|
|
57
55
|
//region block: pre-declaration
|
|
56
|
+
function toXYZ() {
|
|
57
|
+
return this.f2i().g2i();
|
|
58
|
+
}
|
|
59
|
+
initMetadataForInterface(Color, 'Color');
|
|
58
60
|
initMetadataForClass(ColorComponentInfo, 'ColorComponentInfo');
|
|
59
61
|
initMetadataForClass(WhitePoint, 'WhitePoint');
|
|
60
62
|
initMetadataForObject(Illuminant, 'Illuminant');
|
|
61
63
|
initMetadataForClass(Matrix, 'Matrix');
|
|
62
64
|
initMetadataForClass(Vector, 'Vector');
|
|
63
65
|
initMetadataForCompanion(Companion);
|
|
64
|
-
initMetadataForClass(Ansi16, 'Ansi16');
|
|
66
|
+
initMetadataForClass(Ansi16, 'Ansi16', VOID, VOID, [Color]);
|
|
65
67
|
initMetadataForCompanion(Companion_0);
|
|
66
|
-
initMetadataForClass(Ansi256, 'Ansi256');
|
|
68
|
+
initMetadataForClass(Ansi256, 'Ansi256', VOID, VOID, [Color]);
|
|
67
69
|
initMetadataForCompanion(Companion_1);
|
|
68
|
-
initMetadataForClass(HSV, 'HSV');
|
|
70
|
+
initMetadataForClass(HSV, 'HSV', VOID, VOID, [Color]);
|
|
71
|
+
initMetadataForClass(ICtCp, 'ICtCp', VOID, VOID, [Color]);
|
|
72
|
+
initMetadataForObject(PqNonlinearity, 'PqNonlinearity');
|
|
69
73
|
initMetadataForClass(GammaTransferFunctions, 'GammaTransferFunctions');
|
|
70
74
|
initMetadataForObject(LinearTransferFunctions, 'LinearTransferFunctions');
|
|
71
75
|
function invoke$default(r, g, b, alpha, $super) {
|
|
72
76
|
alpha = alpha === VOID ? 1.0 : alpha;
|
|
73
|
-
return $super === VOID ? this.
|
|
77
|
+
return $super === VOID ? this.r2j(r, g, b, alpha) : $super.r2j.call(this, r, g, b, alpha);
|
|
74
78
|
}
|
|
75
79
|
function invoke(r, g, b, alpha) {
|
|
76
|
-
return this.
|
|
80
|
+
return this.r2j(numberToDouble(r), numberToDouble(g), numberToDouble(b), numberToDouble(alpha));
|
|
77
81
|
}
|
|
78
82
|
function invoke$default_0(r, g, b, alpha, $super) {
|
|
79
83
|
alpha = alpha === VOID ? 1.0 : alpha;
|
|
80
|
-
return $super === VOID ? this.
|
|
84
|
+
return $super === VOID ? this.w2k(r, g, b, alpha) : invoke(r, g, b, alpha);
|
|
81
85
|
}
|
|
82
86
|
function from255(r, g, b, alpha) {
|
|
83
|
-
return this.
|
|
87
|
+
return this.r2j(r / 255.0, g / 255.0, b / 255.0, alpha / 255.0);
|
|
84
88
|
}
|
|
85
89
|
function from255$default(r, g, b, alpha, $super) {
|
|
86
90
|
alpha = alpha === VOID ? 255 : alpha;
|
|
87
|
-
return $super === VOID ? this.
|
|
91
|
+
return $super === VOID ? this.x2k(r, g, b, alpha) : from255(r, g, b, alpha);
|
|
88
92
|
}
|
|
89
93
|
function invoke_0(hex) {
|
|
90
94
|
var tmp = parseHex(validateHex(hex), 0);
|
|
@@ -100,41 +104,52 @@
|
|
|
100
104
|
} else {
|
|
101
105
|
tmp_2 = 255;
|
|
102
106
|
}
|
|
103
|
-
return this.
|
|
107
|
+
return this.x2k(tmp, tmp_0, tmp_1, tmp_2);
|
|
104
108
|
}
|
|
105
109
|
initMetadataForInterface(RGBColorSpace, 'RGBColorSpace');
|
|
106
110
|
initMetadataForCompanion(Companion_2, VOID, [RGBColorSpace]);
|
|
107
|
-
initMetadataForClass(RGB, 'RGB');
|
|
111
|
+
initMetadataForClass(RGB, 'RGB', VOID, VOID, [Color]);
|
|
108
112
|
initMetadataForObject(RGBColorSpaces, 'RGBColorSpaces');
|
|
109
113
|
initMetadataForObject(SRGB, 'SRGB', VOID, VOID, [RGBColorSpace]);
|
|
114
|
+
initMetadataForClass(RGBColorSpaceImpl, 'RGBColorSpaceImpl', VOID, VOID, [RGBColorSpace]);
|
|
115
|
+
initMetadataForObject(SRGBTransferFunctions, 'SRGBTransferFunctions');
|
|
110
116
|
initMetadataForObject(ACESccTransferFunctions, 'ACESccTransferFunctions');
|
|
111
117
|
initMetadataForObject(ACEScctTransferFunctions, 'ACEScctTransferFunctions');
|
|
112
|
-
initMetadataForObject(
|
|
118
|
+
initMetadataForObject(BT2020TransferFunctions, 'BT2020TransferFunctions');
|
|
113
119
|
initMetadataForObject(BT709TransferFunctions, 'BT709TransferFunctions');
|
|
114
|
-
initMetadataForObject(SRGBTransferFunctions, 'SRGBTransferFunctions');
|
|
115
120
|
initMetadataForObject(ROMMTransferFunctions, 'ROMMTransferFunctions');
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
initMetadataForClass(XYZ, 'XYZ');
|
|
121
|
+
initMetadataForInterface(XYZColorSpace, 'XYZColorSpace');
|
|
122
|
+
initMetadataForCompanion(Companion_3, VOID, [XYZColorSpace]);
|
|
123
|
+
initMetadataForClass(XYZ, 'XYZ', VOID, VOID, [Color]);
|
|
120
124
|
initMetadataForObject(XYZColorSpaces, 'XYZColorSpaces');
|
|
121
|
-
initMetadataForClass(XYZColorSpaceImpl, 'XYZColorSpaceImpl');
|
|
125
|
+
initMetadataForClass(XYZColorSpaceImpl, 'XYZColorSpaceImpl', VOID, VOID, [XYZColorSpace]);
|
|
122
126
|
initMetadataForClass(xyY, 'xyY');
|
|
123
127
|
//endregion
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
function Color() {
|
|
129
|
+
}
|
|
130
|
+
function ColorComponentInfo(name, isPolar, min, max) {
|
|
131
|
+
this.m2i_1 = name;
|
|
132
|
+
this.n2i_1 = isPolar;
|
|
133
|
+
this.o2i_1 = min;
|
|
134
|
+
this.p2i_1 = max;
|
|
135
|
+
// Inline function 'kotlin.require' call
|
|
136
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
137
|
+
if (!(this.o2i_1 <= this.p2i_1)) {
|
|
138
|
+
// Inline function 'com.github.ajalt.colormath.ColorComponentInfo.<anonymous>' call
|
|
139
|
+
var message = 'min must be less than or equal to max';
|
|
140
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
141
|
+
}
|
|
127
142
|
}
|
|
128
143
|
function WhitePoint(name, chromaticity) {
|
|
129
|
-
this.
|
|
130
|
-
this.
|
|
144
|
+
this.q2i_1 = name;
|
|
145
|
+
this.r2i_1 = chromaticity;
|
|
131
146
|
}
|
|
132
147
|
protoOf(WhitePoint).toString = function () {
|
|
133
|
-
return this.
|
|
148
|
+
return this.q2i_1;
|
|
134
149
|
};
|
|
135
150
|
protoOf(WhitePoint).hashCode = function () {
|
|
136
|
-
var result = getStringHashCode(this.
|
|
137
|
-
result = imul(result, 31) + this.
|
|
151
|
+
var result = getStringHashCode(this.q2i_1);
|
|
152
|
+
result = imul(result, 31) + this.r2i_1.hashCode() | 0;
|
|
138
153
|
return result;
|
|
139
154
|
};
|
|
140
155
|
protoOf(WhitePoint).equals = function (other) {
|
|
@@ -143,22 +158,22 @@
|
|
|
143
158
|
if (!(other instanceof WhitePoint))
|
|
144
159
|
return false;
|
|
145
160
|
var tmp0_other_with_cast = other instanceof WhitePoint ? other : THROW_CCE();
|
|
146
|
-
if (!(this.
|
|
161
|
+
if (!(this.q2i_1 === tmp0_other_with_cast.q2i_1))
|
|
147
162
|
return false;
|
|
148
|
-
if (!this.
|
|
163
|
+
if (!this.r2i_1.equals(tmp0_other_with_cast.r2i_1))
|
|
149
164
|
return false;
|
|
150
165
|
return true;
|
|
151
166
|
};
|
|
152
167
|
function Illuminant() {
|
|
153
168
|
Illuminant_instance = this;
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
157
|
-
this.
|
|
158
|
-
this.
|
|
159
|
-
this.
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
169
|
+
this.s2i_1 = new WhitePoint('A', xyY_init_$Create$(0.44758, 0.40745));
|
|
170
|
+
this.t2i_1 = new WhitePoint('B', xyY_init_$Create$(0.34842, 0.35161));
|
|
171
|
+
this.u2i_1 = new WhitePoint('C', xyY_init_$Create$(0.31006, 0.31616));
|
|
172
|
+
this.v2i_1 = new WhitePoint('D50', xyY_init_$Create$(0.3457, 0.3585));
|
|
173
|
+
this.w2i_1 = new WhitePoint('D55', xyY_init_$Create$(0.33243, 0.34744));
|
|
174
|
+
this.x2i_1 = new WhitePoint('D65', xyY_init_$Create$(0.3127, 0.329));
|
|
175
|
+
this.y2i_1 = new WhitePoint('D75', xyY_init_$Create$(0.29903, 0.31488));
|
|
176
|
+
this.z2i_1 = new WhitePoint('E', xyY_init_$Create$(1.0 / 3.0, 1.0 / 3.0));
|
|
162
177
|
}
|
|
163
178
|
var Illuminant_instance;
|
|
164
179
|
function Illuminant_getInstance() {
|
|
@@ -166,52 +181,63 @@
|
|
|
166
181
|
new Illuminant();
|
|
167
182
|
return Illuminant_instance;
|
|
168
183
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
171
|
-
|
|
184
|
+
function get_alphaInfo() {
|
|
185
|
+
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
186
|
+
return alphaInfo;
|
|
187
|
+
}
|
|
188
|
+
var alphaInfo;
|
|
189
|
+
function zeroOneComponentInfo(name) {
|
|
190
|
+
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
191
|
+
// Inline function 'kotlin.collections.buildList' call
|
|
192
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
193
|
+
// Inline function 'kotlin.collections.buildListInternal' call
|
|
194
|
+
// Inline function 'kotlin.apply' call
|
|
195
|
+
var this_0 = ArrayList_init_$Create$();
|
|
196
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
197
|
+
// Inline function 'com.github.ajalt.colormath.internal.zeroOneComponentInfo.<anonymous>' call
|
|
172
198
|
// Inline function 'kotlin.text.mapTo' call
|
|
173
|
-
var destination = ArrayList_init_$Create$(charSequenceLength(name));
|
|
174
199
|
var inductionVariable = 0;
|
|
175
200
|
while (inductionVariable < charSequenceLength(name)) {
|
|
176
201
|
var item = charSequenceGet(name, inductionVariable);
|
|
177
202
|
inductionVariable = inductionVariable + 1 | 0;
|
|
178
|
-
// Inline function 'com.github.ajalt.colormath.internal.
|
|
179
|
-
var tmp$ret$0 =
|
|
180
|
-
|
|
203
|
+
// Inline function 'com.github.ajalt.colormath.internal.zeroOneComponentInfo.<anonymous>.<anonymous>' call
|
|
204
|
+
var tmp$ret$0 = new ColorComponentInfo(toString_0(item), false, 0.0, 1.0);
|
|
205
|
+
this_0.e(tmp$ret$0);
|
|
181
206
|
}
|
|
182
|
-
|
|
183
|
-
return
|
|
207
|
+
this_0.e(get_alphaInfo());
|
|
208
|
+
return this_0.o5();
|
|
184
209
|
}
|
|
185
|
-
function polarComponentInfo(name) {
|
|
186
|
-
|
|
210
|
+
function polarComponentInfo(name, l, r) {
|
|
211
|
+
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
212
|
+
// Inline function 'kotlin.collections.buildList' call
|
|
213
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
214
|
+
// Inline function 'kotlin.collections.buildListInternal' call
|
|
215
|
+
// Inline function 'kotlin.apply' call
|
|
216
|
+
var this_0 = ArrayList_init_$Create$();
|
|
217
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
218
|
+
// Inline function 'com.github.ajalt.colormath.internal.polarComponentInfo.<anonymous>' call
|
|
187
219
|
// Inline function 'kotlin.text.mapTo' call
|
|
188
|
-
var destination = ArrayList_init_$Create$(charSequenceLength(name));
|
|
189
220
|
var inductionVariable = 0;
|
|
190
221
|
while (inductionVariable < charSequenceLength(name)) {
|
|
191
222
|
var item = charSequenceGet(name, inductionVariable);
|
|
192
223
|
inductionVariable = inductionVariable + 1 | 0;
|
|
193
|
-
// Inline function 'com.github.ajalt.colormath.internal.polarComponentInfo.<anonymous>' call
|
|
194
|
-
var tmp$ret$0 = new ColorComponentInfo(
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
return plus(destination, new ColorComponentInfo('alpha', false));
|
|
198
|
-
}
|
|
199
|
-
function rectangularComponentInfo_0(names) {
|
|
200
|
-
// Inline function 'kotlin.collections.map' call
|
|
201
|
-
var this_0 = plus(asList(names), 'alpha');
|
|
202
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
203
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
204
|
-
var tmp0_iterator = this_0.g();
|
|
205
|
-
while (tmp0_iterator.h()) {
|
|
206
|
-
var item = tmp0_iterator.i();
|
|
207
|
-
// Inline function 'com.github.ajalt.colormath.internal.rectangularComponentInfo.<anonymous>' call
|
|
208
|
-
var tmp$ret$0 = new ColorComponentInfo(item, false);
|
|
209
|
-
destination.e(tmp$ret$0);
|
|
224
|
+
// Inline function 'com.github.ajalt.colormath.internal.polarComponentInfo.<anonymous>.<anonymous>' call
|
|
225
|
+
var tmp$ret$0 = new ColorComponentInfo(toString_0(item), item === _Char___init__impl__6a9atx(72), item === _Char___init__impl__6a9atx(72) ? 0.0 : l, item === _Char___init__impl__6a9atx(72) ? 360.0 : r);
|
|
226
|
+
this_0.e(tmp$ret$0);
|
|
210
227
|
}
|
|
211
|
-
|
|
228
|
+
this_0.e(get_alphaInfo());
|
|
229
|
+
return this_0.o5();
|
|
212
230
|
}
|
|
213
231
|
function componentInfoList(c) {
|
|
214
|
-
|
|
232
|
+
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
233
|
+
return listOf(arrayConcat([c, [get_alphaInfo()]]));
|
|
234
|
+
}
|
|
235
|
+
var properties_initialized_ColorSpaceUtils_kt_kskdoe;
|
|
236
|
+
function _init_properties_ColorSpaceUtils_kt__cnwylg() {
|
|
237
|
+
if (!properties_initialized_ColorSpaceUtils_kt_kskdoe) {
|
|
238
|
+
properties_initialized_ColorSpaceUtils_kt_kskdoe = true;
|
|
239
|
+
alphaInfo = new ColorComponentInfo('alpha', false, 0.0, 1.0);
|
|
240
|
+
}
|
|
215
241
|
}
|
|
216
242
|
function get_CAT02_XYZ_TO_LMS() {
|
|
217
243
|
_init_properties_Constants_kt__atb1ur();
|
|
@@ -282,22 +308,22 @@
|
|
|
282
308
|
function Matrix__equals_impl_g5p8p9($this, other) {
|
|
283
309
|
if (!(other instanceof Matrix))
|
|
284
310
|
return false;
|
|
285
|
-
var tmp0_other_with_cast = other instanceof Matrix ? other.
|
|
311
|
+
var tmp0_other_with_cast = other instanceof Matrix ? other.a2j_1 : THROW_CCE();
|
|
286
312
|
if (!equals($this, tmp0_other_with_cast))
|
|
287
313
|
return false;
|
|
288
314
|
return true;
|
|
289
315
|
}
|
|
290
316
|
function Matrix(rowMajor) {
|
|
291
|
-
this.
|
|
317
|
+
this.a2j_1 = rowMajor;
|
|
292
318
|
}
|
|
293
319
|
protoOf(Matrix).toString = function () {
|
|
294
|
-
return Matrix__toString_impl_l0abk0(this.
|
|
320
|
+
return Matrix__toString_impl_l0abk0(this.a2j_1);
|
|
295
321
|
};
|
|
296
322
|
protoOf(Matrix).hashCode = function () {
|
|
297
|
-
return Matrix__hashCode_impl_s9ntm9(this.
|
|
323
|
+
return Matrix__hashCode_impl_s9ntm9(this.a2j_1);
|
|
298
324
|
};
|
|
299
325
|
protoOf(Matrix).equals = function (other) {
|
|
300
|
-
return Matrix__equals_impl_g5p8p9(this.
|
|
326
|
+
return Matrix__equals_impl_g5p8p9(this.a2j_1, other);
|
|
301
327
|
};
|
|
302
328
|
function inverse(_this__u8e3s4, inPlace) {
|
|
303
329
|
inPlace = inPlace === VOID ? false : inPlace;
|
|
@@ -326,6 +352,20 @@
|
|
|
326
352
|
Matrix__set_impl_s2l54c_0(out, 2, 2, (a * e - d * b) / det);
|
|
327
353
|
return out;
|
|
328
354
|
}
|
|
355
|
+
function scalarDiv(_this__u8e3s4, x, inPlace) {
|
|
356
|
+
inPlace = inPlace === VOID ? false : inPlace;
|
|
357
|
+
var out = _Matrix___get_rowMajor__impl__vmgxkq(inPlace ? _this__u8e3s4 : Matrix__copy_impl_kmkvzd(_this__u8e3s4));
|
|
358
|
+
var inductionVariable = 0;
|
|
359
|
+
var last = out.length - 1 | 0;
|
|
360
|
+
if (inductionVariable <= last)
|
|
361
|
+
do {
|
|
362
|
+
var i = inductionVariable;
|
|
363
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
364
|
+
out[i] = out[i] / x;
|
|
365
|
+
}
|
|
366
|
+
while (inductionVariable <= last);
|
|
367
|
+
return _Matrix___init__impl__q3kp4w(out);
|
|
368
|
+
}
|
|
329
369
|
function dot(_this__u8e3s4, other) {
|
|
330
370
|
return _Matrix___init__impl__q3kp4w_0(dot$f(_this__u8e3s4, other, 0, 0), dot$f(_this__u8e3s4, other, 1, 0), dot$f(_this__u8e3s4, other, 2, 0), dot$f(_this__u8e3s4, other, 0, 1), dot$f(_this__u8e3s4, other, 1, 1), dot$f(_this__u8e3s4, other, 2, 1), dot$f(_this__u8e3s4, other, 0, 2), dot$f(_this__u8e3s4, other, 1, 2), dot$f(_this__u8e3s4, other, 2, 2));
|
|
331
371
|
}
|
|
@@ -353,7 +393,7 @@
|
|
|
353
393
|
return _Vector___get_values__impl__3gdbp5($this)[2];
|
|
354
394
|
}
|
|
355
395
|
function Vector__toString_impl_hn2ybi($this) {
|
|
356
|
-
return 'Vector(values=' +
|
|
396
|
+
return 'Vector(values=' + toString($this) + ')';
|
|
357
397
|
}
|
|
358
398
|
function Vector__hashCode_impl_442yhd($this) {
|
|
359
399
|
return hashCode($this);
|
|
@@ -361,22 +401,22 @@
|
|
|
361
401
|
function Vector__equals_impl_hy6igl($this, other) {
|
|
362
402
|
if (!(other instanceof Vector))
|
|
363
403
|
return false;
|
|
364
|
-
var tmp0_other_with_cast = other instanceof Vector ? other.
|
|
404
|
+
var tmp0_other_with_cast = other instanceof Vector ? other.b2j_1 : THROW_CCE();
|
|
365
405
|
if (!equals($this, tmp0_other_with_cast))
|
|
366
406
|
return false;
|
|
367
407
|
return true;
|
|
368
408
|
}
|
|
369
409
|
function Vector(values) {
|
|
370
|
-
this.
|
|
410
|
+
this.b2j_1 = values;
|
|
371
411
|
}
|
|
372
412
|
protoOf(Vector).toString = function () {
|
|
373
|
-
return Vector__toString_impl_hn2ybi(this.
|
|
413
|
+
return Vector__toString_impl_hn2ybi(this.b2j_1);
|
|
374
414
|
};
|
|
375
415
|
protoOf(Vector).hashCode = function () {
|
|
376
|
-
return Vector__hashCode_impl_442yhd(this.
|
|
416
|
+
return Vector__hashCode_impl_442yhd(this.b2j_1);
|
|
377
417
|
};
|
|
378
418
|
protoOf(Vector).equals = function (other) {
|
|
379
|
-
return Vector__equals_impl_hy6igl(this.
|
|
419
|
+
return Vector__equals_impl_hy6igl(this.b2j_1, other);
|
|
380
420
|
};
|
|
381
421
|
function dot_0(_this__u8e3s4, v0, v1, v2) {
|
|
382
422
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
@@ -387,8 +427,11 @@
|
|
|
387
427
|
}
|
|
388
428
|
function Companion() {
|
|
389
429
|
Companion_instance = this;
|
|
390
|
-
this.
|
|
430
|
+
this.c2j_1 = componentInfoList([new ColorComponentInfo('code', false, 30.0, 107.0)]);
|
|
391
431
|
}
|
|
432
|
+
protoOf(Companion).d2j = function () {
|
|
433
|
+
return this.c2j_1;
|
|
434
|
+
};
|
|
392
435
|
var Companion_instance;
|
|
393
436
|
function Companion_getInstance() {
|
|
394
437
|
if (Companion_instance == null)
|
|
@@ -397,35 +440,38 @@
|
|
|
397
440
|
}
|
|
398
441
|
function Ansi16(code) {
|
|
399
442
|
Companion_getInstance();
|
|
400
|
-
this.
|
|
443
|
+
this.e2j_1 = code;
|
|
401
444
|
}
|
|
402
|
-
protoOf(Ansi16).
|
|
403
|
-
|
|
445
|
+
protoOf(Ansi16).e2i = function () {
|
|
446
|
+
return Companion_getInstance();
|
|
447
|
+
};
|
|
448
|
+
protoOf(Ansi16).f2i = function () {
|
|
449
|
+
switch (this.e2j_1) {
|
|
404
450
|
case 30:
|
|
405
451
|
case 40:
|
|
406
|
-
return Companion_getInstance_2().
|
|
452
|
+
return Companion_getInstance_2().f2j(0.0, 0.0, 0.0);
|
|
407
453
|
case 90:
|
|
408
454
|
case 100:
|
|
409
|
-
return Companion_getInstance_2().
|
|
455
|
+
return Companion_getInstance_2().g2j(128, 128, 128);
|
|
410
456
|
case 37:
|
|
411
457
|
case 47:
|
|
412
|
-
return Companion_getInstance_2().
|
|
458
|
+
return Companion_getInstance_2().g2j(192, 192, 192);
|
|
413
459
|
case 97:
|
|
414
460
|
case 107:
|
|
415
|
-
return Companion_getInstance_2().
|
|
461
|
+
return Companion_getInstance_2().f2j(1.0, 1.0, 1.0);
|
|
416
462
|
}
|
|
417
|
-
var color = this.
|
|
418
|
-
var mul = this.
|
|
463
|
+
var color = this.e2j_1 % 10 | 0;
|
|
464
|
+
var mul = this.e2j_1 > 50 ? 1.0 : 0.5;
|
|
419
465
|
var r = (color % 2 | 0) * mul;
|
|
420
466
|
var g = ((color / 2 | 0) % 2 | 0) * mul;
|
|
421
467
|
var b = ((color / 4 | 0) % 2 | 0) * mul;
|
|
422
|
-
return Companion_getInstance_2().
|
|
468
|
+
return Companion_getInstance_2().f2j(r, g, b);
|
|
423
469
|
};
|
|
424
470
|
protoOf(Ansi16).toString = function () {
|
|
425
|
-
return 'Ansi16(code=' + this.
|
|
471
|
+
return 'Ansi16(code=' + this.e2j_1 + ')';
|
|
426
472
|
};
|
|
427
473
|
protoOf(Ansi16).hashCode = function () {
|
|
428
|
-
return this.
|
|
474
|
+
return this.e2j_1;
|
|
429
475
|
};
|
|
430
476
|
protoOf(Ansi16).equals = function (other) {
|
|
431
477
|
if (this === other)
|
|
@@ -433,14 +479,17 @@
|
|
|
433
479
|
if (!(other instanceof Ansi16))
|
|
434
480
|
return false;
|
|
435
481
|
var tmp0_other_with_cast = other instanceof Ansi16 ? other : THROW_CCE();
|
|
436
|
-
if (!(this.
|
|
482
|
+
if (!(this.e2j_1 === tmp0_other_with_cast.e2j_1))
|
|
437
483
|
return false;
|
|
438
484
|
return true;
|
|
439
485
|
};
|
|
440
486
|
function Companion_0() {
|
|
441
487
|
Companion_instance_0 = this;
|
|
442
|
-
this.
|
|
488
|
+
this.h2j_1 = componentInfoList([new ColorComponentInfo('code', false, 0.0, 255.0)]);
|
|
443
489
|
}
|
|
490
|
+
protoOf(Companion_0).d2j = function () {
|
|
491
|
+
return this.h2j_1;
|
|
492
|
+
};
|
|
444
493
|
var Companion_instance_0;
|
|
445
494
|
function Companion_getInstance_0() {
|
|
446
495
|
if (Companion_instance_0 == null)
|
|
@@ -449,16 +498,19 @@
|
|
|
449
498
|
}
|
|
450
499
|
function Ansi256(code) {
|
|
451
500
|
Companion_getInstance_0();
|
|
452
|
-
this.
|
|
453
|
-
}
|
|
454
|
-
protoOf(Ansi256).
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
return
|
|
501
|
+
this.i2j_1 = code;
|
|
502
|
+
}
|
|
503
|
+
protoOf(Ansi256).e2i = function () {
|
|
504
|
+
return Companion_getInstance_0();
|
|
505
|
+
};
|
|
506
|
+
protoOf(Ansi256).f2i = function () {
|
|
507
|
+
if (this.i2j_1 < 16)
|
|
508
|
+
return this.j2j().f2i();
|
|
509
|
+
if (this.i2j_1 >= 232) {
|
|
510
|
+
var c = imul(this.i2j_1 - 232 | 0, 10) + 8 | 0;
|
|
511
|
+
return Companion_getInstance_2().g2j(c, c, c);
|
|
460
512
|
}
|
|
461
|
-
var c_0 = this.
|
|
513
|
+
var c_0 = this.i2j_1 - 16 | 0;
|
|
462
514
|
var rem = c_0 % 36 | 0;
|
|
463
515
|
// Inline function 'kotlin.math.floor' call
|
|
464
516
|
var x = c_0 / 36.0;
|
|
@@ -467,16 +519,16 @@
|
|
|
467
519
|
var x_0 = rem / 6.0;
|
|
468
520
|
var g = Math.floor(x_0) / 5.0;
|
|
469
521
|
var b = (rem % 6 | 0) / 5.0;
|
|
470
|
-
return Companion_getInstance_2().
|
|
522
|
+
return Companion_getInstance_2().k2j(r, g, b);
|
|
471
523
|
};
|
|
472
|
-
protoOf(Ansi256).
|
|
473
|
-
return this.
|
|
524
|
+
protoOf(Ansi256).j2j = function () {
|
|
525
|
+
return this.i2j_1 < 8 ? new Ansi16(this.i2j_1 + 30 | 0) : this.i2j_1 < 16 ? new Ansi16((this.i2j_1 - 8 | 0) + 90 | 0) : this.f2i().j2j();
|
|
474
526
|
};
|
|
475
527
|
protoOf(Ansi256).toString = function () {
|
|
476
|
-
return 'Ansi256(code=' + this.
|
|
528
|
+
return 'Ansi256(code=' + this.i2j_1 + ')';
|
|
477
529
|
};
|
|
478
530
|
protoOf(Ansi256).hashCode = function () {
|
|
479
|
-
return this.
|
|
531
|
+
return this.i2j_1;
|
|
480
532
|
};
|
|
481
533
|
protoOf(Ansi256).equals = function (other) {
|
|
482
534
|
if (this === other)
|
|
@@ -484,14 +536,17 @@
|
|
|
484
536
|
if (!(other instanceof Ansi256))
|
|
485
537
|
return false;
|
|
486
538
|
var tmp0_other_with_cast = other instanceof Ansi256 ? other : THROW_CCE();
|
|
487
|
-
if (!(this.
|
|
539
|
+
if (!(this.i2j_1 === tmp0_other_with_cast.i2j_1))
|
|
488
540
|
return false;
|
|
489
541
|
return true;
|
|
490
542
|
};
|
|
491
543
|
function Companion_1() {
|
|
492
544
|
Companion_instance_1 = this;
|
|
493
|
-
this.
|
|
545
|
+
this.l2j_1 = polarComponentInfo('HSV', 0.0, 1.0);
|
|
494
546
|
}
|
|
547
|
+
protoOf(Companion_1).d2j = function () {
|
|
548
|
+
return this.l2j_1;
|
|
549
|
+
};
|
|
495
550
|
var Companion_instance_1;
|
|
496
551
|
function Companion_getInstance_1() {
|
|
497
552
|
if (Companion_instance_1 == null)
|
|
@@ -509,27 +564,30 @@
|
|
|
509
564
|
function HSV(h, s, v, alpha) {
|
|
510
565
|
Companion_getInstance_1();
|
|
511
566
|
alpha = alpha === VOID ? 1.0 : alpha;
|
|
512
|
-
this.
|
|
513
|
-
this.
|
|
514
|
-
this.
|
|
515
|
-
this.
|
|
516
|
-
}
|
|
517
|
-
protoOf(HSV).
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
567
|
+
this.m2j_1 = h;
|
|
568
|
+
this.n2j_1 = s;
|
|
569
|
+
this.o2j_1 = v;
|
|
570
|
+
this.p2j_1 = alpha;
|
|
571
|
+
}
|
|
572
|
+
protoOf(HSV).e2i = function () {
|
|
573
|
+
return Companion_getInstance_1();
|
|
574
|
+
};
|
|
575
|
+
protoOf(HSV).f2i = function () {
|
|
576
|
+
if (this.n2j_1 < 1.0E-7)
|
|
577
|
+
return Companion_getInstance_2().r2j(this.o2j_1, this.o2j_1, this.o2j_1, this.p2j_1);
|
|
578
|
+
var v = this.o2j_1;
|
|
579
|
+
var h = normalizeDeg_0(this.m2j_1) / 60.0;
|
|
580
|
+
var s = this.n2j_1;
|
|
581
|
+
return SRGB_getInstance().r2j(toSRGB$f(h, v, s, 5), toSRGB$f(h, v, s, 3), toSRGB$f(h, v, s, 1), this.p2j_1);
|
|
524
582
|
};
|
|
525
583
|
protoOf(HSV).toString = function () {
|
|
526
|
-
return 'HSV(h=' + this.
|
|
584
|
+
return 'HSV(h=' + this.m2j_1 + ', s=' + this.n2j_1 + ', v=' + this.o2j_1 + ', alpha=' + this.p2j_1 + ')';
|
|
527
585
|
};
|
|
528
586
|
protoOf(HSV).hashCode = function () {
|
|
529
|
-
var result = getNumberHashCode(this.
|
|
530
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
531
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
532
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
587
|
+
var result = getNumberHashCode(this.m2j_1);
|
|
588
|
+
result = imul(result, 31) + getNumberHashCode(this.n2j_1) | 0;
|
|
589
|
+
result = imul(result, 31) + getNumberHashCode(this.o2j_1) | 0;
|
|
590
|
+
result = imul(result, 31) + getNumberHashCode(this.p2j_1) | 0;
|
|
533
591
|
return result;
|
|
534
592
|
};
|
|
535
593
|
protoOf(HSV).equals = function (other) {
|
|
@@ -538,30 +596,132 @@
|
|
|
538
596
|
if (!(other instanceof HSV))
|
|
539
597
|
return false;
|
|
540
598
|
var tmp0_other_with_cast = other instanceof HSV ? other : THROW_CCE();
|
|
541
|
-
if (!equals(this.
|
|
599
|
+
if (!equals(this.m2j_1, tmp0_other_with_cast.m2j_1))
|
|
542
600
|
return false;
|
|
543
|
-
if (!equals(this.
|
|
601
|
+
if (!equals(this.n2j_1, tmp0_other_with_cast.n2j_1))
|
|
544
602
|
return false;
|
|
545
|
-
if (!equals(this.
|
|
603
|
+
if (!equals(this.o2j_1, tmp0_other_with_cast.o2j_1))
|
|
546
604
|
return false;
|
|
547
|
-
if (!equals(this.
|
|
605
|
+
if (!equals(this.p2j_1, tmp0_other_with_cast.p2j_1))
|
|
548
606
|
return false;
|
|
549
607
|
return true;
|
|
550
608
|
};
|
|
609
|
+
function get_ICTCP_RGB_TO_LMS() {
|
|
610
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
611
|
+
return ICTCP_RGB_TO_LMS;
|
|
612
|
+
}
|
|
613
|
+
var ICTCP_RGB_TO_LMS;
|
|
614
|
+
function get_ICTCP_LMS_TO_ICTCP() {
|
|
615
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
616
|
+
return ICTCP_LMS_TO_ICTCP;
|
|
617
|
+
}
|
|
618
|
+
var ICTCP_LMS_TO_ICTCP;
|
|
619
|
+
function get_ICTCP_LMS_to_RGB() {
|
|
620
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
621
|
+
return ICTCP_LMS_to_RGB;
|
|
622
|
+
}
|
|
623
|
+
var ICTCP_LMS_to_RGB;
|
|
624
|
+
function get_ICTCP_ICTCP_to_LMS() {
|
|
625
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
626
|
+
return ICTCP_ICTCP_to_LMS;
|
|
627
|
+
}
|
|
628
|
+
var ICTCP_ICTCP_to_LMS;
|
|
629
|
+
function get_ICTCP_CROSSTALK() {
|
|
630
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
631
|
+
return ICTCP_CROSSTALK;
|
|
632
|
+
}
|
|
633
|
+
var ICTCP_CROSSTALK;
|
|
634
|
+
function get_HPE_XYZ_TO_LMS() {
|
|
635
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
636
|
+
return HPE_XYZ_TO_LMS;
|
|
637
|
+
}
|
|
638
|
+
var HPE_XYZ_TO_LMS;
|
|
639
|
+
function get_ICTCP_XYZ_TO_LMS() {
|
|
640
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
641
|
+
return ICTCP_XYZ_TO_LMS;
|
|
642
|
+
}
|
|
643
|
+
var ICTCP_XYZ_TO_LMS;
|
|
644
|
+
var ICTCP_LMS_TO_XYZ;
|
|
645
|
+
function ICtCp() {
|
|
646
|
+
}
|
|
647
|
+
protoOf(ICtCp).x2j = function () {
|
|
648
|
+
var fo = RGBColorSpaces_getInstance().f2k_1.k2k();
|
|
649
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
650
|
+
var this_0 = get_ICTCP_ICTCP_to_LMS();
|
|
651
|
+
var v0 = this.t2j_1;
|
|
652
|
+
var v1 = this.u2j_1;
|
|
653
|
+
var v2 = this.v2j_1;
|
|
654
|
+
// Inline function 'com.github.ajalt.colormath.model.ICtCp.toBT2020.<anonymous>' call
|
|
655
|
+
var l = Matrix__get_impl_xogbpk(this_0, 0, 0) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 0) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 0) * v2;
|
|
656
|
+
var m = Matrix__get_impl_xogbpk(this_0, 0, 1) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 1) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 1) * v2;
|
|
657
|
+
var s = Matrix__get_impl_xogbpk(this_0, 0, 2) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 2) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 2) * v2;
|
|
658
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
659
|
+
var this_1 = get_ICTCP_LMS_to_RGB();
|
|
660
|
+
var v0_0 = PqNonlinearity_instance.t2k(l);
|
|
661
|
+
var v1_0 = PqNonlinearity_instance.t2k(m);
|
|
662
|
+
var v2_0 = PqNonlinearity_instance.t2k(s);
|
|
663
|
+
// Inline function 'com.github.ajalt.colormath.model.ICtCp.toBT2020.<anonymous>.<anonymous>' call
|
|
664
|
+
var r = Matrix__get_impl_xogbpk(this_1, 0, 0) * v0_0 + Matrix__get_impl_xogbpk(this_1, 1, 0) * v1_0 + Matrix__get_impl_xogbpk(this_1, 2, 0) * v2_0;
|
|
665
|
+
var g = Matrix__get_impl_xogbpk(this_1, 0, 1) * v0_0 + Matrix__get_impl_xogbpk(this_1, 1, 1) * v1_0 + Matrix__get_impl_xogbpk(this_1, 2, 1) * v2_0;
|
|
666
|
+
var b = Matrix__get_impl_xogbpk(this_1, 0, 2) * v0_0 + Matrix__get_impl_xogbpk(this_1, 1, 2) * v1_0 + Matrix__get_impl_xogbpk(this_1, 2, 2) * v2_0;
|
|
667
|
+
return RGBColorSpaces_getInstance().f2k_1.r2j(fo.u2k(r), fo.u2k(g), fo.u2k(b), this.w2j_1);
|
|
668
|
+
};
|
|
669
|
+
function PqNonlinearity() {
|
|
670
|
+
this.l2k_1 = 0.1593017578125;
|
|
671
|
+
this.m2k_1 = 78.84375;
|
|
672
|
+
this.n2k_1 = 0.8359375;
|
|
673
|
+
this.o2k_1 = 18.8515625;
|
|
674
|
+
this.p2k_1 = 18.6875;
|
|
675
|
+
this.q2k_1 = 10000.0;
|
|
676
|
+
this.r2k_1 = 6.277394636015326;
|
|
677
|
+
this.s2k_1 = 0.012683313515655966;
|
|
678
|
+
}
|
|
679
|
+
protoOf(PqNonlinearity).t2k = function (x) {
|
|
680
|
+
var vp = spow(x, 0.012683313515655966);
|
|
681
|
+
var n = coerceAtLeast(vp - 0.8359375, 0.0);
|
|
682
|
+
var tmp = n / (18.8515625 - 18.6875 * vp);
|
|
683
|
+
var l = spow_0(tmp, 6.277394636015326);
|
|
684
|
+
return 10000.0 * l;
|
|
685
|
+
};
|
|
686
|
+
protoOf(PqNonlinearity).u2k = function (x) {
|
|
687
|
+
var tmp = x / 10000.0;
|
|
688
|
+
var yp = spow_0(tmp, 0.1593017578125);
|
|
689
|
+
var tmp_0 = 0.8359375 + 18.8515625 * yp;
|
|
690
|
+
var tmp_1 = tmp_0 / (1.0 + 18.6875 * yp);
|
|
691
|
+
return spow_0(tmp_1, 78.84375);
|
|
692
|
+
};
|
|
693
|
+
var PqNonlinearity_instance;
|
|
694
|
+
function PqNonlinearity_getInstance() {
|
|
695
|
+
return PqNonlinearity_instance;
|
|
696
|
+
}
|
|
697
|
+
var properties_initialized_ICtCp_kt_w6y8uv;
|
|
698
|
+
function _init_properties_ICtCp_kt__7vx7or() {
|
|
699
|
+
if (!properties_initialized_ICtCp_kt_w6y8uv) {
|
|
700
|
+
properties_initialized_ICtCp_kt_w6y8uv = true;
|
|
701
|
+
ICTCP_RGB_TO_LMS = scalarDiv(_Matrix___init__impl__q3kp4w_0(1688.0, 2146.0, 262.0, 683.0, 2951.0, 462.0, 99.0, 309.0, 3688.0), 4096.0, true);
|
|
702
|
+
ICTCP_LMS_TO_ICTCP = scalarDiv(_Matrix___init__impl__q3kp4w_0(2048.0, 2048.0, 0.0, 6610.0, -13613.0, 7003.0, 17933.0, -17390.0, -543.0), 4096.0, true);
|
|
703
|
+
ICTCP_LMS_to_RGB = inverse(get_ICTCP_RGB_TO_LMS());
|
|
704
|
+
ICTCP_ICTCP_to_LMS = inverse(get_ICTCP_LMS_TO_ICTCP());
|
|
705
|
+
ICTCP_CROSSTALK = _Matrix___init__impl__q3kp4w_0(0.92, 0.04, 0.04, 0.04, 0.92, 0.04, 0.04, 0.04, 0.92);
|
|
706
|
+
HPE_XYZ_TO_LMS = _Matrix___init__impl__q3kp4w_0(0.4002, 0.7076, -0.0808, -0.2263, 1.1653, 0.0457, 0.0, 0.0, 0.9182);
|
|
707
|
+
ICTCP_XYZ_TO_LMS = dot(get_ICTCP_CROSSTALK(), get_HPE_XYZ_TO_LMS());
|
|
708
|
+
ICTCP_LMS_TO_XYZ = inverse(get_ICTCP_XYZ_TO_LMS());
|
|
709
|
+
}
|
|
710
|
+
}
|
|
551
711
|
function GammaTransferFunctions(gamma) {
|
|
552
|
-
this.
|
|
712
|
+
this.v2k_1 = gamma;
|
|
553
713
|
}
|
|
554
|
-
protoOf(GammaTransferFunctions).
|
|
555
|
-
return spow(x, this.
|
|
714
|
+
protoOf(GammaTransferFunctions).t2k = function (x) {
|
|
715
|
+
return spow(x, this.v2k_1);
|
|
556
716
|
};
|
|
557
|
-
protoOf(GammaTransferFunctions).
|
|
558
|
-
return spow(x, 1.0 / this.
|
|
717
|
+
protoOf(GammaTransferFunctions).u2k = function (x) {
|
|
718
|
+
return spow(x, 1.0 / this.v2k_1);
|
|
559
719
|
};
|
|
560
720
|
protoOf(GammaTransferFunctions).toString = function () {
|
|
561
|
-
return 'GammaTransferFunctions(gamma=' + this.
|
|
721
|
+
return 'GammaTransferFunctions(gamma=' + this.v2k_1 + ')';
|
|
562
722
|
};
|
|
563
723
|
protoOf(GammaTransferFunctions).hashCode = function () {
|
|
564
|
-
return getNumberHashCode(this.
|
|
724
|
+
return getNumberHashCode(this.v2k_1);
|
|
565
725
|
};
|
|
566
726
|
protoOf(GammaTransferFunctions).equals = function (other) {
|
|
567
727
|
if (this === other)
|
|
@@ -569,16 +729,16 @@
|
|
|
569
729
|
if (!(other instanceof GammaTransferFunctions))
|
|
570
730
|
return false;
|
|
571
731
|
var tmp0_other_with_cast = other instanceof GammaTransferFunctions ? other : THROW_CCE();
|
|
572
|
-
if (!equals(this.
|
|
732
|
+
if (!equals(this.v2k_1, tmp0_other_with_cast.v2k_1))
|
|
573
733
|
return false;
|
|
574
734
|
return true;
|
|
575
735
|
};
|
|
576
736
|
function LinearTransferFunctions() {
|
|
577
737
|
}
|
|
578
|
-
protoOf(LinearTransferFunctions).
|
|
738
|
+
protoOf(LinearTransferFunctions).t2k = function (x) {
|
|
579
739
|
return x;
|
|
580
740
|
};
|
|
581
|
-
protoOf(LinearTransferFunctions).
|
|
741
|
+
protoOf(LinearTransferFunctions).u2k = function (x) {
|
|
582
742
|
return x;
|
|
583
743
|
};
|
|
584
744
|
var LinearTransferFunctions_instance;
|
|
@@ -589,31 +749,43 @@
|
|
|
589
749
|
}
|
|
590
750
|
function Companion_2() {
|
|
591
751
|
Companion_instance_2 = this;
|
|
592
|
-
this.
|
|
752
|
+
this.q2j_1 = RGBColorSpaces_getInstance().y2j_1;
|
|
593
753
|
}
|
|
594
|
-
protoOf(Companion_2).
|
|
595
|
-
return this.
|
|
754
|
+
protoOf(Companion_2).d2j = function () {
|
|
755
|
+
return this.q2j_1.d2j();
|
|
756
|
+
};
|
|
757
|
+
protoOf(Companion_2).z2k = function () {
|
|
758
|
+
return this.q2j_1.z2k();
|
|
596
759
|
};
|
|
597
|
-
protoOf(Companion_2).
|
|
598
|
-
return this.
|
|
760
|
+
protoOf(Companion_2).y2k = function () {
|
|
761
|
+
return this.q2j_1.y2k();
|
|
599
762
|
};
|
|
600
|
-
protoOf(Companion_2).
|
|
601
|
-
return this.
|
|
763
|
+
protoOf(Companion_2).r2 = function () {
|
|
764
|
+
return this.q2j_1.r2();
|
|
602
765
|
};
|
|
603
|
-
protoOf(Companion_2).
|
|
604
|
-
return this.
|
|
766
|
+
protoOf(Companion_2).k2k = function () {
|
|
767
|
+
return this.q2j_1.k2k();
|
|
605
768
|
};
|
|
606
|
-
protoOf(Companion_2).
|
|
607
|
-
return this.
|
|
769
|
+
protoOf(Companion_2).a2l = function () {
|
|
770
|
+
return this.q2j_1.a2l();
|
|
608
771
|
};
|
|
609
|
-
protoOf(Companion_2).
|
|
610
|
-
return this.
|
|
772
|
+
protoOf(Companion_2).x2k = function (r, g, b, alpha) {
|
|
773
|
+
return this.q2j_1.x2k(r, g, b, alpha);
|
|
611
774
|
};
|
|
612
|
-
protoOf(Companion_2).
|
|
613
|
-
return this.
|
|
775
|
+
protoOf(Companion_2).r2j = function (r, g, b, alpha) {
|
|
776
|
+
return this.q2j_1.r2j(r, g, b, alpha);
|
|
614
777
|
};
|
|
615
|
-
protoOf(Companion_2).
|
|
616
|
-
return this.
|
|
778
|
+
protoOf(Companion_2).w2k = function (r, g, b, alpha) {
|
|
779
|
+
return this.q2j_1.w2k(r, g, b, alpha);
|
|
780
|
+
};
|
|
781
|
+
protoOf(Companion_2).z2a = function (hex) {
|
|
782
|
+
return this.q2j_1.z2a(hex);
|
|
783
|
+
};
|
|
784
|
+
protoOf(Companion_2).equals = function (other) {
|
|
785
|
+
return equals(RGBColorSpaces_getInstance().y2j_1, other);
|
|
786
|
+
};
|
|
787
|
+
protoOf(Companion_2).hashCode = function () {
|
|
788
|
+
return hashCode(RGBColorSpaces_getInstance().y2j_1);
|
|
617
789
|
};
|
|
618
790
|
var Companion_instance_2;
|
|
619
791
|
function Companion_getInstance_2() {
|
|
@@ -621,45 +793,48 @@
|
|
|
621
793
|
new Companion_2();
|
|
622
794
|
return Companion_instance_2;
|
|
623
795
|
}
|
|
796
|
+
function clamp$copy(receiver, p0, p1, p2, p3) {
|
|
797
|
+
return receiver.b2l(p0, p1, p2, p3);
|
|
798
|
+
}
|
|
624
799
|
function RGB(r, g, b, alpha, space) {
|
|
625
800
|
Companion_getInstance_2();
|
|
626
|
-
this.
|
|
627
|
-
this.
|
|
628
|
-
this.
|
|
629
|
-
this.
|
|
630
|
-
this.
|
|
801
|
+
this.h2i_1 = r;
|
|
802
|
+
this.i2i_1 = g;
|
|
803
|
+
this.j2i_1 = b;
|
|
804
|
+
this.k2i_1 = alpha;
|
|
805
|
+
this.l2i_1 = space;
|
|
631
806
|
}
|
|
632
|
-
protoOf(RGB).
|
|
807
|
+
protoOf(RGB).e2i = function () {
|
|
808
|
+
return this.l2i_1;
|
|
809
|
+
};
|
|
810
|
+
protoOf(RGB).c2l = function () {
|
|
633
811
|
// Inline function 'kotlin.math.roundToInt' call
|
|
634
|
-
var this_0 = this.
|
|
812
|
+
var this_0 = this.h2i_1 * 255;
|
|
635
813
|
return roundToInt(this_0);
|
|
636
814
|
};
|
|
637
|
-
protoOf(RGB).
|
|
815
|
+
protoOf(RGB).d2l = function () {
|
|
638
816
|
// Inline function 'kotlin.math.roundToInt' call
|
|
639
|
-
var this_0 = this.
|
|
817
|
+
var this_0 = this.i2i_1 * 255;
|
|
640
818
|
return roundToInt(this_0);
|
|
641
819
|
};
|
|
642
|
-
protoOf(RGB).
|
|
820
|
+
protoOf(RGB).e2l = function () {
|
|
643
821
|
// Inline function 'kotlin.math.roundToInt' call
|
|
644
|
-
var this_0 = this.
|
|
822
|
+
var this_0 = this.j2i_1 * 255;
|
|
645
823
|
return roundToInt(this_0);
|
|
646
824
|
};
|
|
647
|
-
protoOf(RGB).
|
|
648
|
-
var f = SRGB_getInstance().
|
|
649
|
-
return equals(this.
|
|
650
|
-
};
|
|
651
|
-
protoOf(RGB).p36 = function () {
|
|
652
|
-
return this.q36(coerceIn(this.r34_1, 0.0, 1.0), coerceIn(this.s34_1, 0.0, 1.0), coerceIn(this.t34_1, 0.0, 1.0), coerceIn(this.u34_1, 0.0, 1.0));
|
|
825
|
+
protoOf(RGB).f2l = function (space) {
|
|
826
|
+
var f = SRGB_getInstance().k2k();
|
|
827
|
+
return equals(this.l2i_1, space) ? this : equals(this.l2i_1, SRGB_getInstance()) && equals(space, RGBColorSpaces_getInstance().z2j_1) ? space.r2j(f.t2k(this.h2i_1), f.t2k(this.i2i_1), f.t2k(this.j2i_1), this.k2i_1) : equals(this.l2i_1, RGBColorSpaces_getInstance().z2j_1) && equals(space, SRGB_getInstance()) ? space.r2j(f.u2k(this.h2i_1), f.u2k(this.i2i_1), f.u2k(this.j2i_1), this.k2i_1) : this.g2i().l2l(space);
|
|
653
828
|
};
|
|
654
|
-
protoOf(RGB).
|
|
829
|
+
protoOf(RGB).m2l = function () {
|
|
655
830
|
var tmp$ret$3;
|
|
656
831
|
$l$block: {
|
|
657
832
|
// Inline function 'com.github.ajalt.colormath.model.RGB.srgbHueMinMaxChroma' call
|
|
658
833
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
659
|
-
var $this$toSRGB = this.
|
|
660
|
-
var r = $this$toSRGB.
|
|
661
|
-
var g = $this$toSRGB.
|
|
662
|
-
var b = $this$toSRGB.
|
|
834
|
+
var $this$toSRGB = this.f2l(SRGB_getInstance());
|
|
835
|
+
var r = $this$toSRGB.h2i_1;
|
|
836
|
+
var g = $this$toSRGB.i2i_1;
|
|
837
|
+
var b = $this$toSRGB.j2i_1;
|
|
663
838
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
664
839
|
var min = Math.min(r, g, b);
|
|
665
840
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
@@ -681,94 +856,136 @@
|
|
|
681
856
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toHSV.<anonymous>' call
|
|
682
857
|
var h_0 = normalizeDeg(h);
|
|
683
858
|
var s = max === 0.0 ? 0.0 : chroma / max;
|
|
684
|
-
tmp$ret$3 = new HSV(h_0, s, max, this.
|
|
859
|
+
tmp$ret$3 = new HSV(h_0, s, max, this.k2i_1);
|
|
685
860
|
break $l$block;
|
|
686
861
|
}
|
|
687
862
|
return tmp$ret$3;
|
|
688
863
|
};
|
|
689
|
-
protoOf(RGB).
|
|
690
|
-
var f = this.
|
|
864
|
+
protoOf(RGB).g2i = function () {
|
|
865
|
+
var f = this.l2i_1.k2k();
|
|
691
866
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
692
|
-
var this_0 = _Matrix___init__impl__q3kp4w(this.
|
|
693
|
-
var v0 = f.
|
|
694
|
-
var v1 = f.
|
|
695
|
-
var v2 = f.
|
|
867
|
+
var this_0 = _Matrix___init__impl__q3kp4w(this.l2i_1.y2k());
|
|
868
|
+
var v0 = f.t2k(this.h2i_1);
|
|
869
|
+
var v1 = f.t2k(this.i2i_1);
|
|
870
|
+
var v2 = f.t2k(this.j2i_1);
|
|
696
871
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toXYZ.<anonymous>' call
|
|
697
872
|
var x = Matrix__get_impl_xogbpk(this_0, 0, 0) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 0) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 0) * v2;
|
|
698
873
|
var y = Matrix__get_impl_xogbpk(this_0, 0, 1) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 1) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 1) * v2;
|
|
699
874
|
var z = Matrix__get_impl_xogbpk(this_0, 0, 2) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 2) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 2) * v2;
|
|
700
|
-
return
|
|
875
|
+
return XYZColorSpace_0(this.l2i_1.a2l()).r2j(x, y, z, this.k2i_1);
|
|
701
876
|
};
|
|
702
|
-
protoOf(RGB).
|
|
877
|
+
protoOf(RGB).j2j = function () {
|
|
703
878
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
704
|
-
var $this$toSRGB = this.
|
|
879
|
+
var $this$toSRGB = this.f2l(SRGB_getInstance());
|
|
705
880
|
// Inline function 'kotlin.math.roundToInt' call
|
|
706
|
-
var this_0 = $this$toSRGB.
|
|
881
|
+
var this_0 = $this$toSRGB.m2l().o2j_1 * 100;
|
|
707
882
|
var value = roundToInt(this_0);
|
|
708
883
|
if (value === 30)
|
|
709
884
|
return new Ansi16(30);
|
|
710
885
|
var v = value / 50 | 0;
|
|
711
886
|
// Inline function 'kotlin.math.roundToInt' call
|
|
712
|
-
var this_1 = $this$toSRGB.
|
|
887
|
+
var this_1 = $this$toSRGB.j2i_1;
|
|
713
888
|
var tmp$ret$1 = roundToInt(this_1);
|
|
714
889
|
var tmp = imul(tmp$ret$1, 4);
|
|
715
890
|
// Inline function 'kotlin.math.roundToInt' call
|
|
716
|
-
var this_2 = $this$toSRGB.
|
|
891
|
+
var this_2 = $this$toSRGB.i2i_1;
|
|
717
892
|
var tmp$ret$2 = roundToInt(this_2);
|
|
718
893
|
var tmp_0 = tmp | imul(tmp$ret$2, 2);
|
|
719
894
|
// Inline function 'kotlin.math.roundToInt' call
|
|
720
|
-
var this_3 = $this$toSRGB.
|
|
895
|
+
var this_3 = $this$toSRGB.h2i_1;
|
|
721
896
|
var ansi = 30 + (tmp_0 | roundToInt(this_3)) | 0;
|
|
722
897
|
return new Ansi16(v === 2 ? ansi + 60 | 0 : ansi);
|
|
723
898
|
};
|
|
724
|
-
protoOf(RGB).
|
|
899
|
+
protoOf(RGB).n2l = function () {
|
|
725
900
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
726
|
-
var $this$toSRGB = this.
|
|
727
|
-
var ri = $this$toSRGB.
|
|
728
|
-
var gi = $this$toSRGB.
|
|
729
|
-
var bi = $this$toSRGB.
|
|
901
|
+
var $this$toSRGB = this.f2l(SRGB_getInstance());
|
|
902
|
+
var ri = $this$toSRGB.c2l();
|
|
903
|
+
var gi = $this$toSRGB.d2l();
|
|
904
|
+
var bi = $this$toSRGB.e2l();
|
|
730
905
|
var tmp;
|
|
731
906
|
if (ri === gi && gi === bi) {
|
|
732
907
|
tmp = ri < 8 ? 16 : ri > 248 ? 231 : roundToInt((ri - 8 | 0) / 247.0 * 24.0) + 232 | 0;
|
|
733
908
|
} else {
|
|
734
909
|
// Inline function 'kotlin.math.roundToInt' call
|
|
735
|
-
var this_0 = $this$toSRGB.
|
|
910
|
+
var this_0 = $this$toSRGB.h2i_1 * 5;
|
|
736
911
|
var tmp$ret$0 = roundToInt(this_0);
|
|
737
912
|
var tmp_0 = 16 + imul(36, tmp$ret$0) | 0;
|
|
738
913
|
// Inline function 'kotlin.math.roundToInt' call
|
|
739
|
-
var this_1 = $this$toSRGB.
|
|
914
|
+
var this_1 = $this$toSRGB.i2i_1 * 5;
|
|
740
915
|
var tmp$ret$1 = roundToInt(this_1);
|
|
741
916
|
var tmp_1 = tmp_0 + imul(6, tmp$ret$1) | 0;
|
|
742
917
|
// Inline function 'kotlin.math.roundToInt' call
|
|
743
|
-
var this_2 = $this$toSRGB.
|
|
918
|
+
var this_2 = $this$toSRGB.j2i_1 * 5;
|
|
744
919
|
tmp = tmp_1 + roundToInt(this_2) | 0;
|
|
745
920
|
}
|
|
746
921
|
var code = tmp;
|
|
747
922
|
return new Ansi256(code);
|
|
748
923
|
};
|
|
749
|
-
protoOf(RGB).
|
|
750
|
-
return this.
|
|
924
|
+
protoOf(RGB).f2i = function () {
|
|
925
|
+
return this.f2l(RGBColorSpaces_getInstance().y2j_1);
|
|
926
|
+
};
|
|
927
|
+
protoOf(RGB).o2l = function () {
|
|
928
|
+
// Inline function 'com.github.ajalt.colormath.internal.clamp3' call
|
|
929
|
+
var v1 = this.h2i_1;
|
|
930
|
+
var v2 = this.i2i_1;
|
|
931
|
+
var v3 = this.j2i_1;
|
|
932
|
+
var alpha = this.k2i_1;
|
|
933
|
+
var tmp0_container = this.e2i().d2j();
|
|
934
|
+
// Inline function 'kotlin.collections.component1' call
|
|
935
|
+
var c1 = tmp0_container.k(0);
|
|
936
|
+
// Inline function 'kotlin.collections.component2' call
|
|
937
|
+
var c2 = tmp0_container.k(1);
|
|
938
|
+
// Inline function 'kotlin.collections.component3' call
|
|
939
|
+
var c3 = tmp0_container.k(2);
|
|
940
|
+
var tmp;
|
|
941
|
+
var tmp_0;
|
|
942
|
+
var tmp_1;
|
|
943
|
+
var tmp_2;
|
|
944
|
+
var containsLower = c1.o2i_1;
|
|
945
|
+
if (v1 <= c1.p2i_1 ? containsLower <= v1 : false) {
|
|
946
|
+
var containsLower_0 = c2.o2i_1;
|
|
947
|
+
tmp_2 = v2 <= c2.p2i_1 ? containsLower_0 <= v2 : false;
|
|
948
|
+
} else {
|
|
949
|
+
tmp_2 = false;
|
|
950
|
+
}
|
|
951
|
+
if (tmp_2) {
|
|
952
|
+
var containsLower_1 = c3.o2i_1;
|
|
953
|
+
tmp_1 = v3 <= c3.p2i_1 ? containsLower_1 <= v3 : false;
|
|
954
|
+
} else {
|
|
955
|
+
tmp_1 = false;
|
|
956
|
+
}
|
|
957
|
+
if (tmp_1) {
|
|
958
|
+
tmp_0 = 0.0 <= alpha ? alpha <= 1.0 : false;
|
|
959
|
+
} else {
|
|
960
|
+
tmp_0 = false;
|
|
961
|
+
}
|
|
962
|
+
if (tmp_0) {
|
|
963
|
+
tmp = this;
|
|
964
|
+
} else {
|
|
965
|
+
tmp = clamp$copy(this, coerceIn(v1, c1.o2i_1, c1.p2i_1), coerceIn(v2, c2.o2i_1, c2.p2i_1), coerceIn(v3, c3.o2i_1, c3.p2i_1), coerceIn(alpha, 0.0, 1.0));
|
|
966
|
+
}
|
|
967
|
+
return tmp;
|
|
751
968
|
};
|
|
752
|
-
protoOf(RGB).
|
|
969
|
+
protoOf(RGB).p2l = function (r, g, b, alpha, space) {
|
|
753
970
|
return new RGB(r, g, b, alpha, space);
|
|
754
971
|
};
|
|
755
|
-
protoOf(RGB).
|
|
756
|
-
r = r === VOID ? this.
|
|
757
|
-
g = g === VOID ? this.
|
|
758
|
-
b = b === VOID ? this.
|
|
759
|
-
alpha = alpha === VOID ? this.
|
|
760
|
-
space = space === VOID ? this.
|
|
761
|
-
return $super === VOID ? this.
|
|
972
|
+
protoOf(RGB).b2l = function (r, g, b, alpha, space, $super) {
|
|
973
|
+
r = r === VOID ? this.h2i_1 : r;
|
|
974
|
+
g = g === VOID ? this.i2i_1 : g;
|
|
975
|
+
b = b === VOID ? this.j2i_1 : b;
|
|
976
|
+
alpha = alpha === VOID ? this.k2i_1 : alpha;
|
|
977
|
+
space = space === VOID ? this.l2i_1 : space;
|
|
978
|
+
return $super === VOID ? this.p2l(r, g, b, alpha, space) : $super.p2l.call(this, r, g, b, alpha, space);
|
|
762
979
|
};
|
|
763
980
|
protoOf(RGB).toString = function () {
|
|
764
|
-
return 'RGB(r=' + this.
|
|
981
|
+
return 'RGB(r=' + this.h2i_1 + ', g=' + this.i2i_1 + ', b=' + this.j2i_1 + ', alpha=' + this.k2i_1 + ', space=' + toString(this.l2i_1) + ')';
|
|
765
982
|
};
|
|
766
983
|
protoOf(RGB).hashCode = function () {
|
|
767
|
-
var result = getNumberHashCode(this.
|
|
768
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
769
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
770
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
771
|
-
result = imul(result, 31) + hashCode(this.
|
|
984
|
+
var result = getNumberHashCode(this.h2i_1);
|
|
985
|
+
result = imul(result, 31) + getNumberHashCode(this.i2i_1) | 0;
|
|
986
|
+
result = imul(result, 31) + getNumberHashCode(this.j2i_1) | 0;
|
|
987
|
+
result = imul(result, 31) + getNumberHashCode(this.k2i_1) | 0;
|
|
988
|
+
result = imul(result, 31) + hashCode(this.l2i_1) | 0;
|
|
772
989
|
return result;
|
|
773
990
|
};
|
|
774
991
|
protoOf(RGB).equals = function (other) {
|
|
@@ -777,15 +994,15 @@
|
|
|
777
994
|
if (!(other instanceof RGB))
|
|
778
995
|
return false;
|
|
779
996
|
var tmp0_other_with_cast = other instanceof RGB ? other : THROW_CCE();
|
|
780
|
-
if (!equals(this.
|
|
997
|
+
if (!equals(this.h2i_1, tmp0_other_with_cast.h2i_1))
|
|
781
998
|
return false;
|
|
782
|
-
if (!equals(this.
|
|
999
|
+
if (!equals(this.i2i_1, tmp0_other_with_cast.i2i_1))
|
|
783
1000
|
return false;
|
|
784
|
-
if (!equals(this.
|
|
1001
|
+
if (!equals(this.j2i_1, tmp0_other_with_cast.j2i_1))
|
|
785
1002
|
return false;
|
|
786
|
-
if (!equals(this.
|
|
1003
|
+
if (!equals(this.k2i_1, tmp0_other_with_cast.k2i_1))
|
|
787
1004
|
return false;
|
|
788
|
-
if (!equals(this.
|
|
1005
|
+
if (!equals(this.l2i_1, tmp0_other_with_cast.l2i_1))
|
|
789
1006
|
return false;
|
|
790
1007
|
return true;
|
|
791
1008
|
};
|
|
@@ -800,7 +1017,7 @@
|
|
|
800
1017
|
// Inline function 'kotlin.contracts.contract' call
|
|
801
1018
|
// Inline function 'com.github.ajalt.colormath.model.parseHex.<anonymous>' call
|
|
802
1019
|
var it = charSequenceGet(_this__u8e3s4, i_0);
|
|
803
|
-
var tmp$ret$1 =
|
|
1020
|
+
var tmp$ret$1 = toString_0(it) + toString_0(it);
|
|
804
1021
|
tmp = toInt(tmp$ret$1, 16);
|
|
805
1022
|
}
|
|
806
1023
|
return tmp;
|
|
@@ -828,7 +1045,7 @@
|
|
|
828
1045
|
if (!tmp$ret$0) {
|
|
829
1046
|
// Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>.<anonymous>' call
|
|
830
1047
|
var message = 'Hex string must be in the format "#ffffff" or "ffffff"';
|
|
831
|
-
throw IllegalArgumentException_init_$Create$(
|
|
1048
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
832
1049
|
}
|
|
833
1050
|
return _this__u8e3s4;
|
|
834
1051
|
}
|
|
@@ -885,20 +1102,48 @@
|
|
|
885
1102
|
return ACES_AP1_B;
|
|
886
1103
|
}
|
|
887
1104
|
var ACES_AP1_B;
|
|
1105
|
+
function RGBColorSpaces$SRGB$lambda($this$$receiver, it) {
|
|
1106
|
+
return it.f2i();
|
|
1107
|
+
}
|
|
1108
|
+
function RGBColorSpaces$BT2020$lambda($this$$receiver, color) {
|
|
1109
|
+
var tmp;
|
|
1110
|
+
if (color instanceof RGB) {
|
|
1111
|
+
tmp = color.f2l($this$$receiver);
|
|
1112
|
+
} else {
|
|
1113
|
+
if (color instanceof ICtCp) {
|
|
1114
|
+
tmp = color.x2j();
|
|
1115
|
+
} else {
|
|
1116
|
+
tmp = color.g2i().l2l($this$$receiver);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
return tmp;
|
|
1120
|
+
}
|
|
888
1121
|
function RGBColorSpaces() {
|
|
889
1122
|
RGBColorSpaces_instance = this;
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
this.
|
|
898
|
-
this.
|
|
899
|
-
this.
|
|
900
|
-
this.
|
|
901
|
-
this.
|
|
1123
|
+
var tmp = this;
|
|
1124
|
+
var tmp_0 = Illuminant_getInstance().x2i_1;
|
|
1125
|
+
var tmp_1 = SRGBTransferFunctions_instance;
|
|
1126
|
+
var tmp_2 = get_SRGB_R();
|
|
1127
|
+
var tmp_3 = get_SRGB_G();
|
|
1128
|
+
var tmp_4 = get_SRGB_B();
|
|
1129
|
+
tmp.y2j_1 = new RGBColorSpaceImpl('sRGB', tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, RGBColorSpaces$SRGB$lambda);
|
|
1130
|
+
this.z2j_1 = RGBColorSpace_0('Linear sRGB', Illuminant_getInstance().x2i_1, LinearTransferFunctions_instance, get_SRGB_R(), get_SRGB_G(), get_SRGB_B());
|
|
1131
|
+
this.a2k_1 = RGBColorSpace_0('ACES2065-1', get_ACES_WHITE_POINT(), LinearTransferFunctions_instance, get_ACES_AP0_R(), get_ACES_AP0_G(), get_ACES_AP0_B());
|
|
1132
|
+
this.b2k_1 = RGBColorSpace_0('ACEScc', get_ACES_WHITE_POINT(), ACESccTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1133
|
+
this.c2k_1 = RGBColorSpace_0('ACEScct', get_ACES_WHITE_POINT(), ACEScctTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1134
|
+
this.d2k_1 = RGBColorSpace_0('ACEScg', get_ACES_WHITE_POINT(), LinearTransferFunctions_instance, get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1135
|
+
this.e2k_1 = RGBColorSpace_0('Adobe RGB', Illuminant_getInstance().x2i_1, new GammaTransferFunctions(2.19921875), xyY_init_$Create$(0.64, 0.33), xyY_init_$Create$(0.21, 0.71), xyY_init_$Create$(0.15, 0.06));
|
|
1136
|
+
var tmp_5 = this;
|
|
1137
|
+
var tmp_6 = Illuminant_getInstance().x2i_1;
|
|
1138
|
+
var tmp_7 = BT2020TransferFunctions_getInstance();
|
|
1139
|
+
var tmp_8 = xyY_init_$Create$(0.708, 0.292);
|
|
1140
|
+
var tmp_9 = xyY_init_$Create$(0.17, 0.797);
|
|
1141
|
+
var tmp_10 = xyY_init_$Create$(0.131, 0.046);
|
|
1142
|
+
tmp_5.f2k_1 = new RGBColorSpaceImpl('BT.2020', tmp_6, tmp_7, tmp_8, tmp_9, tmp_10, RGBColorSpaces$BT2020$lambda);
|
|
1143
|
+
this.g2k_1 = RGBColorSpace_0('BT.709', Illuminant_getInstance().x2i_1, BT709TransferFunctions_getInstance(), xyY_init_$Create$(0.64, 0.33), xyY_init_$Create$(0.3, 0.6), xyY_init_$Create$(0.15, 0.06));
|
|
1144
|
+
this.h2k_1 = RGBColorSpace_0('DCI P3', new WhitePoint('DCI P3', xyY_init_$Create$(0.314, 0.351)), new GammaTransferFunctions(2.6), xyY_init_$Create$(0.68, 0.32), xyY_init_$Create$(0.265, 0.69), xyY_init_$Create$(0.15, 0.06));
|
|
1145
|
+
this.i2k_1 = RGBColorSpace_0('Display P3', Illuminant_getInstance().x2i_1, SRGBTransferFunctions_instance, xyY_init_$Create$(0.68, 0.32), xyY_init_$Create$(0.265, 0.69), xyY_init_$Create$(0.15, 0.06));
|
|
1146
|
+
this.j2k_1 = RGBColorSpace_0('ROMM RGB', Illuminant_getInstance().v2i_1, ROMMTransferFunctions_instance, xyY_init_$Create$(0.7347, 0.2653), xyY_init_$Create$(0.1596, 0.8404), xyY_init_$Create$(0.0366, 1.0E-4));
|
|
902
1147
|
}
|
|
903
1148
|
var RGBColorSpaces_instance;
|
|
904
1149
|
function RGBColorSpaces_getInstance() {
|
|
@@ -908,30 +1153,46 @@
|
|
|
908
1153
|
}
|
|
909
1154
|
function SRGB() {
|
|
910
1155
|
SRGB_instance = this;
|
|
911
|
-
this.
|
|
912
|
-
this.e35_1 = rectangularComponentInfo('RGB');
|
|
913
|
-
this.f35_1 = Illuminant_getInstance().d34_1;
|
|
914
|
-
this.g35_1 = SRGBTransferFunctions_instance;
|
|
915
|
-
this.h35_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.f35_1, get_SRGB_R(), get_SRGB_G(), get_SRGB_B()));
|
|
916
|
-
this.i35_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.h35_1)));
|
|
1156
|
+
this.s2j_1 = RGBColorSpaces_getInstance().y2j_1;
|
|
917
1157
|
}
|
|
918
|
-
protoOf(SRGB).
|
|
919
|
-
return this.
|
|
1158
|
+
protoOf(SRGB).d2j = function () {
|
|
1159
|
+
return this.s2j_1.d2j();
|
|
920
1160
|
};
|
|
921
|
-
protoOf(SRGB).
|
|
922
|
-
return this.
|
|
1161
|
+
protoOf(SRGB).z2k = function () {
|
|
1162
|
+
return this.s2j_1.z2k();
|
|
923
1163
|
};
|
|
924
|
-
protoOf(SRGB).
|
|
925
|
-
return this.
|
|
1164
|
+
protoOf(SRGB).y2k = function () {
|
|
1165
|
+
return this.s2j_1.y2k();
|
|
926
1166
|
};
|
|
927
|
-
protoOf(SRGB).
|
|
928
|
-
return this.
|
|
1167
|
+
protoOf(SRGB).r2 = function () {
|
|
1168
|
+
return this.s2j_1.r2();
|
|
929
1169
|
};
|
|
930
|
-
protoOf(SRGB).
|
|
931
|
-
return this.
|
|
1170
|
+
protoOf(SRGB).k2k = function () {
|
|
1171
|
+
return this.s2j_1.k2k();
|
|
932
1172
|
};
|
|
933
|
-
protoOf(SRGB).
|
|
934
|
-
return
|
|
1173
|
+
protoOf(SRGB).a2l = function () {
|
|
1174
|
+
return this.s2j_1.a2l();
|
|
1175
|
+
};
|
|
1176
|
+
protoOf(SRGB).x2k = function (r, g, b, alpha) {
|
|
1177
|
+
return this.s2j_1.x2k(r, g, b, alpha);
|
|
1178
|
+
};
|
|
1179
|
+
protoOf(SRGB).r2j = function (r, g, b, alpha) {
|
|
1180
|
+
return this.s2j_1.r2j(r, g, b, alpha);
|
|
1181
|
+
};
|
|
1182
|
+
protoOf(SRGB).w2k = function (r, g, b, alpha) {
|
|
1183
|
+
return this.s2j_1.w2k(r, g, b, alpha);
|
|
1184
|
+
};
|
|
1185
|
+
protoOf(SRGB).z2a = function (hex) {
|
|
1186
|
+
return this.s2j_1.z2a(hex);
|
|
1187
|
+
};
|
|
1188
|
+
protoOf(SRGB).equals = function (other) {
|
|
1189
|
+
return equals(RGBColorSpaces_getInstance().y2j_1, other);
|
|
1190
|
+
};
|
|
1191
|
+
protoOf(SRGB).hashCode = function () {
|
|
1192
|
+
return hashCode(RGBColorSpaces_getInstance().y2j_1);
|
|
1193
|
+
};
|
|
1194
|
+
protoOf(SRGB).toString = function () {
|
|
1195
|
+
return 'sRGB';
|
|
935
1196
|
};
|
|
936
1197
|
var SRGB_instance;
|
|
937
1198
|
function SRGB_getInstance() {
|
|
@@ -939,20 +1200,103 @@
|
|
|
939
1200
|
new SRGB();
|
|
940
1201
|
return SRGB_instance;
|
|
941
1202
|
}
|
|
1203
|
+
function RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b, convertImpl) {
|
|
1204
|
+
this.q2l_1 = name;
|
|
1205
|
+
this.r2l_1 = whitePoint;
|
|
1206
|
+
this.s2l_1 = transferFunctions;
|
|
1207
|
+
this.t2l_1 = r;
|
|
1208
|
+
this.u2l_1 = g;
|
|
1209
|
+
this.v2l_1 = b;
|
|
1210
|
+
this.w2l_1 = convertImpl;
|
|
1211
|
+
this.x2l_1 = zeroOneComponentInfo('RGB');
|
|
1212
|
+
this.y2l_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.r2l_1, this.t2l_1, this.u2l_1, this.v2l_1));
|
|
1213
|
+
this.z2l_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.y2l_1)));
|
|
1214
|
+
}
|
|
1215
|
+
protoOf(RGBColorSpaceImpl).r2 = function () {
|
|
1216
|
+
return this.q2l_1;
|
|
1217
|
+
};
|
|
1218
|
+
protoOf(RGBColorSpaceImpl).a2l = function () {
|
|
1219
|
+
return this.r2l_1;
|
|
1220
|
+
};
|
|
1221
|
+
protoOf(RGBColorSpaceImpl).k2k = function () {
|
|
1222
|
+
return this.s2l_1;
|
|
1223
|
+
};
|
|
1224
|
+
protoOf(RGBColorSpaceImpl).d2j = function () {
|
|
1225
|
+
return this.x2l_1;
|
|
1226
|
+
};
|
|
1227
|
+
protoOf(RGBColorSpaceImpl).y2k = function () {
|
|
1228
|
+
return this.y2l_1;
|
|
1229
|
+
};
|
|
1230
|
+
protoOf(RGBColorSpaceImpl).z2k = function () {
|
|
1231
|
+
return this.z2l_1;
|
|
1232
|
+
};
|
|
1233
|
+
protoOf(RGBColorSpaceImpl).toString = function () {
|
|
1234
|
+
return this.q2l_1;
|
|
1235
|
+
};
|
|
1236
|
+
protoOf(RGBColorSpaceImpl).r2j = function (r, g, b, alpha) {
|
|
1237
|
+
return new RGB(r, g, b, alpha, this);
|
|
1238
|
+
};
|
|
1239
|
+
protoOf(RGBColorSpaceImpl).equals = function (other) {
|
|
1240
|
+
if (this === other)
|
|
1241
|
+
return true;
|
|
1242
|
+
if (!(!(other == null) ? isInterface(other, RGBColorSpace) : false))
|
|
1243
|
+
return false;
|
|
1244
|
+
if (!(this.q2l_1 === other.r2()))
|
|
1245
|
+
return false;
|
|
1246
|
+
if (!this.r2l_1.equals(other.a2l()))
|
|
1247
|
+
return false;
|
|
1248
|
+
if (!equals(this.s2l_1, other.k2k()))
|
|
1249
|
+
return false;
|
|
1250
|
+
if (other instanceof RGBColorSpaceImpl) {
|
|
1251
|
+
if (!this.t2l_1.equals(other.t2l_1))
|
|
1252
|
+
return false;
|
|
1253
|
+
if (!this.u2l_1.equals(other.u2l_1))
|
|
1254
|
+
return false;
|
|
1255
|
+
if (!this.v2l_1.equals(other.v2l_1))
|
|
1256
|
+
return false;
|
|
1257
|
+
} else {
|
|
1258
|
+
if (!contentEquals(this.y2l_1, other.y2k()))
|
|
1259
|
+
return false;
|
|
1260
|
+
if (!contentEquals(this.z2l_1, other.z2k()))
|
|
1261
|
+
return false;
|
|
1262
|
+
}
|
|
1263
|
+
return true;
|
|
1264
|
+
};
|
|
1265
|
+
protoOf(RGBColorSpaceImpl).hashCode = function () {
|
|
1266
|
+
var result = getStringHashCode(this.q2l_1);
|
|
1267
|
+
result = imul(31, result) + this.r2l_1.hashCode() | 0;
|
|
1268
|
+
result = imul(31, result) + hashCode(this.s2l_1) | 0;
|
|
1269
|
+
result = imul(31, result) + this.t2l_1.hashCode() | 0;
|
|
1270
|
+
result = imul(31, result) + this.u2l_1.hashCode() | 0;
|
|
1271
|
+
result = imul(31, result) + this.v2l_1.hashCode() | 0;
|
|
1272
|
+
return result;
|
|
1273
|
+
};
|
|
1274
|
+
function SRGBTransferFunctions() {
|
|
1275
|
+
}
|
|
1276
|
+
protoOf(SRGBTransferFunctions).u2k = function (x) {
|
|
1277
|
+
return x <= 0.0031308 ? x * 12.92 : 1.055 * spow(x, 1 / 2.4) - 0.055;
|
|
1278
|
+
};
|
|
1279
|
+
protoOf(SRGBTransferFunctions).t2k = function (x) {
|
|
1280
|
+
return x <= 0.04045 ? x / 12.92 : spow_0((x + 0.055) / 1.055, 2.4);
|
|
1281
|
+
};
|
|
1282
|
+
var SRGBTransferFunctions_instance;
|
|
1283
|
+
function SRGBTransferFunctions_getInstance() {
|
|
1284
|
+
return SRGBTransferFunctions_instance;
|
|
1285
|
+
}
|
|
942
1286
|
function RGBColorSpace_0(name, whitePoint, transferFunctions, r, g, b) {
|
|
943
1287
|
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
944
|
-
return new RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b);
|
|
1288
|
+
return new RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b, RGBColorSpace$lambda);
|
|
945
1289
|
}
|
|
946
1290
|
function ACESccTransferFunctions() {
|
|
947
1291
|
ACESccTransferFunctions_instance = this;
|
|
948
|
-
this.
|
|
949
|
-
this.
|
|
950
|
-
this.
|
|
1292
|
+
this.a2m_1 = 3.0517578125E-5;
|
|
1293
|
+
this.b2m_1 = 1.52587890625E-5;
|
|
1294
|
+
this.c2m_1 = -0.3013698630136986;
|
|
951
1295
|
var tmp = this;
|
|
952
1296
|
// Inline function 'kotlin.math.log2' call
|
|
953
|
-
tmp.
|
|
1297
|
+
tmp.d2m_1 = (log2(65504.0) + 9.72) / 17.52;
|
|
954
1298
|
}
|
|
955
|
-
protoOf(ACESccTransferFunctions).
|
|
1299
|
+
protoOf(ACESccTransferFunctions).t2k = function (x) {
|
|
956
1300
|
var tmp;
|
|
957
1301
|
var tmp_0 = x;
|
|
958
1302
|
ACESccTransferFunctions_getInstance();
|
|
@@ -961,7 +1305,7 @@
|
|
|
961
1305
|
ACESccTransferFunctions_getInstance();
|
|
962
1306
|
tmp = (tmp_1 - 1.52587890625E-5) * 2.0;
|
|
963
1307
|
} else {
|
|
964
|
-
if (x < this.
|
|
1308
|
+
if (x < this.d2m_1) {
|
|
965
1309
|
// Inline function 'kotlin.math.pow' call
|
|
966
1310
|
var x_0 = x * 17.52 - 9.72;
|
|
967
1311
|
tmp = Math.pow(2.0, x_0);
|
|
@@ -971,7 +1315,7 @@
|
|
|
971
1315
|
}
|
|
972
1316
|
return tmp;
|
|
973
1317
|
};
|
|
974
|
-
protoOf(ACESccTransferFunctions).
|
|
1318
|
+
protoOf(ACESccTransferFunctions).u2k = function (x) {
|
|
975
1319
|
var tmp;
|
|
976
1320
|
var tmp_0 = x;
|
|
977
1321
|
ACESccTransferFunctions_getInstance();
|
|
@@ -994,20 +1338,20 @@
|
|
|
994
1338
|
}
|
|
995
1339
|
function ACEScctTransferFunctions() {
|
|
996
1340
|
ACEScctTransferFunctions_instance = this;
|
|
997
|
-
this.
|
|
998
|
-
this.
|
|
1341
|
+
this.e2m_1 = 10.5402377416545;
|
|
1342
|
+
this.f2m_1 = 0.0729055341958355;
|
|
999
1343
|
var tmp = this;
|
|
1000
1344
|
// Inline function 'kotlin.math.log2' call
|
|
1001
|
-
tmp.
|
|
1345
|
+
tmp.g2m_1 = (log2(65504.0) + 9.72) / 17.52;
|
|
1002
1346
|
}
|
|
1003
|
-
protoOf(ACEScctTransferFunctions).
|
|
1347
|
+
protoOf(ACEScctTransferFunctions).t2k = function (x) {
|
|
1004
1348
|
var tmp;
|
|
1005
1349
|
if (x <= 0.155251141552511) {
|
|
1006
1350
|
ACEScctTransferFunctions_getInstance();
|
|
1007
1351
|
var tmp_0 = x - 0.0729055341958355;
|
|
1008
1352
|
ACEScctTransferFunctions_getInstance();
|
|
1009
1353
|
tmp = tmp_0 / 10.5402377416545;
|
|
1010
|
-
} else if (x < this.
|
|
1354
|
+
} else if (x < this.g2m_1) {
|
|
1011
1355
|
// Inline function 'kotlin.math.pow' call
|
|
1012
1356
|
var x_0 = x * 17.52 - 9.72;
|
|
1013
1357
|
tmp = Math.pow(2.0, x_0);
|
|
@@ -1016,7 +1360,7 @@
|
|
|
1016
1360
|
}
|
|
1017
1361
|
return tmp;
|
|
1018
1362
|
};
|
|
1019
|
-
protoOf(ACEScctTransferFunctions).
|
|
1363
|
+
protoOf(ACEScctTransferFunctions).u2k = function (x) {
|
|
1020
1364
|
var tmp;
|
|
1021
1365
|
if (x < 0.0078125) {
|
|
1022
1366
|
ACEScctTransferFunctions_getInstance();
|
|
@@ -1035,47 +1379,58 @@
|
|
|
1035
1379
|
new ACEScctTransferFunctions();
|
|
1036
1380
|
return ACEScctTransferFunctions_instance;
|
|
1037
1381
|
}
|
|
1038
|
-
function
|
|
1039
|
-
|
|
1040
|
-
this.
|
|
1041
|
-
this.
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1382
|
+
function BT2020TransferFunctions() {
|
|
1383
|
+
BT2020TransferFunctions_instance = this;
|
|
1384
|
+
this.h2m_1 = 1.0993;
|
|
1385
|
+
this.i2m_1 = 0.0181;
|
|
1386
|
+
var tmp = this;
|
|
1387
|
+
BT2020TransferFunctions_getInstance();
|
|
1388
|
+
// Inline function 'kotlin.math.pow' call
|
|
1389
|
+
BT2020TransferFunctions_getInstance();
|
|
1390
|
+
var tmp_0 = 1.0993 * Math.pow(0.0181, 0.45);
|
|
1391
|
+
BT2020TransferFunctions_getInstance();
|
|
1392
|
+
tmp.j2m_1 = tmp_0 - (1.0993 - 1);
|
|
1046
1393
|
}
|
|
1047
|
-
protoOf(
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
return
|
|
1058
|
-
};
|
|
1059
|
-
protoOf(BT2020Space).q35 = function () {
|
|
1060
|
-
return this.g37_1;
|
|
1394
|
+
protoOf(BT2020TransferFunctions).t2k = function (x) {
|
|
1395
|
+
var tmp;
|
|
1396
|
+
if (x < this.j2m_1) {
|
|
1397
|
+
tmp = x / 4.5;
|
|
1398
|
+
} else {
|
|
1399
|
+
BT2020TransferFunctions_getInstance();
|
|
1400
|
+
var tmp_0 = x + (1.0993 - 1);
|
|
1401
|
+
BT2020TransferFunctions_getInstance();
|
|
1402
|
+
tmp = spow_0(tmp_0 / 1.0993, 1 / 0.45);
|
|
1403
|
+
}
|
|
1404
|
+
return numberToDouble(tmp);
|
|
1061
1405
|
};
|
|
1062
|
-
protoOf(
|
|
1063
|
-
|
|
1406
|
+
protoOf(BT2020TransferFunctions).u2k = function (x) {
|
|
1407
|
+
var tmp;
|
|
1408
|
+
var tmp_0 = x;
|
|
1409
|
+
BT2020TransferFunctions_getInstance();
|
|
1410
|
+
if (tmp_0 < 0.0181) {
|
|
1411
|
+
tmp = 4.5 * x;
|
|
1412
|
+
} else {
|
|
1413
|
+
BT2020TransferFunctions_getInstance();
|
|
1414
|
+
var tmp_1 = 1.0993 * spow(x, 0.45);
|
|
1415
|
+
BT2020TransferFunctions_getInstance();
|
|
1416
|
+
tmp = tmp_1 - (1.0993 - 1);
|
|
1417
|
+
}
|
|
1418
|
+
return tmp;
|
|
1064
1419
|
};
|
|
1065
|
-
var
|
|
1066
|
-
function
|
|
1067
|
-
if (
|
|
1068
|
-
new
|
|
1069
|
-
return
|
|
1420
|
+
var BT2020TransferFunctions_instance;
|
|
1421
|
+
function BT2020TransferFunctions_getInstance() {
|
|
1422
|
+
if (BT2020TransferFunctions_instance == null)
|
|
1423
|
+
new BT2020TransferFunctions();
|
|
1424
|
+
return BT2020TransferFunctions_instance;
|
|
1070
1425
|
}
|
|
1071
1426
|
function BT709TransferFunctions() {
|
|
1072
1427
|
BT709TransferFunctions_instance = this;
|
|
1073
|
-
this.
|
|
1428
|
+
this.k2m_1 = 1.099 * spow_0(0.018, 0.45) - 0.099;
|
|
1074
1429
|
}
|
|
1075
|
-
protoOf(BT709TransferFunctions).
|
|
1076
|
-
return numberToDouble(x < this.
|
|
1430
|
+
protoOf(BT709TransferFunctions).t2k = function (x) {
|
|
1431
|
+
return numberToDouble(x < this.k2m_1 ? x / 4.5 : spow_0((x + 0.099) / 1.099, 1 / 0.45));
|
|
1077
1432
|
};
|
|
1078
|
-
protoOf(BT709TransferFunctions).
|
|
1433
|
+
protoOf(BT709TransferFunctions).u2k = function (x) {
|
|
1079
1434
|
return x < 0.018 ? 4.5 * x : 1.099 * spow(x, 0.45) - 0.099;
|
|
1080
1435
|
};
|
|
1081
1436
|
var BT709TransferFunctions_instance;
|
|
@@ -1084,22 +1439,10 @@
|
|
|
1084
1439
|
new BT709TransferFunctions();
|
|
1085
1440
|
return BT709TransferFunctions_instance;
|
|
1086
1441
|
}
|
|
1087
|
-
function SRGBTransferFunctions() {
|
|
1088
|
-
}
|
|
1089
|
-
protoOf(SRGBTransferFunctions).l35 = function (x) {
|
|
1090
|
-
return x <= 0.0031308 ? x * 12.92 : 1.055 * spow(x, 1 / 2.4) - 0.055;
|
|
1091
|
-
};
|
|
1092
|
-
protoOf(SRGBTransferFunctions).k35 = function (x) {
|
|
1093
|
-
return x <= 0.04045 ? x / 12.92 : spow_0((x + 0.055) / 1.055, 2.4);
|
|
1094
|
-
};
|
|
1095
|
-
var SRGBTransferFunctions_instance;
|
|
1096
|
-
function SRGBTransferFunctions_getInstance() {
|
|
1097
|
-
return SRGBTransferFunctions_instance;
|
|
1098
|
-
}
|
|
1099
1442
|
function ROMMTransferFunctions() {
|
|
1100
|
-
this.
|
|
1443
|
+
this.l2m_1 = 0.001953;
|
|
1101
1444
|
}
|
|
1102
|
-
protoOf(ROMMTransferFunctions).
|
|
1445
|
+
protoOf(ROMMTransferFunctions).t2k = function (x) {
|
|
1103
1446
|
var tmp;
|
|
1104
1447
|
var tmp_0 = x;
|
|
1105
1448
|
if (tmp_0 < 16 * 0.001953) {
|
|
@@ -1109,7 +1452,7 @@
|
|
|
1109
1452
|
}
|
|
1110
1453
|
return tmp;
|
|
1111
1454
|
};
|
|
1112
|
-
protoOf(ROMMTransferFunctions).
|
|
1455
|
+
protoOf(ROMMTransferFunctions).u2k = function (x) {
|
|
1113
1456
|
var tmp;
|
|
1114
1457
|
var tmp_0 = x;
|
|
1115
1458
|
if (tmp_0 < 0.001953) {
|
|
@@ -1125,120 +1468,28 @@
|
|
|
1125
1468
|
}
|
|
1126
1469
|
function rgbToXyzMatrix(whitePoint, r, g, b) {
|
|
1127
1470
|
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1128
|
-
var primaries = _Matrix___init__impl__q3kp4w_0(r.
|
|
1129
|
-
var wp = whitePoint.
|
|
1471
|
+
var primaries = _Matrix___init__impl__q3kp4w_0(r.m2m_1, g.m2m_1, b.m2m_1, r.n2m_1, g.n2m_1, b.n2m_1, r.p2m(), g.p2m(), b.p2m());
|
|
1472
|
+
var wp = whitePoint.r2i_1;
|
|
1130
1473
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1131
1474
|
var this_0 = inverse(primaries);
|
|
1132
|
-
var v0 = wp.
|
|
1133
|
-
var v1 = wp.
|
|
1134
|
-
var v2 = wp.
|
|
1475
|
+
var v0 = wp.q2m();
|
|
1476
|
+
var v1 = wp.o2m_1;
|
|
1477
|
+
var v2 = wp.r2m();
|
|
1135
1478
|
// Inline function 'com.github.ajalt.colormath.model.rgbToXyzMatrix.<anonymous>' call
|
|
1136
1479
|
var x = Matrix__get_impl_xogbpk(this_0, 0, 0) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 0) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 0) * v2;
|
|
1137
1480
|
var y = Matrix__get_impl_xogbpk(this_0, 0, 1) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 1) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 1) * v2;
|
|
1138
1481
|
var z = Matrix__get_impl_xogbpk(this_0, 0, 2) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 2) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 2) * v2;
|
|
1139
1482
|
return dotDiagonal(primaries, x, y, z);
|
|
1140
1483
|
}
|
|
1141
|
-
function
|
|
1142
|
-
|
|
1143
|
-
this.q37_1 = whitePoint;
|
|
1144
|
-
this.r37_1 = transferFunctions;
|
|
1145
|
-
this.s37_1 = r;
|
|
1146
|
-
this.t37_1 = g;
|
|
1147
|
-
this.u37_1 = b;
|
|
1148
|
-
this.v37_1 = rectangularComponentInfo('RGB');
|
|
1149
|
-
this.w37_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.q37_1, this.s37_1, this.t37_1, this.u37_1));
|
|
1150
|
-
this.x37_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.w37_1)));
|
|
1151
|
-
}
|
|
1152
|
-
protoOf(RGBColorSpaceImpl).r35 = function () {
|
|
1153
|
-
return this.q37_1;
|
|
1154
|
-
};
|
|
1155
|
-
protoOf(RGBColorSpaceImpl).o35 = function () {
|
|
1156
|
-
return this.r37_1;
|
|
1157
|
-
};
|
|
1158
|
-
protoOf(RGBColorSpaceImpl).p35 = function () {
|
|
1159
|
-
return this.w37_1;
|
|
1160
|
-
};
|
|
1161
|
-
protoOf(RGBColorSpaceImpl).q35 = function () {
|
|
1162
|
-
return this.x37_1;
|
|
1163
|
-
};
|
|
1164
|
-
protoOf(RGBColorSpaceImpl).toString = function () {
|
|
1165
|
-
return this.p37_1;
|
|
1166
|
-
};
|
|
1167
|
-
protoOf(RGBColorSpaceImpl).c35 = function (r, g, b, alpha) {
|
|
1168
|
-
return new RGB(r, g, b, alpha, this);
|
|
1169
|
-
};
|
|
1170
|
-
protoOf(RGBColorSpaceImpl).hashCode = function () {
|
|
1171
|
-
var result = getStringHashCode(this.p37_1);
|
|
1172
|
-
result = imul(result, 31) + this.q37_1.hashCode() | 0;
|
|
1173
|
-
result = imul(result, 31) + hashCode(this.r37_1) | 0;
|
|
1174
|
-
result = imul(result, 31) + this.s37_1.hashCode() | 0;
|
|
1175
|
-
result = imul(result, 31) + this.t37_1.hashCode() | 0;
|
|
1176
|
-
result = imul(result, 31) + this.u37_1.hashCode() | 0;
|
|
1177
|
-
return result;
|
|
1178
|
-
};
|
|
1179
|
-
protoOf(RGBColorSpaceImpl).equals = function (other) {
|
|
1180
|
-
if (this === other)
|
|
1181
|
-
return true;
|
|
1182
|
-
if (!(other instanceof RGBColorSpaceImpl))
|
|
1183
|
-
return false;
|
|
1184
|
-
var tmp0_other_with_cast = other instanceof RGBColorSpaceImpl ? other : THROW_CCE();
|
|
1185
|
-
if (!(this.p37_1 === tmp0_other_with_cast.p37_1))
|
|
1186
|
-
return false;
|
|
1187
|
-
if (!this.q37_1.equals(tmp0_other_with_cast.q37_1))
|
|
1188
|
-
return false;
|
|
1189
|
-
if (!equals(this.r37_1, tmp0_other_with_cast.r37_1))
|
|
1190
|
-
return false;
|
|
1191
|
-
if (!this.s37_1.equals(tmp0_other_with_cast.s37_1))
|
|
1192
|
-
return false;
|
|
1193
|
-
if (!this.t37_1.equals(tmp0_other_with_cast.t37_1))
|
|
1194
|
-
return false;
|
|
1195
|
-
if (!this.u37_1.equals(tmp0_other_with_cast.u37_1))
|
|
1196
|
-
return false;
|
|
1197
|
-
return true;
|
|
1198
|
-
};
|
|
1199
|
-
function BT2020TransferFunctions() {
|
|
1200
|
-
BT2020TransferFunctions_instance = this;
|
|
1201
|
-
this.y37_1 = 1.0993;
|
|
1202
|
-
this.z37_1 = 0.0181;
|
|
1203
|
-
var tmp = this;
|
|
1204
|
-
BT2020TransferFunctions_getInstance();
|
|
1205
|
-
// Inline function 'kotlin.math.pow' call
|
|
1206
|
-
BT2020TransferFunctions_getInstance();
|
|
1207
|
-
var tmp_0 = 1.0993 * Math.pow(0.0181, 0.45);
|
|
1208
|
-
BT2020TransferFunctions_getInstance();
|
|
1209
|
-
tmp.a38_1 = tmp_0 - (1.0993 - 1);
|
|
1210
|
-
}
|
|
1211
|
-
protoOf(BT2020TransferFunctions).k35 = function (x) {
|
|
1484
|
+
function RGBColorSpace$lambda($this$$receiver, color) {
|
|
1485
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1212
1486
|
var tmp;
|
|
1213
|
-
if (
|
|
1214
|
-
tmp =
|
|
1487
|
+
if (color instanceof RGB) {
|
|
1488
|
+
tmp = color.f2l($this$$receiver);
|
|
1215
1489
|
} else {
|
|
1216
|
-
|
|
1217
|
-
var tmp_0 = x + (1.0993 - 1);
|
|
1218
|
-
BT2020TransferFunctions_getInstance();
|
|
1219
|
-
tmp = spow_0(tmp_0 / 1.0993, 1 / 0.45);
|
|
1220
|
-
}
|
|
1221
|
-
return numberToDouble(tmp);
|
|
1222
|
-
};
|
|
1223
|
-
protoOf(BT2020TransferFunctions).l35 = function (x) {
|
|
1224
|
-
var tmp;
|
|
1225
|
-
var tmp_0 = x;
|
|
1226
|
-
BT2020TransferFunctions_getInstance();
|
|
1227
|
-
if (tmp_0 < 0.0181) {
|
|
1228
|
-
tmp = 4.5 * x;
|
|
1229
|
-
} else {
|
|
1230
|
-
BT2020TransferFunctions_getInstance();
|
|
1231
|
-
var tmp_1 = 1.0993 * spow(x, 0.45);
|
|
1232
|
-
BT2020TransferFunctions_getInstance();
|
|
1233
|
-
tmp = tmp_1 - (1.0993 - 1);
|
|
1490
|
+
tmp = color.g2i().l2l($this$$receiver);
|
|
1234
1491
|
}
|
|
1235
1492
|
return tmp;
|
|
1236
|
-
};
|
|
1237
|
-
var BT2020TransferFunctions_instance;
|
|
1238
|
-
function BT2020TransferFunctions_getInstance() {
|
|
1239
|
-
if (BT2020TransferFunctions_instance == null)
|
|
1240
|
-
new BT2020TransferFunctions();
|
|
1241
|
-
return BT2020TransferFunctions_instance;
|
|
1242
1493
|
}
|
|
1243
1494
|
var properties_initialized_RGBColorSpaces_kt_fsnpad;
|
|
1244
1495
|
function _init_properties_RGBColorSpaces_kt__nc9fsz() {
|
|
@@ -1258,13 +1509,22 @@
|
|
|
1258
1509
|
}
|
|
1259
1510
|
function Companion_3() {
|
|
1260
1511
|
Companion_instance_3 = this;
|
|
1261
|
-
this.
|
|
1512
|
+
this.s2m_1 = XYZColorSpaces_getInstance().t2m_1;
|
|
1262
1513
|
}
|
|
1263
|
-
protoOf(Companion_3).
|
|
1264
|
-
return this.
|
|
1514
|
+
protoOf(Companion_3).d2j = function () {
|
|
1515
|
+
return this.s2m_1.d2j();
|
|
1516
|
+
};
|
|
1517
|
+
protoOf(Companion_3).a2l = function () {
|
|
1518
|
+
return this.s2m_1.a2l();
|
|
1519
|
+
};
|
|
1520
|
+
protoOf(Companion_3).r2j = function (x, y, z, alpha) {
|
|
1521
|
+
return this.s2m_1.r2j(x, y, z, alpha);
|
|
1265
1522
|
};
|
|
1266
|
-
protoOf(Companion_3).
|
|
1267
|
-
return
|
|
1523
|
+
protoOf(Companion_3).hashCode = function () {
|
|
1524
|
+
return hashCode(XYZColorSpaces_getInstance().t2m_1);
|
|
1525
|
+
};
|
|
1526
|
+
protoOf(Companion_3).equals = function (other) {
|
|
1527
|
+
return equals(XYZColorSpaces_getInstance().t2m_1, other);
|
|
1268
1528
|
};
|
|
1269
1529
|
var Companion_instance_3;
|
|
1270
1530
|
function Companion_getInstance_3() {
|
|
@@ -1273,65 +1533,71 @@
|
|
|
1273
1533
|
return Companion_instance_3;
|
|
1274
1534
|
}
|
|
1275
1535
|
function adaptToM($this, space, m, mi) {
|
|
1276
|
-
if (space.
|
|
1536
|
+
if (space.a2l().equals($this.k2l_1.a2l()))
|
|
1277
1537
|
return $this;
|
|
1278
|
-
var transform = chromaticAdaptationMatrix(space, $this.
|
|
1538
|
+
var transform = chromaticAdaptationMatrix(space, $this.k2l_1.a2l().r2i_1, m, mi);
|
|
1279
1539
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1280
|
-
var v0 = $this.
|
|
1281
|
-
var v1 = $this.
|
|
1282
|
-
var v2 = $this.
|
|
1540
|
+
var v0 = $this.g2l_1;
|
|
1541
|
+
var v1 = $this.h2l_1;
|
|
1542
|
+
var v2 = $this.i2l_1;
|
|
1283
1543
|
// Inline function 'com.github.ajalt.colormath.model.XYZ.adaptToM.<anonymous>' call
|
|
1284
1544
|
var xx = Matrix__get_impl_xogbpk(transform, 0, 0) * v0 + Matrix__get_impl_xogbpk(transform, 1, 0) * v1 + Matrix__get_impl_xogbpk(transform, 2, 0) * v2;
|
|
1285
1545
|
var yy = Matrix__get_impl_xogbpk(transform, 0, 1) * v0 + Matrix__get_impl_xogbpk(transform, 1, 1) * v1 + Matrix__get_impl_xogbpk(transform, 2, 1) * v2;
|
|
1286
1546
|
var zz = Matrix__get_impl_xogbpk(transform, 0, 2) * v0 + Matrix__get_impl_xogbpk(transform, 1, 2) * v1 + Matrix__get_impl_xogbpk(transform, 2, 2) * v2;
|
|
1287
|
-
return space.
|
|
1547
|
+
return space.r2j(xx, yy, zz, $this.j2l_1);
|
|
1288
1548
|
}
|
|
1289
1549
|
function XYZ(x, y, z, alpha, space) {
|
|
1290
1550
|
Companion_getInstance_3();
|
|
1291
|
-
this.
|
|
1292
|
-
this.
|
|
1293
|
-
this.
|
|
1294
|
-
this.
|
|
1295
|
-
this.
|
|
1551
|
+
this.g2l_1 = x;
|
|
1552
|
+
this.h2l_1 = y;
|
|
1553
|
+
this.i2l_1 = z;
|
|
1554
|
+
this.j2l_1 = alpha;
|
|
1555
|
+
this.k2l_1 = space;
|
|
1296
1556
|
}
|
|
1297
|
-
protoOf(XYZ).
|
|
1557
|
+
protoOf(XYZ).e2i = function () {
|
|
1558
|
+
return this.k2l_1;
|
|
1559
|
+
};
|
|
1560
|
+
protoOf(XYZ).v2m = function (space) {
|
|
1298
1561
|
return adaptToM(this, space, get_CAT02_XYZ_TO_LMS(), get_CAT02_LMS_TO_XYZ());
|
|
1299
1562
|
};
|
|
1300
|
-
protoOf(XYZ).
|
|
1301
|
-
var tmp0_container = this.
|
|
1302
|
-
var x = tmp0_container.
|
|
1303
|
-
var y = tmp0_container.
|
|
1304
|
-
var z = tmp0_container.
|
|
1305
|
-
var f = space.
|
|
1563
|
+
protoOf(XYZ).l2l = function (space) {
|
|
1564
|
+
var tmp0_container = this.v2m(XYZColorSpace_0(space.a2l()));
|
|
1565
|
+
var x = tmp0_container.od();
|
|
1566
|
+
var y = tmp0_container.pd();
|
|
1567
|
+
var z = tmp0_container.ph();
|
|
1568
|
+
var f = space.k2k();
|
|
1306
1569
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1307
|
-
var this_0 = _Matrix___init__impl__q3kp4w(space.
|
|
1570
|
+
var this_0 = _Matrix___init__impl__q3kp4w(space.z2k());
|
|
1308
1571
|
// Inline function 'com.github.ajalt.colormath.model.XYZ.toRGB.<anonymous>' call
|
|
1309
1572
|
var r = Matrix__get_impl_xogbpk(this_0, 0, 0) * x + Matrix__get_impl_xogbpk(this_0, 1, 0) * y + Matrix__get_impl_xogbpk(this_0, 2, 0) * z;
|
|
1310
1573
|
var g = Matrix__get_impl_xogbpk(this_0, 0, 1) * x + Matrix__get_impl_xogbpk(this_0, 1, 1) * y + Matrix__get_impl_xogbpk(this_0, 2, 1) * z;
|
|
1311
1574
|
var b = Matrix__get_impl_xogbpk(this_0, 0, 2) * x + Matrix__get_impl_xogbpk(this_0, 1, 2) * y + Matrix__get_impl_xogbpk(this_0, 2, 2) * z;
|
|
1312
|
-
return space.
|
|
1575
|
+
return space.r2j(f.u2k(r), f.u2k(g), f.u2k(b), this.j2l_1);
|
|
1313
1576
|
};
|
|
1314
|
-
protoOf(XYZ).
|
|
1315
|
-
return this.
|
|
1577
|
+
protoOf(XYZ).f2i = function () {
|
|
1578
|
+
return this.l2l(RGBColorSpaces_getInstance().y2j_1);
|
|
1316
1579
|
};
|
|
1317
|
-
protoOf(XYZ).
|
|
1318
|
-
return this
|
|
1580
|
+
protoOf(XYZ).g2i = function () {
|
|
1581
|
+
return this;
|
|
1319
1582
|
};
|
|
1320
1583
|
protoOf(XYZ).od = function () {
|
|
1321
|
-
return this.
|
|
1584
|
+
return this.g2l_1;
|
|
1322
1585
|
};
|
|
1323
|
-
protoOf(XYZ).
|
|
1324
|
-
return this.
|
|
1586
|
+
protoOf(XYZ).pd = function () {
|
|
1587
|
+
return this.h2l_1;
|
|
1588
|
+
};
|
|
1589
|
+
protoOf(XYZ).ph = function () {
|
|
1590
|
+
return this.i2l_1;
|
|
1325
1591
|
};
|
|
1326
1592
|
protoOf(XYZ).toString = function () {
|
|
1327
|
-
return 'XYZ(x=' + this.
|
|
1593
|
+
return 'XYZ(x=' + this.g2l_1 + ', y=' + this.h2l_1 + ', z=' + this.i2l_1 + ', alpha=' + this.j2l_1 + ', space=' + toString(this.k2l_1) + ')';
|
|
1328
1594
|
};
|
|
1329
1595
|
protoOf(XYZ).hashCode = function () {
|
|
1330
|
-
var result = getNumberHashCode(this.
|
|
1331
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1332
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1333
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1334
|
-
result = imul(result, 31) + hashCode(this.
|
|
1596
|
+
var result = getNumberHashCode(this.g2l_1);
|
|
1597
|
+
result = imul(result, 31) + getNumberHashCode(this.h2l_1) | 0;
|
|
1598
|
+
result = imul(result, 31) + getNumberHashCode(this.i2l_1) | 0;
|
|
1599
|
+
result = imul(result, 31) + getNumberHashCode(this.j2l_1) | 0;
|
|
1600
|
+
result = imul(result, 31) + hashCode(this.k2l_1) | 0;
|
|
1335
1601
|
return result;
|
|
1336
1602
|
};
|
|
1337
1603
|
protoOf(XYZ).equals = function (other) {
|
|
@@ -1340,25 +1606,27 @@
|
|
|
1340
1606
|
if (!(other instanceof XYZ))
|
|
1341
1607
|
return false;
|
|
1342
1608
|
var tmp0_other_with_cast = other instanceof XYZ ? other : THROW_CCE();
|
|
1343
|
-
if (!equals(this.
|
|
1609
|
+
if (!equals(this.g2l_1, tmp0_other_with_cast.g2l_1))
|
|
1344
1610
|
return false;
|
|
1345
|
-
if (!equals(this.
|
|
1611
|
+
if (!equals(this.h2l_1, tmp0_other_with_cast.h2l_1))
|
|
1346
1612
|
return false;
|
|
1347
|
-
if (!equals(this.
|
|
1613
|
+
if (!equals(this.i2l_1, tmp0_other_with_cast.i2l_1))
|
|
1348
1614
|
return false;
|
|
1349
|
-
if (!equals(this.
|
|
1615
|
+
if (!equals(this.j2l_1, tmp0_other_with_cast.j2l_1))
|
|
1350
1616
|
return false;
|
|
1351
|
-
if (!equals(this.
|
|
1617
|
+
if (!equals(this.k2l_1, tmp0_other_with_cast.k2l_1))
|
|
1352
1618
|
return false;
|
|
1353
1619
|
return true;
|
|
1354
1620
|
};
|
|
1355
|
-
function XYZColorSpace(
|
|
1356
|
-
|
|
1621
|
+
function XYZColorSpace() {
|
|
1622
|
+
}
|
|
1623
|
+
function XYZColorSpace_0(whitePoint) {
|
|
1624
|
+
return whitePoint.equals(Illuminant_getInstance().x2i_1) ? XYZColorSpaces_getInstance().t2m_1 : whitePoint.equals(Illuminant_getInstance().v2i_1) ? XYZColorSpaces_getInstance().u2m_1 : new XYZColorSpaceImpl(whitePoint);
|
|
1357
1625
|
}
|
|
1358
1626
|
function XYZColorSpaces() {
|
|
1359
1627
|
XYZColorSpaces_instance = this;
|
|
1360
|
-
this.
|
|
1361
|
-
this.
|
|
1628
|
+
this.t2m_1 = new XYZColorSpaceImpl(Illuminant_getInstance().x2i_1);
|
|
1629
|
+
this.u2m_1 = new XYZColorSpaceImpl(Illuminant_getInstance().v2i_1);
|
|
1362
1630
|
}
|
|
1363
1631
|
var XYZColorSpaces_instance;
|
|
1364
1632
|
function XYZColorSpaces_getInstance() {
|
|
@@ -1369,36 +1637,38 @@
|
|
|
1369
1637
|
function chromaticAdaptationMatrix(_this__u8e3s4, srcWp, xyzToLms, lmsToXyz) {
|
|
1370
1638
|
xyzToLms = xyzToLms === VOID ? get_CAT02_XYZ_TO_LMS() : xyzToLms;
|
|
1371
1639
|
lmsToXyz = lmsToXyz === VOID ? get_CAT02_LMS_TO_XYZ() : lmsToXyz;
|
|
1372
|
-
var dstWp = _this__u8e3s4.
|
|
1373
|
-
var src = dot_0(xyzToLms, srcWp.
|
|
1374
|
-
var dst = dot_0(xyzToLms, dstWp.
|
|
1640
|
+
var dstWp = _this__u8e3s4.a2l().r2i_1;
|
|
1641
|
+
var src = dot_0(xyzToLms, srcWp.q2m(), srcWp.o2m_1, srcWp.r2m());
|
|
1642
|
+
var dst = dot_0(xyzToLms, dstWp.q2m(), dstWp.o2m_1, dstWp.r2m());
|
|
1375
1643
|
return dot(dotDiagonal(lmsToXyz, _Vector___get_l__impl__envr1l(dst) / _Vector___get_l__impl__envr1l(src), _Vector___get_m__impl__e5qq0m(dst) / _Vector___get_m__impl__e5qq0m(src), _Vector___get_s__impl__pzuljk(dst) / _Vector___get_s__impl__pzuljk(src)), xyzToLms);
|
|
1376
1644
|
}
|
|
1377
1645
|
function XYZColorSpaceImpl(whitePoint) {
|
|
1378
|
-
this.
|
|
1379
|
-
this.
|
|
1646
|
+
this.w2m_1 = whitePoint;
|
|
1647
|
+
this.x2m_1 = zeroOneComponentInfo('XYZ');
|
|
1380
1648
|
}
|
|
1381
|
-
protoOf(XYZColorSpaceImpl).
|
|
1382
|
-
return this.
|
|
1649
|
+
protoOf(XYZColorSpaceImpl).a2l = function () {
|
|
1650
|
+
return this.w2m_1;
|
|
1651
|
+
};
|
|
1652
|
+
protoOf(XYZColorSpaceImpl).d2j = function () {
|
|
1653
|
+
return this.x2m_1;
|
|
1383
1654
|
};
|
|
1384
1655
|
protoOf(XYZColorSpaceImpl).toString = function () {
|
|
1385
|
-
return 'XYZColorSpace(' + this.
|
|
1656
|
+
return 'XYZColorSpace(' + this.w2m_1.toString() + ')';
|
|
1386
1657
|
};
|
|
1387
|
-
protoOf(XYZColorSpaceImpl).
|
|
1658
|
+
protoOf(XYZColorSpaceImpl).r2j = function (x, y, z, alpha) {
|
|
1388
1659
|
return new XYZ(x, y, z, alpha, this);
|
|
1389
1660
|
};
|
|
1390
1661
|
protoOf(XYZColorSpaceImpl).hashCode = function () {
|
|
1391
|
-
return this.
|
|
1662
|
+
return this.w2m_1.hashCode();
|
|
1392
1663
|
};
|
|
1393
1664
|
protoOf(XYZColorSpaceImpl).equals = function (other) {
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
return true;
|
|
1665
|
+
var tmp;
|
|
1666
|
+
if (!(other == null) ? isInterface(other, XYZColorSpace) : false) {
|
|
1667
|
+
tmp = this.w2m_1.equals(other.a2l());
|
|
1668
|
+
} else {
|
|
1669
|
+
tmp = false;
|
|
1670
|
+
}
|
|
1671
|
+
return tmp;
|
|
1402
1672
|
};
|
|
1403
1673
|
function xyY_init_$Init$(x, y, Y, $this) {
|
|
1404
1674
|
Y = Y === VOID ? 1.0 : Y;
|
|
@@ -1410,26 +1680,26 @@
|
|
|
1410
1680
|
}
|
|
1411
1681
|
function xyY(x, y, Y) {
|
|
1412
1682
|
Y = Y === VOID ? 1.0 : Y;
|
|
1413
|
-
this.
|
|
1414
|
-
this.
|
|
1415
|
-
this.
|
|
1683
|
+
this.m2m_1 = x;
|
|
1684
|
+
this.n2m_1 = y;
|
|
1685
|
+
this.o2m_1 = Y;
|
|
1416
1686
|
}
|
|
1417
|
-
protoOf(xyY).
|
|
1418
|
-
return 1 - this.
|
|
1687
|
+
protoOf(xyY).p2m = function () {
|
|
1688
|
+
return 1 - this.m2m_1 - this.n2m_1;
|
|
1419
1689
|
};
|
|
1420
|
-
protoOf(xyY).
|
|
1421
|
-
return this.
|
|
1690
|
+
protoOf(xyY).q2m = function () {
|
|
1691
|
+
return this.m2m_1 * this.o2m_1 / this.n2m_1;
|
|
1422
1692
|
};
|
|
1423
|
-
protoOf(xyY).
|
|
1424
|
-
return (1 - this.
|
|
1693
|
+
protoOf(xyY).r2m = function () {
|
|
1694
|
+
return (1 - this.m2m_1 - this.n2m_1) * this.o2m_1 / this.n2m_1;
|
|
1425
1695
|
};
|
|
1426
1696
|
protoOf(xyY).toString = function () {
|
|
1427
|
-
return 'xyY(x=' + this.
|
|
1697
|
+
return 'xyY(x=' + this.m2m_1 + ', y=' + this.n2m_1 + ', Y=' + this.o2m_1 + ')';
|
|
1428
1698
|
};
|
|
1429
1699
|
protoOf(xyY).hashCode = function () {
|
|
1430
|
-
var result = getNumberHashCode(this.
|
|
1431
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1432
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1700
|
+
var result = getNumberHashCode(this.m2m_1);
|
|
1701
|
+
result = imul(result, 31) + getNumberHashCode(this.n2m_1) | 0;
|
|
1702
|
+
result = imul(result, 31) + getNumberHashCode(this.o2m_1) | 0;
|
|
1433
1703
|
return result;
|
|
1434
1704
|
};
|
|
1435
1705
|
protoOf(xyY).equals = function (other) {
|
|
@@ -1438,38 +1708,33 @@
|
|
|
1438
1708
|
if (!(other instanceof xyY))
|
|
1439
1709
|
return false;
|
|
1440
1710
|
var tmp0_other_with_cast = other instanceof xyY ? other : THROW_CCE();
|
|
1441
|
-
if (!equals(this.
|
|
1711
|
+
if (!equals(this.m2m_1, tmp0_other_with_cast.m2m_1))
|
|
1442
1712
|
return false;
|
|
1443
|
-
if (!equals(this.
|
|
1713
|
+
if (!equals(this.n2m_1, tmp0_other_with_cast.n2m_1))
|
|
1444
1714
|
return false;
|
|
1445
|
-
if (!equals(this.
|
|
1715
|
+
if (!equals(this.o2m_1, tmp0_other_with_cast.o2m_1))
|
|
1446
1716
|
return false;
|
|
1447
1717
|
return true;
|
|
1448
1718
|
};
|
|
1449
1719
|
//region block: post-declaration
|
|
1450
|
-
protoOf(
|
|
1451
|
-
protoOf(
|
|
1452
|
-
protoOf(
|
|
1453
|
-
protoOf(
|
|
1454
|
-
protoOf(
|
|
1455
|
-
protoOf(
|
|
1456
|
-
protoOf(SRGB).
|
|
1457
|
-
protoOf(SRGB).
|
|
1458
|
-
protoOf(SRGB).
|
|
1459
|
-
protoOf(
|
|
1460
|
-
protoOf(
|
|
1461
|
-
protoOf(
|
|
1462
|
-
protoOf(
|
|
1463
|
-
protoOf(
|
|
1464
|
-
protoOf(
|
|
1465
|
-
protoOf(RGBColorSpaceImpl).l34 = invoke$default;
|
|
1466
|
-
protoOf(RGBColorSpaceImpl).m35 = invoke;
|
|
1467
|
-
protoOf(RGBColorSpaceImpl).q34 = invoke$default_0;
|
|
1468
|
-
protoOf(RGBColorSpaceImpl).q29 = invoke_0;
|
|
1469
|
-
protoOf(RGBColorSpaceImpl).n35 = from255;
|
|
1470
|
-
protoOf(RGBColorSpaceImpl).m34 = from255$default;
|
|
1720
|
+
protoOf(Ansi16).g2i = toXYZ;
|
|
1721
|
+
protoOf(Ansi256).g2i = toXYZ;
|
|
1722
|
+
protoOf(HSV).g2i = toXYZ;
|
|
1723
|
+
protoOf(Companion_2).g2j = from255$default;
|
|
1724
|
+
protoOf(Companion_2).f2j = invoke$default;
|
|
1725
|
+
protoOf(Companion_2).k2j = invoke$default_0;
|
|
1726
|
+
protoOf(SRGB).g2j = from255$default;
|
|
1727
|
+
protoOf(SRGB).f2j = invoke$default;
|
|
1728
|
+
protoOf(SRGB).k2j = invoke$default_0;
|
|
1729
|
+
protoOf(RGBColorSpaceImpl).f2j = invoke$default;
|
|
1730
|
+
protoOf(RGBColorSpaceImpl).w2k = invoke;
|
|
1731
|
+
protoOf(RGBColorSpaceImpl).k2j = invoke$default_0;
|
|
1732
|
+
protoOf(RGBColorSpaceImpl).z2a = invoke_0;
|
|
1733
|
+
protoOf(RGBColorSpaceImpl).x2k = from255;
|
|
1734
|
+
protoOf(RGBColorSpaceImpl).g2j = from255$default;
|
|
1471
1735
|
//endregion
|
|
1472
1736
|
//region block: init
|
|
1737
|
+
PqNonlinearity_instance = new PqNonlinearity();
|
|
1473
1738
|
LinearTransferFunctions_instance = new LinearTransferFunctions();
|
|
1474
1739
|
SRGBTransferFunctions_instance = new SRGBTransferFunctions();
|
|
1475
1740
|
ROMMTransferFunctions_instance = new ROMMTransferFunctions();
|