@cruglobal/godtools-shared 0.8.3-SNAPSHOT.1104 → 0.8.3-SNAPSHOT.1110
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/88b0986a7186d029-atomicfu-js-ir.js +12 -12
- package/KustomExport-lib-coroutines.js +19 -0
- package/KustomExport-lib-coroutines.js.map +1 -0
- package/KustomExport-lib.js +30 -0
- package/KustomExport-lib.js.map +1 -0
- package/Napier-napier-js-ir.js +171 -5
- package/Napier-napier-js-ir.js.map +1 -1
- package/android-gto-support-gto-support-fluidsonic-locale.js +19 -5
- package/android-gto-support-gto-support-fluidsonic-locale.js.map +1 -1
- package/antlr-kotlin-antlr-kotlin-runtime-js-ir.js +9058 -5
- package/antlr-kotlin-antlr-kotlin-runtime-js-ir.js.map +1 -1
- package/colormath-root-colormath-js-ir.js +2177 -5
- package/colormath-root-colormath-js-ir.js.map +1 -1
- package/fluid-locale-js-ir.js +1293 -5
- package/fluid-locale-js-ir.js.map +1 -1
- package/kotlin-kotlin-stdlib-js-ir.js +6306 -1955
- package/kotlin-kotlin-stdlib-js-ir.js.map +1 -1
- package/kotlin-mpp-godtools-tool-parser-common.js +7 -0
- package/kotlin-mpp-godtools-tool-parser-common.js.map +1 -1
- package/kotlin-mpp-godtools-tool-parser-npm.d.ts +50 -0
- package/kotlin-mpp-godtools-tool-parser-parser-expressions.js +1260 -5
- package/kotlin-mpp-godtools-tool-parser-parser-expressions.js.map +1 -1
- package/kotlin-mpp-godtools-tool-parser-parser.js +9302 -121
- package/kotlin-mpp-godtools-tool-parser-parser.js.map +1 -1
- package/kotlin-mpp-godtools-tool-parser-state.js +239 -239
- package/kotlin-mpp-godtools-tool-parser-state.js.map +1 -1
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js +2398 -1943
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,2185 @@
|
|
|
1
1
|
(function (root, factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports'], factory);
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib-js-ir.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports);
|
|
6
|
-
else
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'));
|
|
6
|
+
else {
|
|
7
|
+
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
|
|
8
|
+
throw new Error("Error loading module 'colormath-root-colormath-js-ir'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'colormath-root-colormath-js-ir'.");
|
|
9
|
+
}
|
|
10
|
+
root['colormath-root-colormath-js-ir'] = factory(typeof this['colormath-root-colormath-js-ir'] === 'undefined' ? {} : this['colormath-root-colormath-js-ir'], this['kotlin-kotlin-stdlib-js-ir']);
|
|
11
|
+
}
|
|
12
|
+
}(this, function (_, kotlin_kotlin) {
|
|
9
13
|
'use strict';
|
|
14
|
+
//region block: imports
|
|
15
|
+
var imul = Math.imul;
|
|
16
|
+
var log2 = Math.log2;
|
|
17
|
+
var protoOf = kotlin_kotlin.$_$.e6;
|
|
18
|
+
var interfaceMeta = kotlin_kotlin.$_$.s5;
|
|
19
|
+
var VOID = kotlin_kotlin.$_$.a9;
|
|
20
|
+
var setMetadataFor = kotlin_kotlin.$_$.f6;
|
|
21
|
+
var classMeta = kotlin_kotlin.$_$.j5;
|
|
22
|
+
var Unit_getInstance = kotlin_kotlin.$_$.i2;
|
|
23
|
+
var Enum = kotlin_kotlin.$_$.a8;
|
|
24
|
+
var equals = kotlin_kotlin.$_$.m5;
|
|
25
|
+
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.q;
|
|
26
|
+
var dropLast = kotlin_kotlin.$_$.a3;
|
|
27
|
+
var joinTo = kotlin_kotlin.$_$.o3;
|
|
28
|
+
var Regex_init_$Create$ = kotlin_kotlin.$_$.o;
|
|
29
|
+
var UByte__toString_impl_v72jg = kotlin_kotlin.$_$.x1;
|
|
30
|
+
var roundToInt = kotlin_kotlin.$_$.k6;
|
|
31
|
+
var startsWith = kotlin_kotlin.$_$.j7;
|
|
32
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.o1;
|
|
33
|
+
var indexOf = kotlin_kotlin.$_$.c7;
|
|
34
|
+
var take = kotlin_kotlin.$_$.l7;
|
|
35
|
+
var charArrayOf = kotlin_kotlin.$_$.g5;
|
|
36
|
+
var trimEnd = kotlin_kotlin.$_$.v7;
|
|
37
|
+
var noWhenBranchMatchedException = kotlin_kotlin.$_$.u8;
|
|
38
|
+
var isNaN_0 = kotlin_kotlin.$_$.s8;
|
|
39
|
+
var joinTo_0 = kotlin_kotlin.$_$.n3;
|
|
40
|
+
var getStringHashCode = kotlin_kotlin.$_$.q5;
|
|
41
|
+
var THROW_CCE = kotlin_kotlin.$_$.l8;
|
|
42
|
+
var objectMeta = kotlin_kotlin.$_$.d6;
|
|
43
|
+
var charSequenceLength = kotlin_kotlin.$_$.i5;
|
|
44
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.c;
|
|
45
|
+
var charSequenceGet = kotlin_kotlin.$_$.h5;
|
|
46
|
+
var toString = kotlin_kotlin.$_$.s1;
|
|
47
|
+
var copyToArray = kotlin_kotlin.$_$.z2;
|
|
48
|
+
var Char = kotlin_kotlin.$_$.x7;
|
|
49
|
+
var plus = kotlin_kotlin.$_$.v3;
|
|
50
|
+
var asList = kotlin_kotlin.$_$.r2;
|
|
51
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.t2;
|
|
52
|
+
var withSign = kotlin_kotlin.$_$.l6;
|
|
53
|
+
var get_PI = kotlin_kotlin.$_$.j6;
|
|
54
|
+
var coerceAtLeast = kotlin_kotlin.$_$.m6;
|
|
55
|
+
var FloatCompanionObject_getInstance = kotlin_kotlin.$_$.c2;
|
|
56
|
+
var getNumberHashCode = kotlin_kotlin.$_$.o5;
|
|
57
|
+
var hashCode = kotlin_kotlin.$_$.r5;
|
|
58
|
+
var numberToDouble = kotlin_kotlin.$_$.a6;
|
|
59
|
+
var isInterface = kotlin_kotlin.$_$.v5;
|
|
60
|
+
var coerceAtLeast_0 = kotlin_kotlin.$_$.o6;
|
|
61
|
+
var _UInt___init__impl__l7qpdl = kotlin_kotlin.$_$.y1;
|
|
62
|
+
var _UInt___get_data__impl__f0vqqw = kotlin_kotlin.$_$.z1;
|
|
63
|
+
var coerceIn = kotlin_kotlin.$_$.p6;
|
|
64
|
+
var toByte = kotlin_kotlin.$_$.g6;
|
|
65
|
+
var _UByte___init__impl__g9hnc4 = kotlin_kotlin.$_$.w1;
|
|
66
|
+
var objectCreate = kotlin_kotlin.$_$.c6;
|
|
67
|
+
var isNumber = kotlin_kotlin.$_$.w5;
|
|
68
|
+
//endregion
|
|
10
69
|
//region block: pre-declaration
|
|
70
|
+
function toXYZ() {
|
|
71
|
+
return this.v2d().w2d();
|
|
72
|
+
}
|
|
73
|
+
function toLAB() {
|
|
74
|
+
return this.w2d().c2e();
|
|
75
|
+
}
|
|
76
|
+
function toLCHab() {
|
|
77
|
+
return this.c2e().i2e();
|
|
78
|
+
}
|
|
79
|
+
setMetadataFor(Color, 'Color', interfaceMeta);
|
|
80
|
+
setMetadataFor(WhitePointColorSpace, 'WhitePointColorSpace', interfaceMeta);
|
|
81
|
+
setMetadataFor(ColorComponentInfo, 'ColorComponentInfo', classMeta);
|
|
82
|
+
setMetadataFor(RenderCondition, 'RenderCondition', classMeta, Enum);
|
|
83
|
+
setMetadataFor(AngleUnit, 'AngleUnit', classMeta, Enum);
|
|
84
|
+
setMetadataFor(WhitePoint, 'WhitePoint', classMeta);
|
|
85
|
+
setMetadataFor(Illuminant, 'Illuminant', objectMeta);
|
|
86
|
+
setMetadataFor(HSL, 'HSL', classMeta, VOID, [Color]);
|
|
87
|
+
setMetadataFor(HWB, 'HWB', classMeta, VOID, [Color]);
|
|
88
|
+
setMetadataFor(ICtCp, 'ICtCp', classMeta, VOID, [Color]);
|
|
89
|
+
setMetadataFor(PqNonlinearity, 'PqNonlinearity', objectMeta);
|
|
90
|
+
function invoke(l, a, b, alpha) {
|
|
91
|
+
return this.x2g(numberToDouble(l), numberToDouble(a), numberToDouble(b), numberToDouble(alpha));
|
|
92
|
+
}
|
|
93
|
+
setMetadataFor(LABColorSpace, 'LABColorSpace', interfaceMeta, VOID, [WhitePointColorSpace]);
|
|
94
|
+
setMetadataFor(Companion, 'Companion', objectMeta, VOID, [LABColorSpace]);
|
|
95
|
+
setMetadataFor(LAB, 'LAB', classMeta, VOID, [Color]);
|
|
96
|
+
setMetadataFor(LABColorSpaces, 'LABColorSpaces', objectMeta);
|
|
97
|
+
setMetadataFor(LABColorSpaceImpl, 'LABColorSpaceImpl', classMeta, VOID, [LABColorSpace]);
|
|
98
|
+
setMetadataFor(Companion_0, 'Companion', objectMeta, VOID, [WhitePointColorSpace]);
|
|
99
|
+
setMetadataFor(LCHab, 'LCHab', classMeta, VOID, [Color]);
|
|
100
|
+
setMetadataFor(LCHabColorSpaces, 'LCHabColorSpaces', objectMeta);
|
|
101
|
+
setMetadataFor(LCHabColorSpaceImpl, 'LCHabColorSpaceImpl', classMeta, VOID, [WhitePointColorSpace]);
|
|
102
|
+
setMetadataFor(GammaTransferFunctions, 'GammaTransferFunctions', classMeta);
|
|
103
|
+
setMetadataFor(LinearTransferFunctions, 'LinearTransferFunctions', objectMeta);
|
|
104
|
+
function invoke_0(r, g, b, alpha) {
|
|
105
|
+
return this.x2g(numberToDouble(r), numberToDouble(g), numberToDouble(b), numberToDouble(alpha));
|
|
106
|
+
}
|
|
107
|
+
setMetadataFor(RGBColorSpace, 'RGBColorSpace', interfaceMeta, VOID, [WhitePointColorSpace]);
|
|
108
|
+
setMetadataFor(Companion_1, 'Companion', objectMeta, VOID, [RGBColorSpace]);
|
|
109
|
+
setMetadataFor(RGB, 'RGB', classMeta, VOID, [Color]);
|
|
110
|
+
setMetadataFor(RGBColorSpaces, 'RGBColorSpaces', objectMeta);
|
|
111
|
+
setMetadataFor(SRGB, 'SRGB', objectMeta, VOID, [RGBColorSpace]);
|
|
112
|
+
setMetadataFor(ACESccTransferFunctions, 'ACESccTransferFunctions', objectMeta);
|
|
113
|
+
setMetadataFor(ACEScctTransferFunctions, 'ACEScctTransferFunctions', objectMeta);
|
|
114
|
+
setMetadataFor(BT2020Space, 'BT2020Space', objectMeta, VOID, [RGBColorSpace]);
|
|
115
|
+
setMetadataFor(BT709TransferFunctions, 'BT709TransferFunctions', objectMeta);
|
|
116
|
+
setMetadataFor(SRGBTransferFunctions, 'SRGBTransferFunctions', objectMeta);
|
|
117
|
+
setMetadataFor(ROMMTransferFunctions, 'ROMMTransferFunctions', objectMeta);
|
|
118
|
+
setMetadataFor(RGBColorSpaceImpl, 'RGBColorSpaceImpl', classMeta, VOID, [RGBColorSpace]);
|
|
119
|
+
setMetadataFor(BT2020TransferFunctions, 'BT2020TransferFunctions', objectMeta);
|
|
120
|
+
function invoke_1(x, y, z, alpha) {
|
|
121
|
+
return this.x2g(numberToDouble(x), numberToDouble(y), numberToDouble(z), numberToDouble(alpha));
|
|
122
|
+
}
|
|
123
|
+
function invoke$default(x, y, z, alpha, $super) {
|
|
124
|
+
alpha = alpha === VOID ? 1.0 : alpha;
|
|
125
|
+
return $super === VOID ? this.z2g(x, y, z, alpha) : invoke_1(x, y, z, alpha);
|
|
126
|
+
}
|
|
127
|
+
setMetadataFor(XYZColorSpace, 'XYZColorSpace', interfaceMeta, VOID, [WhitePointColorSpace]);
|
|
128
|
+
setMetadataFor(Companion_2, 'Companion', objectMeta, VOID, [XYZColorSpace]);
|
|
129
|
+
setMetadataFor(XYZ, 'XYZ', classMeta, VOID, [Color]);
|
|
130
|
+
setMetadataFor(XYZColorSpaces, 'XYZColorSpaces', objectMeta);
|
|
131
|
+
setMetadataFor(XYZColorSpaceImpl, 'XYZColorSpaceImpl', classMeta, VOID, [XYZColorSpace]);
|
|
132
|
+
setMetadataFor(xyY, 'xyY', classMeta);
|
|
133
|
+
//endregion
|
|
134
|
+
function Color() {
|
|
135
|
+
}
|
|
136
|
+
function convertTo(_this__u8e3s4, space) {
|
|
137
|
+
return space.o2e(_this__u8e3s4);
|
|
138
|
+
}
|
|
139
|
+
function WhitePointColorSpace() {
|
|
140
|
+
}
|
|
141
|
+
function ColorComponentInfo(name, isPolar) {
|
|
142
|
+
this.q2e_1 = name;
|
|
143
|
+
this.r2e_1 = isPolar;
|
|
144
|
+
}
|
|
145
|
+
var RenderCondition_ALWAYS_instance;
|
|
146
|
+
var RenderCondition_NEVER_instance;
|
|
147
|
+
var RenderCondition_AUTO_instance;
|
|
148
|
+
var RenderCondition_entriesInitialized;
|
|
149
|
+
function RenderCondition_initEntries() {
|
|
150
|
+
if (RenderCondition_entriesInitialized)
|
|
151
|
+
return Unit_getInstance();
|
|
152
|
+
RenderCondition_entriesInitialized = true;
|
|
153
|
+
RenderCondition_ALWAYS_instance = new RenderCondition('ALWAYS', 0);
|
|
154
|
+
RenderCondition_NEVER_instance = new RenderCondition('NEVER', 1);
|
|
155
|
+
RenderCondition_AUTO_instance = new RenderCondition('AUTO', 2);
|
|
156
|
+
}
|
|
157
|
+
function RenderCondition(name, ordinal) {
|
|
158
|
+
Enum.call(this, name, ordinal);
|
|
159
|
+
}
|
|
160
|
+
function formatCssString(_this__u8e3s4, hueUnit, renderAlpha, unitsPercent, alphaPercent, legacyName, legacyFormat) {
|
|
161
|
+
hueUnit = hueUnit === VOID ? AngleUnit_AUTO_getInstance() : hueUnit;
|
|
162
|
+
renderAlpha = renderAlpha === VOID ? RenderCondition_AUTO_getInstance() : renderAlpha;
|
|
163
|
+
unitsPercent = unitsPercent === VOID ? false : unitsPercent;
|
|
164
|
+
alphaPercent = alphaPercent === VOID ? false : alphaPercent;
|
|
165
|
+
legacyName = legacyName === VOID ? false : legacyName;
|
|
166
|
+
legacyFormat = legacyFormat === VOID ? false : legacyFormat;
|
|
167
|
+
var tmp0_elvis_lhs = formatCssStringOrNull(_this__u8e3s4, hueUnit, renderAlpha, unitsPercent, alphaPercent, legacyName, legacyFormat);
|
|
168
|
+
return tmp0_elvis_lhs == null ? renderColorFunction(_this__u8e3s4, get_dashName(_this__u8e3s4), unitsPercent, alphaPercent, renderAlpha) : tmp0_elvis_lhs;
|
|
169
|
+
}
|
|
170
|
+
var AngleUnit_AUTO_instance;
|
|
171
|
+
var AngleUnit_DEGREES_instance;
|
|
172
|
+
var AngleUnit_RADIANS_instance;
|
|
173
|
+
var AngleUnit_GRADIANS_instance;
|
|
174
|
+
var AngleUnit_TURNS_instance;
|
|
175
|
+
var AngleUnit_entriesInitialized;
|
|
176
|
+
function AngleUnit_initEntries() {
|
|
177
|
+
if (AngleUnit_entriesInitialized)
|
|
178
|
+
return Unit_getInstance();
|
|
179
|
+
AngleUnit_entriesInitialized = true;
|
|
180
|
+
AngleUnit_AUTO_instance = new AngleUnit('AUTO', 0);
|
|
181
|
+
AngleUnit_DEGREES_instance = new AngleUnit('DEGREES', 1);
|
|
182
|
+
AngleUnit_RADIANS_instance = new AngleUnit('RADIANS', 2);
|
|
183
|
+
AngleUnit_GRADIANS_instance = new AngleUnit('GRADIANS', 3);
|
|
184
|
+
AngleUnit_TURNS_instance = new AngleUnit('TURNS', 4);
|
|
185
|
+
}
|
|
186
|
+
function AngleUnit(name, ordinal) {
|
|
187
|
+
Enum.call(this, name, ordinal);
|
|
188
|
+
}
|
|
189
|
+
function formatCssStringOrNull(_this__u8e3s4, hueUnit, renderAlpha, unitsPercent, alphaPercent, legacyName, legacyFormat) {
|
|
190
|
+
hueUnit = hueUnit === VOID ? AngleUnit_AUTO_getInstance() : hueUnit;
|
|
191
|
+
renderAlpha = renderAlpha === VOID ? RenderCondition_AUTO_getInstance() : renderAlpha;
|
|
192
|
+
unitsPercent = unitsPercent === VOID ? false : unitsPercent;
|
|
193
|
+
alphaPercent = alphaPercent === VOID ? false : alphaPercent;
|
|
194
|
+
legacyName = legacyName === VOID ? false : legacyName;
|
|
195
|
+
legacyFormat = legacyFormat === VOID ? false : legacyFormat;
|
|
196
|
+
var tmp0_subject = _this__u8e3s4;
|
|
197
|
+
var tmp;
|
|
198
|
+
if (tmp0_subject instanceof RGB) {
|
|
199
|
+
var tmp1_subject = _this__u8e3s4.b2e_1;
|
|
200
|
+
tmp = equals(tmp1_subject, SRGB_getInstance()) ? renderSRGB(_this__u8e3s4, legacyFormat, legacyName, unitsPercent, alphaPercent, renderAlpha) : equals(tmp1_subject, RGBColorSpaces_getInstance().j2f_1) ? renderColorFunction(_this__u8e3s4, 'display-p3', unitsPercent, alphaPercent, renderAlpha) : equals(tmp1_subject, RGBColorSpaces_getInstance().f2f_1) ? renderColorFunction(_this__u8e3s4, 'a98-rgb', unitsPercent, alphaPercent, renderAlpha) : equals(tmp1_subject, RGBColorSpaces_getInstance().k2f_1) ? renderColorFunction(_this__u8e3s4, 'prophoto-rgb', unitsPercent, alphaPercent, renderAlpha) : equals(tmp1_subject, RGBColorSpaces_getInstance().g2f_1) ? renderColorFunction(_this__u8e3s4, 'rec2020', unitsPercent, alphaPercent, renderAlpha) : null;
|
|
201
|
+
} else {
|
|
202
|
+
if (tmp0_subject instanceof HSL) {
|
|
203
|
+
tmp = renderHsl(_this__u8e3s4, legacyFormat, legacyName, hueUnit, alphaPercent, renderAlpha);
|
|
204
|
+
} else {
|
|
205
|
+
if (tmp0_subject instanceof LAB) {
|
|
206
|
+
tmp = renderLab(convertTo(_this__u8e3s4, LABColorSpaces_getInstance().y2e_1), alphaPercent, renderAlpha);
|
|
207
|
+
} else {
|
|
208
|
+
if (tmp0_subject instanceof LCHab) {
|
|
209
|
+
tmp = renderLCH(convertTo(_this__u8e3s4, LCHabColorSpaces_getInstance().w2e_1), hueUnit, alphaPercent, renderAlpha);
|
|
210
|
+
} else {
|
|
211
|
+
if (tmp0_subject instanceof HWB) {
|
|
212
|
+
tmp = renderHWB(_this__u8e3s4, hueUnit, alphaPercent, renderAlpha);
|
|
213
|
+
} else {
|
|
214
|
+
if (tmp0_subject instanceof XYZ) {
|
|
215
|
+
tmp = renderColorFunction(_this__u8e3s4.u2e(XYZColorSpaces_getInstance().t2e_1), 'xyz', unitsPercent, alphaPercent, renderAlpha);
|
|
216
|
+
} else {
|
|
217
|
+
tmp = null;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return tmp;
|
|
225
|
+
}
|
|
226
|
+
function renderColorFunction(_this__u8e3s4, name, unitsPercent, alphaPercent, renderAlpha_0) {
|
|
227
|
+
var tmp$ret$1;
|
|
228
|
+
// Inline function 'kotlin.text.buildString' call
|
|
229
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
230
|
+
var tmp$ret$0;
|
|
231
|
+
// Inline function 'kotlin.apply' call
|
|
232
|
+
var tmp0_apply = StringBuilder_init_$Create$();
|
|
233
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
234
|
+
// Inline function 'com.github.ajalt.colormath.renderColorFunction.<anonymous>' call
|
|
235
|
+
tmp0_apply.ib('color(').ib(name).ib(' ');
|
|
236
|
+
var tmp = dropLast(_this__u8e3s4.v7(), 1);
|
|
237
|
+
joinTo(tmp, tmp0_apply, ' ', VOID, VOID, VOID, VOID, renderColorFunction$lambda(unitsPercent));
|
|
238
|
+
tmp0_apply.ib(renderAlpha(_this__u8e3s4, false, renderAlpha_0, alphaPercent));
|
|
239
|
+
tmp0_apply.ib(')');
|
|
240
|
+
tmp$ret$0 = tmp0_apply;
|
|
241
|
+
tmp$ret$1 = tmp$ret$0.toString();
|
|
242
|
+
return tmp$ret$1;
|
|
243
|
+
}
|
|
244
|
+
function get_dashName(_this__u8e3s4) {
|
|
245
|
+
var tmp$ret$2;
|
|
246
|
+
// Inline function 'kotlin.text.lowercase' call
|
|
247
|
+
var tmp$ret$0;
|
|
248
|
+
// Inline function 'kotlin.text.replace' call
|
|
249
|
+
var tmp0_replace = _this__u8e3s4.u2d().l2f();
|
|
250
|
+
var tmp1_replace = Regex_init_$Create$('\\W');
|
|
251
|
+
tmp$ret$0 = tmp1_replace.ac(tmp0_replace, '-');
|
|
252
|
+
var tmp2_lowercase = tmp$ret$0;
|
|
253
|
+
var tmp$ret$1;
|
|
254
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
255
|
+
tmp$ret$1 = tmp2_lowercase;
|
|
256
|
+
tmp$ret$2 = tmp$ret$1.toLowerCase();
|
|
257
|
+
return '--' + tmp$ret$2;
|
|
258
|
+
}
|
|
259
|
+
function renderSRGB(_this__u8e3s4, commas, namedRgba, rgbPercent, alphaPercent, renderAlpha) {
|
|
260
|
+
return renderFunction(_this__u8e3s4, namedRgba ? 'rgba' : 'rgb', [rgbPercent ? render(_this__u8e3s4.x2d_1, true) : UByte__toString_impl_v72jg(_RGBInt___get_r__impl__dulq0e(_this__u8e3s4.m2f())), rgbPercent ? render(_this__u8e3s4.y2d_1, true) : UByte__toString_impl_v72jg(_RGBInt___get_g__impl__o93c71(_this__u8e3s4.m2f())), rgbPercent ? render(_this__u8e3s4.z2d_1, true) : UByte__toString_impl_v72jg(_RGBInt___get_b__impl__m772ua(_this__u8e3s4.m2f()))], alphaPercent, renderAlpha, commas);
|
|
261
|
+
}
|
|
262
|
+
function renderHsl(_this__u8e3s4, commas, namedHsla, hueUnit, alphaPercent, renderAlpha) {
|
|
263
|
+
return renderFunction(_this__u8e3s4, namedHsla ? 'hsla' : 'hsl', [renderHue(_this__u8e3s4, hueUnit), render(_this__u8e3s4.n2f_1, true), render(_this__u8e3s4.o2f_1, true)], alphaPercent, renderAlpha, commas);
|
|
264
|
+
}
|
|
265
|
+
function renderLab(_this__u8e3s4, alphaPercent, renderAlpha) {
|
|
266
|
+
return renderFunction(_this__u8e3s4, 'lab', [render(_this__u8e3s4.j2e_1 / 100, true), render(_this__u8e3s4.k2e_1), render(_this__u8e3s4.l2e_1)], alphaPercent, renderAlpha);
|
|
267
|
+
}
|
|
268
|
+
function renderLCH(_this__u8e3s4, hueUnit, alphaPercent, renderAlpha) {
|
|
269
|
+
return renderFunction(_this__u8e3s4, 'lch', [render(_this__u8e3s4.p2f_1 / 100, true), render(_this__u8e3s4.q2f_1), renderHue(_this__u8e3s4, hueUnit)], alphaPercent, renderAlpha);
|
|
270
|
+
}
|
|
271
|
+
function renderHWB(_this__u8e3s4, hueUnit, alphaPercent, renderAlpha) {
|
|
272
|
+
return renderFunction(_this__u8e3s4, 'hwb', [renderHue(_this__u8e3s4, hueUnit), render(_this__u8e3s4.u2f_1, true), render(_this__u8e3s4.v2f_1, true)], alphaPercent, renderAlpha);
|
|
273
|
+
}
|
|
274
|
+
function render(_this__u8e3s4, percent) {
|
|
275
|
+
percent = percent === VOID ? false : percent;
|
|
276
|
+
var tmp0_subject = percent;
|
|
277
|
+
var tmp;
|
|
278
|
+
switch (tmp0_subject) {
|
|
279
|
+
case true:
|
|
280
|
+
var tmp$ret$0;
|
|
281
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
282
|
+
var tmp0_roundToInt = _this__u8e3s4 * 100;
|
|
283
|
+
tmp$ret$0 = roundToInt(tmp0_roundToInt);
|
|
284
|
+
|
|
285
|
+
tmp = '' + tmp$ret$0 + '%';
|
|
286
|
+
break;
|
|
287
|
+
case false:
|
|
288
|
+
var tmp1_subject = _this__u8e3s4;
|
|
289
|
+
var tmp_0;
|
|
290
|
+
switch (tmp1_subject) {
|
|
291
|
+
case 0.0:
|
|
292
|
+
tmp_0 = '0';
|
|
293
|
+
break;
|
|
294
|
+
case 1.0:
|
|
295
|
+
tmp_0 = '1';
|
|
296
|
+
break;
|
|
297
|
+
default:
|
|
298
|
+
var str = _this__u8e3s4.toString();
|
|
299
|
+
var s = startsWith(str, '.') ? '0' + str : str;
|
|
300
|
+
var i = indexOf(s, _Char___init__impl__6a9atx(46));
|
|
301
|
+
tmp_0 = i < 0 ? s : trimEnd(trimEnd(take(s, i + 5 | 0), charArrayOf([_Char___init__impl__6a9atx(48)])), charArrayOf([_Char___init__impl__6a9atx(46)]));
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
tmp = tmp_0;
|
|
306
|
+
break;
|
|
307
|
+
default:
|
|
308
|
+
noWhenBranchMatchedException();
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
return tmp;
|
|
312
|
+
}
|
|
313
|
+
function renderAlpha(_this__u8e3s4, commas, renderAlpha, alphaPercent) {
|
|
314
|
+
var tmp;
|
|
315
|
+
if (renderAlpha.equals(RenderCondition_ALWAYS_getInstance()) ? true : (renderAlpha.equals(RenderCondition_AUTO_getInstance()) ? !isNaN_0(_this__u8e3s4.t2d()) : false) ? !(_this__u8e3s4.t2d() === 1.0) : false) {
|
|
316
|
+
tmp = (commas ? ', ' : ' / ') + render(nanToOne(_this__u8e3s4.t2d()), alphaPercent);
|
|
317
|
+
} else {
|
|
318
|
+
tmp = '';
|
|
319
|
+
}
|
|
320
|
+
return tmp;
|
|
321
|
+
}
|
|
322
|
+
function renderFunction(_this__u8e3s4, name, components, alphaPercent, renderAlpha_0, commas) {
|
|
323
|
+
commas = commas === VOID ? false : commas;
|
|
324
|
+
var tmp$ret$1;
|
|
325
|
+
// Inline function 'kotlin.text.buildString' call
|
|
326
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
327
|
+
var tmp$ret$0;
|
|
328
|
+
// Inline function 'kotlin.apply' call
|
|
329
|
+
var tmp0_apply = StringBuilder_init_$Create$();
|
|
330
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
331
|
+
// Inline function 'com.github.ajalt.colormath.renderFunction.<anonymous>' call
|
|
332
|
+
var sep = commas ? ', ' : ' ';
|
|
333
|
+
tmp0_apply.ib(name).ib('(');
|
|
334
|
+
joinTo_0(components, tmp0_apply, sep);
|
|
335
|
+
tmp0_apply.ib(renderAlpha(_this__u8e3s4, commas, renderAlpha_0, alphaPercent));
|
|
336
|
+
tmp0_apply.ib(')');
|
|
337
|
+
tmp$ret$0 = tmp0_apply;
|
|
338
|
+
tmp$ret$1 = tmp$ret$0.toString();
|
|
339
|
+
return tmp$ret$1;
|
|
340
|
+
}
|
|
341
|
+
function renderHue(_this__u8e3s4, hueUnit) {
|
|
342
|
+
var tmp0_subject = hueUnit;
|
|
343
|
+
var tmp0 = tmp0_subject.d4_1;
|
|
344
|
+
var tmp;
|
|
345
|
+
switch (tmp0) {
|
|
346
|
+
case 0:
|
|
347
|
+
tmp = render(_this__u8e3s4.w2f());
|
|
348
|
+
break;
|
|
349
|
+
case 1:
|
|
350
|
+
tmp = render(_this__u8e3s4.w2f()) + 'deg';
|
|
351
|
+
break;
|
|
352
|
+
case 2:
|
|
353
|
+
tmp = render(hueAsRad(_this__u8e3s4)) + 'rad';
|
|
354
|
+
break;
|
|
355
|
+
case 3:
|
|
356
|
+
tmp = render(hueAsGrad(_this__u8e3s4)) + 'grad';
|
|
357
|
+
break;
|
|
358
|
+
case 4:
|
|
359
|
+
tmp = render(hueAsTurns(_this__u8e3s4)) + 'turn';
|
|
360
|
+
break;
|
|
361
|
+
default:
|
|
362
|
+
noWhenBranchMatchedException();
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
return tmp;
|
|
366
|
+
}
|
|
367
|
+
function renderColorFunction$lambda($unitsPercent) {
|
|
368
|
+
return function (it) {
|
|
369
|
+
return render(it, $unitsPercent);
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function RenderCondition_ALWAYS_getInstance() {
|
|
373
|
+
RenderCondition_initEntries();
|
|
374
|
+
return RenderCondition_ALWAYS_instance;
|
|
375
|
+
}
|
|
376
|
+
function RenderCondition_AUTO_getInstance() {
|
|
377
|
+
RenderCondition_initEntries();
|
|
378
|
+
return RenderCondition_AUTO_instance;
|
|
379
|
+
}
|
|
380
|
+
function AngleUnit_AUTO_getInstance() {
|
|
381
|
+
AngleUnit_initEntries();
|
|
382
|
+
return AngleUnit_AUTO_instance;
|
|
383
|
+
}
|
|
384
|
+
function hueAsRad(_this__u8e3s4) {
|
|
385
|
+
return degToRad(_this__u8e3s4.w2f());
|
|
386
|
+
}
|
|
387
|
+
function hueAsGrad(_this__u8e3s4) {
|
|
388
|
+
return degToGrad(_this__u8e3s4.w2f());
|
|
389
|
+
}
|
|
390
|
+
function hueAsTurns(_this__u8e3s4) {
|
|
391
|
+
return degToTurns(_this__u8e3s4.w2f());
|
|
392
|
+
}
|
|
393
|
+
function WhitePoint(name, chromaticity) {
|
|
394
|
+
this.x2f_1 = name;
|
|
395
|
+
this.y2f_1 = chromaticity;
|
|
396
|
+
}
|
|
397
|
+
protoOf(WhitePoint).toString = function () {
|
|
398
|
+
return this.x2f_1;
|
|
399
|
+
};
|
|
400
|
+
protoOf(WhitePoint).hashCode = function () {
|
|
401
|
+
var result = getStringHashCode(this.x2f_1);
|
|
402
|
+
result = imul(result, 31) + this.y2f_1.hashCode() | 0;
|
|
403
|
+
return result;
|
|
404
|
+
};
|
|
405
|
+
protoOf(WhitePoint).equals = function (other) {
|
|
406
|
+
if (this === other)
|
|
407
|
+
return true;
|
|
408
|
+
if (!(other instanceof WhitePoint))
|
|
409
|
+
return false;
|
|
410
|
+
var tmp0_other_with_cast = other instanceof WhitePoint ? other : THROW_CCE();
|
|
411
|
+
if (!(this.x2f_1 === tmp0_other_with_cast.x2f_1))
|
|
412
|
+
return false;
|
|
413
|
+
if (!this.y2f_1.equals(tmp0_other_with_cast.y2f_1))
|
|
414
|
+
return false;
|
|
415
|
+
return true;
|
|
416
|
+
};
|
|
417
|
+
function Illuminant() {
|
|
418
|
+
Illuminant_instance = this;
|
|
419
|
+
this.z2f_1 = new WhitePoint('A', xyY_init_$Create$(0.44758, 0.40745));
|
|
420
|
+
this.a2g_1 = new WhitePoint('B', xyY_init_$Create$(0.34842, 0.35161));
|
|
421
|
+
this.b2g_1 = new WhitePoint('C', xyY_init_$Create$(0.31006, 0.31616));
|
|
422
|
+
this.c2g_1 = new WhitePoint('D50', xyY_init_$Create$(0.3457, 0.3585));
|
|
423
|
+
this.d2g_1 = new WhitePoint('D55', xyY_init_$Create$(0.33243, 0.34744));
|
|
424
|
+
this.e2g_1 = new WhitePoint('D65', xyY_init_$Create$(0.3127, 0.329));
|
|
425
|
+
this.f2g_1 = new WhitePoint('D75', xyY_init_$Create$(0.29903, 0.31488));
|
|
426
|
+
this.g2g_1 = new WhitePoint('E', xyY_init_$Create$(0.3333333333333333, 0.3333333333333333));
|
|
427
|
+
}
|
|
428
|
+
var Illuminant_instance;
|
|
429
|
+
function Illuminant_getInstance() {
|
|
430
|
+
if (Illuminant_instance == null)
|
|
431
|
+
new Illuminant();
|
|
432
|
+
return Illuminant_instance;
|
|
433
|
+
}
|
|
434
|
+
function rectangularComponentInfo(name) {
|
|
435
|
+
var tmp$ret$3;
|
|
436
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
437
|
+
var tmp$ret$2;
|
|
438
|
+
// Inline function 'kotlin.text.map' call
|
|
439
|
+
var tmp$ret$1;
|
|
440
|
+
// Inline function 'kotlin.text.mapTo' call
|
|
441
|
+
var tmp0_mapTo = ArrayList_init_$Create$(charSequenceLength(name));
|
|
442
|
+
var indexedObject = name;
|
|
443
|
+
var inductionVariable = 0;
|
|
444
|
+
var last = indexedObject.length;
|
|
445
|
+
while (inductionVariable < last) {
|
|
446
|
+
var item = charSequenceGet(indexedObject, inductionVariable);
|
|
447
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
448
|
+
var tmp$ret$0;
|
|
449
|
+
// Inline function 'com.github.ajalt.colormath.internal.rectangularComponentInfo.<anonymous>' call
|
|
450
|
+
tmp$ret$0 = toString(item);
|
|
451
|
+
tmp0_mapTo.b(tmp$ret$0);
|
|
452
|
+
}
|
|
453
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
454
|
+
tmp$ret$2 = tmp$ret$1;
|
|
455
|
+
var tmp1_toTypedArray = tmp$ret$2;
|
|
456
|
+
tmp$ret$3 = copyToArray(tmp1_toTypedArray);
|
|
457
|
+
return rectangularComponentInfo_0(tmp$ret$3.slice());
|
|
458
|
+
}
|
|
459
|
+
function polarComponentInfo(name) {
|
|
460
|
+
var tmp$ret$2;
|
|
461
|
+
// Inline function 'kotlin.text.map' call
|
|
462
|
+
var tmp$ret$1;
|
|
463
|
+
// Inline function 'kotlin.text.mapTo' call
|
|
464
|
+
var tmp0_mapTo = ArrayList_init_$Create$(charSequenceLength(name));
|
|
465
|
+
var indexedObject = name;
|
|
466
|
+
var inductionVariable = 0;
|
|
467
|
+
var last = indexedObject.length;
|
|
468
|
+
while (inductionVariable < last) {
|
|
469
|
+
var item = charSequenceGet(indexedObject, inductionVariable);
|
|
470
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
471
|
+
var tmp$ret$0;
|
|
472
|
+
// Inline function 'com.github.ajalt.colormath.internal.polarComponentInfo.<anonymous>' call
|
|
473
|
+
tmp$ret$0 = new ColorComponentInfo(toString(item), equals(new Char(item), new Char(_Char___init__impl__6a9atx(72))));
|
|
474
|
+
tmp0_mapTo.b(tmp$ret$0);
|
|
475
|
+
}
|
|
476
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
477
|
+
tmp$ret$2 = tmp$ret$1;
|
|
478
|
+
return plus(tmp$ret$2, new ColorComponentInfo('alpha', false));
|
|
479
|
+
}
|
|
480
|
+
function rectangularComponentInfo_0(names) {
|
|
481
|
+
var tmp$ret$2;
|
|
482
|
+
// Inline function 'kotlin.collections.map' call
|
|
483
|
+
var tmp1_map = plus(asList(names), 'alpha');
|
|
484
|
+
var tmp$ret$1;
|
|
485
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
486
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp1_map, 10));
|
|
487
|
+
var tmp0_iterator = tmp1_map.f();
|
|
488
|
+
while (tmp0_iterator.g()) {
|
|
489
|
+
var item = tmp0_iterator.h();
|
|
490
|
+
var tmp$ret$0;
|
|
491
|
+
// Inline function 'com.github.ajalt.colormath.internal.rectangularComponentInfo.<anonymous>' call
|
|
492
|
+
tmp$ret$0 = new ColorComponentInfo(item, false);
|
|
493
|
+
tmp0_mapTo.b(tmp$ret$0);
|
|
494
|
+
}
|
|
495
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
496
|
+
tmp$ret$2 = tmp$ret$1;
|
|
497
|
+
return tmp$ret$2;
|
|
498
|
+
}
|
|
499
|
+
function get_CAT02_XYZ_TO_LMS() {
|
|
500
|
+
_init_properties_Constants_kt__atb1ur();
|
|
501
|
+
return CAT02_XYZ_TO_LMS;
|
|
502
|
+
}
|
|
503
|
+
var CAT02_XYZ_TO_LMS;
|
|
504
|
+
function get_CAT02_LMS_TO_XYZ() {
|
|
505
|
+
_init_properties_Constants_kt__atb1ur();
|
|
506
|
+
return CAT02_LMS_TO_XYZ;
|
|
507
|
+
}
|
|
508
|
+
var CAT02_LMS_TO_XYZ;
|
|
509
|
+
function get_CIE_E() {
|
|
510
|
+
return CIE_E;
|
|
511
|
+
}
|
|
512
|
+
var CIE_E;
|
|
513
|
+
function get_CIE_K() {
|
|
514
|
+
return CIE_K;
|
|
515
|
+
}
|
|
516
|
+
var CIE_K;
|
|
517
|
+
function get_CIE_E_times_K() {
|
|
518
|
+
return CIE_E_times_K;
|
|
519
|
+
}
|
|
520
|
+
var CIE_E_times_K;
|
|
521
|
+
var properties_initialized_Constants_kt_w4w61t;
|
|
522
|
+
function _init_properties_Constants_kt__atb1ur() {
|
|
523
|
+
if (properties_initialized_Constants_kt_w4w61t) {
|
|
524
|
+
} else {
|
|
525
|
+
properties_initialized_Constants_kt_w4w61t = true;
|
|
526
|
+
CAT02_XYZ_TO_LMS = _Matrix___init__impl__q3kp4w_0(0.7328, 0.4296, -0.1624, -0.7036, 1.6975, 0.0061, 0.003, 0.0136, 0.9834);
|
|
527
|
+
CAT02_LMS_TO_XYZ = inverse(get_CAT02_XYZ_TO_LMS());
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function spow(_this__u8e3s4, p) {
|
|
531
|
+
return spow_0(_this__u8e3s4, p);
|
|
532
|
+
}
|
|
533
|
+
function nanToOne(_this__u8e3s4) {
|
|
534
|
+
return isNaN_0(_this__u8e3s4) ? 1.0 : _this__u8e3s4;
|
|
535
|
+
}
|
|
536
|
+
function spow_0(_this__u8e3s4, p) {
|
|
537
|
+
var tmp$ret$1;
|
|
538
|
+
// Inline function 'kotlin.math.pow' call
|
|
539
|
+
var tmp$ret$0;
|
|
540
|
+
// Inline function 'kotlin.math.absoluteValue' call
|
|
541
|
+
tmp$ret$0 = Math.abs(_this__u8e3s4);
|
|
542
|
+
var tmp0_pow = tmp$ret$0;
|
|
543
|
+
tmp$ret$1 = Math.pow(tmp0_pow, p);
|
|
544
|
+
return withSign(tmp$ret$1, _this__u8e3s4);
|
|
545
|
+
}
|
|
546
|
+
function normalizeDeg(_this__u8e3s4) {
|
|
547
|
+
return (_this__u8e3s4 % 360.0 + 360.0) % 360.0;
|
|
548
|
+
}
|
|
549
|
+
function radToDeg(_this__u8e3s4) {
|
|
550
|
+
return radToDeg_0(_this__u8e3s4);
|
|
551
|
+
}
|
|
552
|
+
function degToRad(_this__u8e3s4) {
|
|
553
|
+
return degToRad_0(_this__u8e3s4);
|
|
554
|
+
}
|
|
555
|
+
function radToDeg_0(_this__u8e3s4) {
|
|
556
|
+
return _this__u8e3s4 * 180.0 / get_PI();
|
|
557
|
+
}
|
|
558
|
+
function degToRad_0(_this__u8e3s4) {
|
|
559
|
+
return _this__u8e3s4 * get_PI() / 180.0;
|
|
560
|
+
}
|
|
561
|
+
function degToGrad(_this__u8e3s4) {
|
|
562
|
+
return _this__u8e3s4 * 200.0 / 180.0;
|
|
563
|
+
}
|
|
564
|
+
function degToTurns(_this__u8e3s4) {
|
|
565
|
+
return _this__u8e3s4 / 360.0;
|
|
566
|
+
}
|
|
567
|
+
function _Matrix___init__impl__q3kp4w(rowMajor) {
|
|
568
|
+
return rowMajor;
|
|
569
|
+
}
|
|
570
|
+
function _Matrix___get_rowMajor__impl__vmgxkq($this) {
|
|
571
|
+
return $this;
|
|
572
|
+
}
|
|
573
|
+
function _Matrix___init__impl__q3kp4w_0(v00, v10, v20, v01, v11, v21, v02, v12, v22) {
|
|
574
|
+
var tmp$ret$0;
|
|
575
|
+
// Inline function 'kotlin.floatArrayOf' call
|
|
576
|
+
tmp$ret$0 = new Float32Array([v00, v10, v20, v01, v11, v21, v02, v12, v22]);
|
|
577
|
+
var tmp = _Matrix___init__impl__q3kp4w(tmp$ret$0);
|
|
578
|
+
return tmp;
|
|
579
|
+
}
|
|
580
|
+
function Matrix__copy_impl_kmkvzd($this) {
|
|
581
|
+
var tmp$ret$1;
|
|
582
|
+
// Inline function 'kotlin.collections.copyOf' call
|
|
583
|
+
var tmp0_copyOf = _Matrix___get_rowMajor__impl__vmgxkq($this);
|
|
584
|
+
var tmp$ret$0;
|
|
585
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
586
|
+
tmp$ret$0 = tmp0_copyOf;
|
|
587
|
+
tmp$ret$1 = tmp$ret$0.slice();
|
|
588
|
+
return _Matrix___init__impl__q3kp4w(tmp$ret$1);
|
|
589
|
+
}
|
|
590
|
+
function Matrix__get_impl_xogbpk($this, x, y) {
|
|
591
|
+
return _Matrix___get_rowMajor__impl__vmgxkq($this)[imul(y, 3) + x | 0];
|
|
592
|
+
}
|
|
593
|
+
function Matrix__set_impl_s2l54c($this, x, y, value) {
|
|
594
|
+
_Matrix___get_rowMajor__impl__vmgxkq($this)[imul(y, 3) + x | 0] = value;
|
|
595
|
+
}
|
|
596
|
+
function Matrix__set_impl_s2l54c_0($this, x, y, value) {
|
|
597
|
+
return Matrix__set_impl_s2l54c($this, x, y, value);
|
|
598
|
+
}
|
|
599
|
+
function inverse(_this__u8e3s4, inPlace) {
|
|
600
|
+
inPlace = inPlace === VOID ? false : inPlace;
|
|
601
|
+
var a = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 0);
|
|
602
|
+
var b = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 0);
|
|
603
|
+
var c = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 0);
|
|
604
|
+
var d = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 1);
|
|
605
|
+
var e = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 1);
|
|
606
|
+
var f = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 1);
|
|
607
|
+
var g = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 2);
|
|
608
|
+
var h = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 2);
|
|
609
|
+
var i = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 2);
|
|
610
|
+
var A = e * i - h * f;
|
|
611
|
+
var B = h * c - b * i;
|
|
612
|
+
var C = b * f - e * c;
|
|
613
|
+
var det = a * A + d * B + g * C;
|
|
614
|
+
var out = inPlace ? _this__u8e3s4 : Matrix__copy_impl_kmkvzd(_this__u8e3s4);
|
|
615
|
+
Matrix__set_impl_s2l54c_0(out, 0, 0, A / det);
|
|
616
|
+
Matrix__set_impl_s2l54c_0(out, 0, 1, (g * f - d * i) / det);
|
|
617
|
+
Matrix__set_impl_s2l54c_0(out, 0, 2, (d * h - g * e) / det);
|
|
618
|
+
Matrix__set_impl_s2l54c_0(out, 1, 0, B / det);
|
|
619
|
+
Matrix__set_impl_s2l54c_0(out, 1, 1, (a * i - g * c) / det);
|
|
620
|
+
Matrix__set_impl_s2l54c_0(out, 1, 2, (g * b - a * h) / det);
|
|
621
|
+
Matrix__set_impl_s2l54c_0(out, 2, 0, C / det);
|
|
622
|
+
Matrix__set_impl_s2l54c_0(out, 2, 1, (d * c - a * f) / det);
|
|
623
|
+
Matrix__set_impl_s2l54c_0(out, 2, 2, (a * e - d * b) / det);
|
|
624
|
+
return out;
|
|
625
|
+
}
|
|
626
|
+
function scalarDiv(_this__u8e3s4, x, inPlace) {
|
|
627
|
+
inPlace = inPlace === VOID ? false : inPlace;
|
|
628
|
+
var out = _Matrix___get_rowMajor__impl__vmgxkq(inPlace ? _this__u8e3s4 : Matrix__copy_impl_kmkvzd(_this__u8e3s4));
|
|
629
|
+
var inductionVariable = 0;
|
|
630
|
+
var last = out.length - 1 | 0;
|
|
631
|
+
if (inductionVariable <= last)
|
|
632
|
+
do {
|
|
633
|
+
var i = inductionVariable;
|
|
634
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
635
|
+
var tmp1_array = out;
|
|
636
|
+
var tmp2_index0 = i;
|
|
637
|
+
tmp1_array[tmp2_index0] = tmp1_array[tmp2_index0] / x;
|
|
638
|
+
}
|
|
639
|
+
while (inductionVariable <= last);
|
|
640
|
+
return _Matrix___init__impl__q3kp4w(out);
|
|
641
|
+
}
|
|
642
|
+
function dot(_this__u8e3s4, other) {
|
|
643
|
+
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));
|
|
644
|
+
}
|
|
645
|
+
function dotDiagonal(_this__u8e3s4, v0, v1, v2) {
|
|
646
|
+
return _Matrix___init__impl__q3kp4w_0(Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 0) * v0, Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 0) * v1, Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 0) * v2, Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 1) * v0, Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 1) * v1, Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 1) * v2, Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 2) * v0, Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 2) * v1, Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 2) * v2);
|
|
647
|
+
}
|
|
648
|
+
function _Vector___init__impl__y7x4qq(values) {
|
|
649
|
+
return values;
|
|
650
|
+
}
|
|
651
|
+
function _Vector___get_values__impl__3gdbp5($this) {
|
|
652
|
+
return $this;
|
|
653
|
+
}
|
|
654
|
+
function _Vector___init__impl__y7x4qq_0(v0, v1, v2) {
|
|
655
|
+
var tmp$ret$0;
|
|
656
|
+
// Inline function 'kotlin.floatArrayOf' call
|
|
657
|
+
tmp$ret$0 = new Float32Array([v0, v1, v2]);
|
|
658
|
+
var tmp = _Vector___init__impl__y7x4qq(tmp$ret$0);
|
|
659
|
+
return tmp;
|
|
660
|
+
}
|
|
661
|
+
function _Vector___get_l__impl__envr1l($this) {
|
|
662
|
+
return _Vector___get_values__impl__3gdbp5($this)[0];
|
|
663
|
+
}
|
|
664
|
+
function _Vector___get_m__impl__e5qq0m($this) {
|
|
665
|
+
return _Vector___get_values__impl__3gdbp5($this)[1];
|
|
666
|
+
}
|
|
667
|
+
function _Vector___get_s__impl__pzuljk($this) {
|
|
668
|
+
return _Vector___get_values__impl__3gdbp5($this)[2];
|
|
669
|
+
}
|
|
670
|
+
function dot_0(_this__u8e3s4, v0, v1, v2) {
|
|
671
|
+
var tmp$ret$0;
|
|
672
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
673
|
+
tmp$ret$0 = _Vector___init__impl__y7x4qq_0(Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 0) * v0 + Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 0) * v1 + Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 0) * v2, Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 1) * v0 + Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 1) * v1 + Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 1) * v2, Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 2) * v0 + Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 2) * v1 + Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 2) * v2);
|
|
674
|
+
return tmp$ret$0;
|
|
675
|
+
}
|
|
676
|
+
function dot$f($this_dot, $other, x, y) {
|
|
677
|
+
return Matrix__get_impl_xogbpk($this_dot, 0, y) * Matrix__get_impl_xogbpk($other, x, 0) + Matrix__get_impl_xogbpk($this_dot, 1, y) * Matrix__get_impl_xogbpk($other, x, 1) + Matrix__get_impl_xogbpk($this_dot, 2, y) * Matrix__get_impl_xogbpk($other, x, 2);
|
|
678
|
+
}
|
|
679
|
+
function HSL() {
|
|
680
|
+
}
|
|
681
|
+
function HWB() {
|
|
682
|
+
}
|
|
683
|
+
function get_ICTCP_RGB_TO_LMS() {
|
|
684
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
685
|
+
return ICTCP_RGB_TO_LMS;
|
|
686
|
+
}
|
|
687
|
+
var ICTCP_RGB_TO_LMS;
|
|
688
|
+
function get_ICTCP_LMS_TO_ICTCP() {
|
|
689
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
690
|
+
return ICTCP_LMS_TO_ICTCP;
|
|
691
|
+
}
|
|
692
|
+
var ICTCP_LMS_TO_ICTCP;
|
|
693
|
+
function get_ICTCP_LMS_to_RGB() {
|
|
694
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
695
|
+
return ICTCP_LMS_to_RGB;
|
|
696
|
+
}
|
|
697
|
+
var ICTCP_LMS_to_RGB;
|
|
698
|
+
function get_ICTCP_ICTCP_to_LMS() {
|
|
699
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
700
|
+
return ICTCP_ICTCP_to_LMS;
|
|
701
|
+
}
|
|
702
|
+
var ICTCP_ICTCP_to_LMS;
|
|
703
|
+
function get_ICTCP_CROSSTALK() {
|
|
704
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
705
|
+
return ICTCP_CROSSTALK;
|
|
706
|
+
}
|
|
707
|
+
var ICTCP_CROSSTALK;
|
|
708
|
+
function get_HPE_XYZ_TO_LMS() {
|
|
709
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
710
|
+
return HPE_XYZ_TO_LMS;
|
|
711
|
+
}
|
|
712
|
+
var HPE_XYZ_TO_LMS;
|
|
713
|
+
function get_ICTCP_XYZ_TO_LMS() {
|
|
714
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
715
|
+
return ICTCP_XYZ_TO_LMS;
|
|
716
|
+
}
|
|
717
|
+
var ICTCP_XYZ_TO_LMS;
|
|
718
|
+
var ICTCP_LMS_TO_XYZ;
|
|
719
|
+
function ICtCp() {
|
|
720
|
+
}
|
|
721
|
+
protoOf(ICtCp).l2g = function () {
|
|
722
|
+
var fo = RGBColorSpaces_getInstance().g2f_1.m2g();
|
|
723
|
+
var tmp$ret$3;
|
|
724
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
725
|
+
var tmp0_dot = get_ICTCP_ICTCP_to_LMS();
|
|
726
|
+
var tmp1_dot = this.h2g_1;
|
|
727
|
+
var tmp2_dot = this.i2g_1;
|
|
728
|
+
var tmp3_dot = this.j2g_1;
|
|
729
|
+
var tmp$ret$2;
|
|
730
|
+
// Inline function 'com.github.ajalt.colormath.model.ICtCp.toBT2020.<anonymous>' call
|
|
731
|
+
var tmp4__anonymous__pkmkx7 = Matrix__get_impl_xogbpk(tmp0_dot, 0, 0) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 0) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 0) * tmp3_dot;
|
|
732
|
+
var tmp5__anonymous__kpxxpo = Matrix__get_impl_xogbpk(tmp0_dot, 0, 1) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 1) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 1) * tmp3_dot;
|
|
733
|
+
var tmp6__anonymous__fv9ai5 = Matrix__get_impl_xogbpk(tmp0_dot, 0, 2) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 2) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 2) * tmp3_dot;
|
|
734
|
+
var tmp$ret$1;
|
|
735
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
736
|
+
var tmp0_dot_0 = get_ICTCP_LMS_to_RGB();
|
|
737
|
+
var tmp1_dot_0 = PqNonlinearity_getInstance().v2g(tmp4__anonymous__pkmkx7);
|
|
738
|
+
var tmp2_dot_0 = PqNonlinearity_getInstance().v2g(tmp5__anonymous__kpxxpo);
|
|
739
|
+
var tmp3_dot_0 = PqNonlinearity_getInstance().v2g(tmp6__anonymous__fv9ai5);
|
|
740
|
+
var tmp$ret$0;
|
|
741
|
+
// Inline function 'com.github.ajalt.colormath.model.ICtCp.toBT2020.<anonymous>.<anonymous>' call
|
|
742
|
+
var tmp4__anonymous__pkmkx7_0 = Matrix__get_impl_xogbpk(tmp0_dot_0, 0, 0) * tmp1_dot_0 + Matrix__get_impl_xogbpk(tmp0_dot_0, 1, 0) * tmp2_dot_0 + Matrix__get_impl_xogbpk(tmp0_dot_0, 2, 0) * tmp3_dot_0;
|
|
743
|
+
var tmp5__anonymous__kpxxpo_0 = Matrix__get_impl_xogbpk(tmp0_dot_0, 0, 1) * tmp1_dot_0 + Matrix__get_impl_xogbpk(tmp0_dot_0, 1, 1) * tmp2_dot_0 + Matrix__get_impl_xogbpk(tmp0_dot_0, 2, 1) * tmp3_dot_0;
|
|
744
|
+
var tmp6__anonymous__fv9ai5_0 = Matrix__get_impl_xogbpk(tmp0_dot_0, 0, 2) * tmp1_dot_0 + Matrix__get_impl_xogbpk(tmp0_dot_0, 1, 2) * tmp2_dot_0 + Matrix__get_impl_xogbpk(tmp0_dot_0, 2, 2) * tmp3_dot_0;
|
|
745
|
+
tmp$ret$0 = RGBColorSpaces_getInstance().g2f_1.x2g(fo.w2g(tmp4__anonymous__pkmkx7_0), fo.w2g(tmp5__anonymous__kpxxpo_0), fo.w2g(tmp6__anonymous__fv9ai5_0), this.k2g_1);
|
|
746
|
+
tmp$ret$1 = tmp$ret$0;
|
|
747
|
+
tmp$ret$2 = tmp$ret$1;
|
|
748
|
+
tmp$ret$3 = tmp$ret$2;
|
|
749
|
+
return tmp$ret$3;
|
|
750
|
+
};
|
|
751
|
+
function PqNonlinearity() {
|
|
752
|
+
PqNonlinearity_instance = this;
|
|
753
|
+
this.n2g_1 = 0.1593017578125;
|
|
754
|
+
this.o2g_1 = 78.84375;
|
|
755
|
+
this.p2g_1 = 0.8359375;
|
|
756
|
+
this.q2g_1 = 18.8515625;
|
|
757
|
+
this.r2g_1 = 18.6875;
|
|
758
|
+
this.s2g_1 = 10000.0;
|
|
759
|
+
this.t2g_1 = 6.277394636015326;
|
|
760
|
+
this.u2g_1 = 0.012683313515655966;
|
|
761
|
+
}
|
|
762
|
+
protoOf(PqNonlinearity).v2g = function (x) {
|
|
763
|
+
var vp = spow(x, 0.012683313515655966);
|
|
764
|
+
var n = coerceAtLeast(vp - 0.8359375, 0.0);
|
|
765
|
+
var l = spow_0(n / (18.8515625 - 18.6875 * vp), 6.277394636015326);
|
|
766
|
+
return 10000.0 * l;
|
|
767
|
+
};
|
|
768
|
+
protoOf(PqNonlinearity).w2g = function (x) {
|
|
769
|
+
var yp = spow_0(x / 10000.0, 0.1593017578125);
|
|
770
|
+
return spow_0((0.8359375 + 18.8515625 * yp) / (1.0 + 18.6875 * yp), 78.84375);
|
|
771
|
+
};
|
|
772
|
+
var PqNonlinearity_instance;
|
|
773
|
+
function PqNonlinearity_getInstance() {
|
|
774
|
+
if (PqNonlinearity_instance == null)
|
|
775
|
+
new PqNonlinearity();
|
|
776
|
+
return PqNonlinearity_instance;
|
|
777
|
+
}
|
|
778
|
+
var properties_initialized_ICtCp_kt_w6y8uv;
|
|
779
|
+
function _init_properties_ICtCp_kt__7vx7or() {
|
|
780
|
+
if (properties_initialized_ICtCp_kt_w6y8uv) {
|
|
781
|
+
} else {
|
|
782
|
+
properties_initialized_ICtCp_kt_w6y8uv = true;
|
|
783
|
+
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);
|
|
784
|
+
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);
|
|
785
|
+
ICTCP_LMS_to_RGB = inverse(get_ICTCP_RGB_TO_LMS());
|
|
786
|
+
ICTCP_ICTCP_to_LMS = inverse(get_ICTCP_LMS_TO_ICTCP());
|
|
787
|
+
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);
|
|
788
|
+
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);
|
|
789
|
+
ICTCP_XYZ_TO_LMS = dot(get_ICTCP_CROSSTALK(), get_HPE_XYZ_TO_LMS());
|
|
790
|
+
ICTCP_LMS_TO_XYZ = inverse(get_ICTCP_XYZ_TO_LMS());
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
function Companion() {
|
|
794
|
+
Companion_instance = this;
|
|
795
|
+
this.y2g_1 = LABColorSpaces_getInstance().x2e_1;
|
|
796
|
+
}
|
|
797
|
+
protoOf(Companion).l2f = function () {
|
|
798
|
+
return this.y2g_1.l2f();
|
|
799
|
+
};
|
|
800
|
+
protoOf(Companion).p2e = function () {
|
|
801
|
+
return this.y2g_1.p2e();
|
|
802
|
+
};
|
|
803
|
+
protoOf(Companion).o2e = function (color) {
|
|
804
|
+
return this.y2g_1.o2e(color);
|
|
805
|
+
};
|
|
806
|
+
protoOf(Companion).x2g = function (l, a, b, alpha) {
|
|
807
|
+
return this.y2g_1.x2g(l, a, b, alpha);
|
|
808
|
+
};
|
|
809
|
+
protoOf(Companion).z2g = function (l, a, b, alpha) {
|
|
810
|
+
return this.y2g_1.z2g(l, a, b, alpha);
|
|
811
|
+
};
|
|
812
|
+
var Companion_instance;
|
|
813
|
+
function Companion_getInstance() {
|
|
814
|
+
if (Companion_instance == null)
|
|
815
|
+
new Companion();
|
|
816
|
+
return Companion_instance;
|
|
817
|
+
}
|
|
818
|
+
function LAB(l, a, b, alpha, space) {
|
|
819
|
+
Companion_getInstance();
|
|
820
|
+
this.j2e_1 = l;
|
|
821
|
+
this.k2e_1 = a;
|
|
822
|
+
this.l2e_1 = b;
|
|
823
|
+
this.m2e_1 = alpha;
|
|
824
|
+
this.n2e_1 = space;
|
|
825
|
+
}
|
|
826
|
+
protoOf(LAB).t2d = function () {
|
|
827
|
+
return this.m2e_1;
|
|
828
|
+
};
|
|
829
|
+
protoOf(LAB).u2d = function () {
|
|
830
|
+
return this.n2e_1;
|
|
831
|
+
};
|
|
832
|
+
protoOf(LAB).v2d = function () {
|
|
833
|
+
var tmp0_subject = this.j2e_1;
|
|
834
|
+
return tmp0_subject === 0.0 ? Companion_getInstance_1().x2g(0.0, 0.0, 0.0, this.m2e_1) : this.w2d().v2d();
|
|
835
|
+
};
|
|
836
|
+
protoOf(LAB).w2d = function () {
|
|
837
|
+
var xyzSpace = XYZColorSpace_0(this.n2e_1.p2e());
|
|
838
|
+
if (this.j2e_1 === 0.0)
|
|
839
|
+
return xyzSpace.b2h(0.0, 0.0, 0.0);
|
|
840
|
+
var fy = (this.j2e_1 + 16) / 116.0;
|
|
841
|
+
var fz = fy - this.l2e_1 / 200.0;
|
|
842
|
+
var fx = this.k2e_1 / 500.0 + fy;
|
|
843
|
+
var tmp;
|
|
844
|
+
if (this.j2e_1 > get_CIE_E_times_K()) {
|
|
845
|
+
var tmp$ret$0;
|
|
846
|
+
// Inline function 'kotlin.math.pow' call
|
|
847
|
+
tmp$ret$0 = Math.pow(fy, 3.0);
|
|
848
|
+
tmp = tmp$ret$0;
|
|
849
|
+
} else {
|
|
850
|
+
tmp = this.j2e_1 / get_CIE_K();
|
|
851
|
+
}
|
|
852
|
+
var yr = tmp;
|
|
853
|
+
var tmp$ret$3;
|
|
854
|
+
// Inline function 'kotlin.let' call
|
|
855
|
+
var tmp$ret$1;
|
|
856
|
+
// Inline function 'kotlin.math.pow' call
|
|
857
|
+
tmp$ret$1 = Math.pow(fz, 3.0);
|
|
858
|
+
var tmp0_let = tmp$ret$1;
|
|
859
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
860
|
+
var tmp$ret$2;
|
|
861
|
+
// Inline function 'com.github.ajalt.colormath.model.LAB.toXYZ.<anonymous>' call
|
|
862
|
+
tmp$ret$2 = tmp0_let > get_CIE_E() ? tmp0_let : (116 * fz - 16) / get_CIE_K();
|
|
863
|
+
tmp$ret$3 = tmp$ret$2;
|
|
864
|
+
var zr = tmp$ret$3;
|
|
865
|
+
var tmp$ret$6;
|
|
866
|
+
// Inline function 'kotlin.let' call
|
|
867
|
+
var tmp$ret$4;
|
|
868
|
+
// Inline function 'kotlin.math.pow' call
|
|
869
|
+
tmp$ret$4 = Math.pow(fx, 3.0);
|
|
870
|
+
var tmp1_let = tmp$ret$4;
|
|
871
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
872
|
+
var tmp$ret$5;
|
|
873
|
+
// Inline function 'com.github.ajalt.colormath.model.LAB.toXYZ.<anonymous>' call
|
|
874
|
+
tmp$ret$5 = tmp1_let > get_CIE_E() ? tmp1_let : (116 * fx - 16) / get_CIE_K();
|
|
875
|
+
tmp$ret$6 = tmp$ret$5;
|
|
876
|
+
var xr = tmp$ret$6;
|
|
877
|
+
var wp = this.n2e_1.p2e().y2f_1;
|
|
878
|
+
return xyzSpace.z2g(xr * wp.f2h(), yr * wp.e2h_1, zr * wp.g2h(), this.m2e_1);
|
|
879
|
+
};
|
|
880
|
+
protoOf(LAB).i2e = function () {
|
|
881
|
+
var tmp$ret$3;
|
|
882
|
+
// Inline function 'com.github.ajalt.colormath.internal.toPolarModel' call
|
|
883
|
+
var tmp1_toPolarModel = this.k2e_1;
|
|
884
|
+
var tmp2_toPolarModel = this.l2e_1;
|
|
885
|
+
var tmp$ret$0;
|
|
886
|
+
// Inline function 'kotlin.math.sqrt' call
|
|
887
|
+
var tmp0_sqrt = tmp1_toPolarModel * tmp1_toPolarModel + tmp2_toPolarModel * tmp2_toPolarModel;
|
|
888
|
+
tmp$ret$0 = Math.sqrt(tmp0_sqrt);
|
|
889
|
+
var c = tmp$ret$0;
|
|
890
|
+
var tmp;
|
|
891
|
+
if (c > -1.0E-7 ? c < 1.0E-7 : false) {
|
|
892
|
+
FloatCompanionObject_getInstance();
|
|
893
|
+
tmp = NaN;
|
|
894
|
+
} else {
|
|
895
|
+
var tmp$ret$1;
|
|
896
|
+
// Inline function 'kotlin.math.atan2' call
|
|
897
|
+
tmp$ret$1 = Math.atan2(tmp2_toPolarModel, tmp1_toPolarModel);
|
|
898
|
+
tmp = radToDeg(tmp$ret$1);
|
|
899
|
+
}
|
|
900
|
+
var h = tmp;
|
|
901
|
+
var tmp$ret$2;
|
|
902
|
+
// Inline function 'com.github.ajalt.colormath.model.LAB.toLCHab.<anonymous>' call
|
|
903
|
+
var tmp3__anonymous__ufb84q = normalizeDeg(h);
|
|
904
|
+
tmp$ret$2 = LCHabColorSpace(this.n2e_1.p2e()).x2g(this.j2e_1, c, tmp3__anonymous__ufb84q, this.m2e_1);
|
|
905
|
+
tmp$ret$3 = tmp$ret$2;
|
|
906
|
+
return tmp$ret$3;
|
|
907
|
+
};
|
|
908
|
+
protoOf(LAB).c2e = function () {
|
|
909
|
+
return this;
|
|
910
|
+
};
|
|
911
|
+
protoOf(LAB).v7 = function () {
|
|
912
|
+
var tmp$ret$0;
|
|
913
|
+
// Inline function 'kotlin.floatArrayOf' call
|
|
914
|
+
var tmp0_floatArrayOf = new Float32Array([this.j2e_1, this.k2e_1, this.l2e_1, this.m2e_1]);
|
|
915
|
+
tmp$ret$0 = tmp0_floatArrayOf;
|
|
916
|
+
return tmp$ret$0;
|
|
917
|
+
};
|
|
918
|
+
protoOf(LAB).toString = function () {
|
|
919
|
+
return 'LAB(l=' + this.j2e_1 + ', a=' + this.k2e_1 + ', b=' + this.l2e_1 + ', alpha=' + this.m2e_1 + ', space=' + this.n2e_1 + ')';
|
|
920
|
+
};
|
|
921
|
+
protoOf(LAB).hashCode = function () {
|
|
922
|
+
var result = getNumberHashCode(this.j2e_1);
|
|
923
|
+
result = imul(result, 31) + getNumberHashCode(this.k2e_1) | 0;
|
|
924
|
+
result = imul(result, 31) + getNumberHashCode(this.l2e_1) | 0;
|
|
925
|
+
result = imul(result, 31) + getNumberHashCode(this.m2e_1) | 0;
|
|
926
|
+
result = imul(result, 31) + hashCode(this.n2e_1) | 0;
|
|
927
|
+
return result;
|
|
928
|
+
};
|
|
929
|
+
protoOf(LAB).equals = function (other) {
|
|
930
|
+
if (this === other)
|
|
931
|
+
return true;
|
|
932
|
+
if (!(other instanceof LAB))
|
|
933
|
+
return false;
|
|
934
|
+
var tmp0_other_with_cast = other instanceof LAB ? other : THROW_CCE();
|
|
935
|
+
if (!equals(this.j2e_1, tmp0_other_with_cast.j2e_1))
|
|
936
|
+
return false;
|
|
937
|
+
if (!equals(this.k2e_1, tmp0_other_with_cast.k2e_1))
|
|
938
|
+
return false;
|
|
939
|
+
if (!equals(this.l2e_1, tmp0_other_with_cast.l2e_1))
|
|
940
|
+
return false;
|
|
941
|
+
if (!equals(this.m2e_1, tmp0_other_with_cast.m2e_1))
|
|
942
|
+
return false;
|
|
943
|
+
if (!equals(this.n2e_1, tmp0_other_with_cast.n2e_1))
|
|
944
|
+
return false;
|
|
945
|
+
return true;
|
|
946
|
+
};
|
|
947
|
+
function LABColorSpace() {
|
|
948
|
+
}
|
|
949
|
+
function LABColorSpace_0(whitePoint) {
|
|
950
|
+
var tmp0_subject = whitePoint;
|
|
951
|
+
return tmp0_subject.equals(Illuminant_getInstance().e2g_1) ? LABColorSpaces_getInstance().x2e_1 : tmp0_subject.equals(Illuminant_getInstance().c2g_1) ? LABColorSpaces_getInstance().y2e_1 : new LABColorSpaceImpl(whitePoint);
|
|
952
|
+
}
|
|
953
|
+
function LABColorSpaces() {
|
|
954
|
+
LABColorSpaces_instance = this;
|
|
955
|
+
this.x2e_1 = new LABColorSpaceImpl(Illuminant_getInstance().e2g_1);
|
|
956
|
+
this.y2e_1 = new LABColorSpaceImpl(Illuminant_getInstance().c2g_1);
|
|
957
|
+
}
|
|
958
|
+
var LABColorSpaces_instance;
|
|
959
|
+
function LABColorSpaces_getInstance() {
|
|
960
|
+
if (LABColorSpaces_instance == null)
|
|
961
|
+
new LABColorSpaces();
|
|
962
|
+
return LABColorSpaces_instance;
|
|
963
|
+
}
|
|
964
|
+
function LABColorSpaceImpl(whitePoint) {
|
|
965
|
+
this.h2h_1 = whitePoint;
|
|
966
|
+
this.i2h_1 = rectangularComponentInfo('LAB');
|
|
967
|
+
}
|
|
968
|
+
protoOf(LABColorSpaceImpl).p2e = function () {
|
|
969
|
+
return this.h2h_1;
|
|
970
|
+
};
|
|
971
|
+
protoOf(LABColorSpaceImpl).l2f = function () {
|
|
972
|
+
return 'LAB';
|
|
973
|
+
};
|
|
974
|
+
protoOf(LABColorSpaceImpl).o2e = function (color) {
|
|
975
|
+
var tmp$ret$2;
|
|
976
|
+
// Inline function 'com.github.ajalt.colormath.internal.adaptToThis' call
|
|
977
|
+
var tmp;
|
|
978
|
+
var tmp_0 = color.u2d();
|
|
979
|
+
var tmp0_safe_receiver = isInterface(tmp_0, WhitePointColorSpace) ? tmp_0 : null;
|
|
980
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.p2e();
|
|
981
|
+
if ((tmp1_elvis_lhs == null ? Illuminant_getInstance().e2g_1 : tmp1_elvis_lhs).equals(this.p2e())) {
|
|
982
|
+
var tmp$ret$0;
|
|
983
|
+
// Inline function 'com.github.ajalt.colormath.model.LABColorSpaceImpl.convert.<anonymous>' call
|
|
984
|
+
tmp$ret$0 = color.c2e();
|
|
985
|
+
tmp = tmp$ret$0;
|
|
986
|
+
} else {
|
|
987
|
+
var tmp$ret$1;
|
|
988
|
+
// Inline function 'com.github.ajalt.colormath.model.LABColorSpaceImpl.convert.<anonymous>' call
|
|
989
|
+
var tmp0__anonymous__q1qw7t = color.w2d().u2e(XYZColorSpace_0(this.p2e()));
|
|
990
|
+
tmp$ret$1 = tmp0__anonymous__q1qw7t.c2e();
|
|
991
|
+
tmp = tmp$ret$1;
|
|
992
|
+
}
|
|
993
|
+
tmp$ret$2 = tmp;
|
|
994
|
+
return tmp$ret$2;
|
|
995
|
+
};
|
|
996
|
+
protoOf(LABColorSpaceImpl).toString = function () {
|
|
997
|
+
return 'LABColorSpace(' + this.h2h_1 + ')';
|
|
998
|
+
};
|
|
999
|
+
protoOf(LABColorSpaceImpl).x2g = function (l, a, b, alpha) {
|
|
1000
|
+
return new LAB(l, a, b, alpha, this);
|
|
1001
|
+
};
|
|
1002
|
+
protoOf(LABColorSpaceImpl).hashCode = function () {
|
|
1003
|
+
return this.h2h_1.hashCode();
|
|
1004
|
+
};
|
|
1005
|
+
protoOf(LABColorSpaceImpl).equals = function (other) {
|
|
1006
|
+
if (this === other)
|
|
1007
|
+
return true;
|
|
1008
|
+
if (!(other instanceof LABColorSpaceImpl))
|
|
1009
|
+
return false;
|
|
1010
|
+
var tmp0_other_with_cast = other instanceof LABColorSpaceImpl ? other : THROW_CCE();
|
|
1011
|
+
if (!this.h2h_1.equals(tmp0_other_with_cast.h2h_1))
|
|
1012
|
+
return false;
|
|
1013
|
+
return true;
|
|
1014
|
+
};
|
|
1015
|
+
function Companion_0() {
|
|
1016
|
+
Companion_instance_0 = this;
|
|
1017
|
+
this.j2h_1 = LCHabColorSpaces_getInstance().v2e_1;
|
|
1018
|
+
}
|
|
1019
|
+
protoOf(Companion_0).l2f = function () {
|
|
1020
|
+
return this.j2h_1.l2f();
|
|
1021
|
+
};
|
|
1022
|
+
protoOf(Companion_0).p2e = function () {
|
|
1023
|
+
return this.j2h_1.p2e();
|
|
1024
|
+
};
|
|
1025
|
+
protoOf(Companion_0).o2e = function (color) {
|
|
1026
|
+
return this.j2h_1.o2e(color);
|
|
1027
|
+
};
|
|
1028
|
+
protoOf(Companion_0).x2g = function (l, c, h, alpha) {
|
|
1029
|
+
return this.j2h_1.x2g(l, c, h, alpha);
|
|
1030
|
+
};
|
|
1031
|
+
var Companion_instance_0;
|
|
1032
|
+
function Companion_getInstance_0() {
|
|
1033
|
+
if (Companion_instance_0 == null)
|
|
1034
|
+
new Companion_0();
|
|
1035
|
+
return Companion_instance_0;
|
|
1036
|
+
}
|
|
1037
|
+
function LCHab(l, c, h, alpha, space) {
|
|
1038
|
+
Companion_getInstance_0();
|
|
1039
|
+
this.p2f_1 = l;
|
|
1040
|
+
this.q2f_1 = c;
|
|
1041
|
+
this.r2f_1 = h;
|
|
1042
|
+
this.s2f_1 = alpha;
|
|
1043
|
+
this.t2f_1 = space;
|
|
1044
|
+
}
|
|
1045
|
+
protoOf(LCHab).w2f = function () {
|
|
1046
|
+
return this.r2f_1;
|
|
1047
|
+
};
|
|
1048
|
+
protoOf(LCHab).t2d = function () {
|
|
1049
|
+
return this.s2f_1;
|
|
1050
|
+
};
|
|
1051
|
+
protoOf(LCHab).u2d = function () {
|
|
1052
|
+
return this.t2f_1;
|
|
1053
|
+
};
|
|
1054
|
+
protoOf(LCHab).v2d = function () {
|
|
1055
|
+
return this.c2e().v2d();
|
|
1056
|
+
};
|
|
1057
|
+
protoOf(LCHab).w2d = function () {
|
|
1058
|
+
return this.c2e().w2d();
|
|
1059
|
+
};
|
|
1060
|
+
protoOf(LCHab).c2e = function () {
|
|
1061
|
+
var tmp$ret$3;
|
|
1062
|
+
// Inline function 'com.github.ajalt.colormath.internal.fromPolarModel' call
|
|
1063
|
+
var tmp0_fromPolarModel = this.q2f_1;
|
|
1064
|
+
var tmp1_fromPolarModel = this.r2f_1;
|
|
1065
|
+
var hDegrees = isNaN_0(tmp1_fromPolarModel) ? 0.0 : degToRad(tmp1_fromPolarModel);
|
|
1066
|
+
var tmp$ret$0;
|
|
1067
|
+
// Inline function 'kotlin.math.cos' call
|
|
1068
|
+
tmp$ret$0 = Math.cos(hDegrees);
|
|
1069
|
+
var a = tmp0_fromPolarModel * tmp$ret$0;
|
|
1070
|
+
var tmp$ret$1;
|
|
1071
|
+
// Inline function 'kotlin.math.sin' call
|
|
1072
|
+
tmp$ret$1 = Math.sin(hDegrees);
|
|
1073
|
+
var b = tmp0_fromPolarModel * tmp$ret$1;
|
|
1074
|
+
var tmp$ret$2;
|
|
1075
|
+
// Inline function 'com.github.ajalt.colormath.model.LCHab.toLAB.<anonymous>' call
|
|
1076
|
+
tmp$ret$2 = LABColorSpace_0(this.t2f_1.p2e()).x2g(this.p2f_1, a, b, this.s2f_1);
|
|
1077
|
+
tmp$ret$3 = tmp$ret$2;
|
|
1078
|
+
return tmp$ret$3;
|
|
1079
|
+
};
|
|
1080
|
+
protoOf(LCHab).i2e = function () {
|
|
1081
|
+
return this;
|
|
1082
|
+
};
|
|
1083
|
+
protoOf(LCHab).v7 = function () {
|
|
1084
|
+
var tmp$ret$0;
|
|
1085
|
+
// Inline function 'kotlin.floatArrayOf' call
|
|
1086
|
+
var tmp0_floatArrayOf = new Float32Array([this.p2f_1, this.q2f_1, this.r2f_1, this.s2f_1]);
|
|
1087
|
+
tmp$ret$0 = tmp0_floatArrayOf;
|
|
1088
|
+
return tmp$ret$0;
|
|
1089
|
+
};
|
|
1090
|
+
protoOf(LCHab).toString = function () {
|
|
1091
|
+
return 'LCHab(l=' + this.p2f_1 + ', c=' + this.q2f_1 + ', h=' + this.r2f_1 + ', alpha=' + this.s2f_1 + ', space=' + this.t2f_1 + ')';
|
|
1092
|
+
};
|
|
1093
|
+
protoOf(LCHab).hashCode = function () {
|
|
1094
|
+
var result = getNumberHashCode(this.p2f_1);
|
|
1095
|
+
result = imul(result, 31) + getNumberHashCode(this.q2f_1) | 0;
|
|
1096
|
+
result = imul(result, 31) + getNumberHashCode(this.r2f_1) | 0;
|
|
1097
|
+
result = imul(result, 31) + getNumberHashCode(this.s2f_1) | 0;
|
|
1098
|
+
result = imul(result, 31) + hashCode(this.t2f_1) | 0;
|
|
1099
|
+
return result;
|
|
1100
|
+
};
|
|
1101
|
+
protoOf(LCHab).equals = function (other) {
|
|
1102
|
+
if (this === other)
|
|
1103
|
+
return true;
|
|
1104
|
+
if (!(other instanceof LCHab))
|
|
1105
|
+
return false;
|
|
1106
|
+
var tmp0_other_with_cast = other instanceof LCHab ? other : THROW_CCE();
|
|
1107
|
+
if (!equals(this.p2f_1, tmp0_other_with_cast.p2f_1))
|
|
1108
|
+
return false;
|
|
1109
|
+
if (!equals(this.q2f_1, tmp0_other_with_cast.q2f_1))
|
|
1110
|
+
return false;
|
|
1111
|
+
if (!equals(this.r2f_1, tmp0_other_with_cast.r2f_1))
|
|
1112
|
+
return false;
|
|
1113
|
+
if (!equals(this.s2f_1, tmp0_other_with_cast.s2f_1))
|
|
1114
|
+
return false;
|
|
1115
|
+
if (!equals(this.t2f_1, tmp0_other_with_cast.t2f_1))
|
|
1116
|
+
return false;
|
|
1117
|
+
return true;
|
|
1118
|
+
};
|
|
1119
|
+
function LCHabColorSpace(whitePoint) {
|
|
1120
|
+
var tmp0_subject = whitePoint;
|
|
1121
|
+
return tmp0_subject.equals(Illuminant_getInstance().e2g_1) ? LCHabColorSpaces_getInstance().v2e_1 : tmp0_subject.equals(Illuminant_getInstance().c2g_1) ? LCHabColorSpaces_getInstance().w2e_1 : new LCHabColorSpaceImpl(whitePoint);
|
|
1122
|
+
}
|
|
1123
|
+
function LCHabColorSpaces() {
|
|
1124
|
+
LCHabColorSpaces_instance = this;
|
|
1125
|
+
this.v2e_1 = new LCHabColorSpaceImpl(Illuminant_getInstance().e2g_1);
|
|
1126
|
+
this.w2e_1 = new LCHabColorSpaceImpl(Illuminant_getInstance().c2g_1);
|
|
1127
|
+
}
|
|
1128
|
+
var LCHabColorSpaces_instance;
|
|
1129
|
+
function LCHabColorSpaces_getInstance() {
|
|
1130
|
+
if (LCHabColorSpaces_instance == null)
|
|
1131
|
+
new LCHabColorSpaces();
|
|
1132
|
+
return LCHabColorSpaces_instance;
|
|
1133
|
+
}
|
|
1134
|
+
function LCHabColorSpaceImpl(whitePoint) {
|
|
1135
|
+
this.k2h_1 = whitePoint;
|
|
1136
|
+
this.l2h_1 = polarComponentInfo('LCH');
|
|
1137
|
+
}
|
|
1138
|
+
protoOf(LCHabColorSpaceImpl).p2e = function () {
|
|
1139
|
+
return this.k2h_1;
|
|
1140
|
+
};
|
|
1141
|
+
protoOf(LCHabColorSpaceImpl).l2f = function () {
|
|
1142
|
+
return 'LCHab';
|
|
1143
|
+
};
|
|
1144
|
+
protoOf(LCHabColorSpaceImpl).o2e = function (color) {
|
|
1145
|
+
var tmp$ret$2;
|
|
1146
|
+
// Inline function 'com.github.ajalt.colormath.internal.adaptToThis' call
|
|
1147
|
+
var tmp;
|
|
1148
|
+
var tmp_0 = color.u2d();
|
|
1149
|
+
var tmp0_safe_receiver = isInterface(tmp_0, WhitePointColorSpace) ? tmp_0 : null;
|
|
1150
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.p2e();
|
|
1151
|
+
if ((tmp1_elvis_lhs == null ? Illuminant_getInstance().e2g_1 : tmp1_elvis_lhs).equals(this.p2e())) {
|
|
1152
|
+
var tmp$ret$0;
|
|
1153
|
+
// Inline function 'com.github.ajalt.colormath.model.LCHabColorSpaceImpl.convert.<anonymous>' call
|
|
1154
|
+
tmp$ret$0 = color.i2e();
|
|
1155
|
+
tmp = tmp$ret$0;
|
|
1156
|
+
} else {
|
|
1157
|
+
var tmp$ret$1;
|
|
1158
|
+
// Inline function 'com.github.ajalt.colormath.model.LCHabColorSpaceImpl.convert.<anonymous>' call
|
|
1159
|
+
var tmp0__anonymous__q1qw7t = color.w2d().u2e(XYZColorSpace_0(this.p2e()));
|
|
1160
|
+
tmp$ret$1 = tmp0__anonymous__q1qw7t.i2e();
|
|
1161
|
+
tmp = tmp$ret$1;
|
|
1162
|
+
}
|
|
1163
|
+
tmp$ret$2 = tmp;
|
|
1164
|
+
return tmp$ret$2;
|
|
1165
|
+
};
|
|
1166
|
+
protoOf(LCHabColorSpaceImpl).toString = function () {
|
|
1167
|
+
return 'LCHabColorSpace(' + this.k2h_1 + ')';
|
|
1168
|
+
};
|
|
1169
|
+
protoOf(LCHabColorSpaceImpl).x2g = function (l, c, h, alpha) {
|
|
1170
|
+
return new LCHab(l, c, h, alpha, this);
|
|
1171
|
+
};
|
|
1172
|
+
protoOf(LCHabColorSpaceImpl).hashCode = function () {
|
|
1173
|
+
return this.k2h_1.hashCode();
|
|
1174
|
+
};
|
|
1175
|
+
protoOf(LCHabColorSpaceImpl).equals = function (other) {
|
|
1176
|
+
if (this === other)
|
|
1177
|
+
return true;
|
|
1178
|
+
if (!(other instanceof LCHabColorSpaceImpl))
|
|
1179
|
+
return false;
|
|
1180
|
+
var tmp0_other_with_cast = other instanceof LCHabColorSpaceImpl ? other : THROW_CCE();
|
|
1181
|
+
if (!this.k2h_1.equals(tmp0_other_with_cast.k2h_1))
|
|
1182
|
+
return false;
|
|
1183
|
+
return true;
|
|
1184
|
+
};
|
|
1185
|
+
function GammaTransferFunctions(gamma) {
|
|
1186
|
+
this.m2h_1 = gamma;
|
|
1187
|
+
}
|
|
1188
|
+
protoOf(GammaTransferFunctions).v2g = function (x) {
|
|
1189
|
+
return spow(x, this.m2h_1);
|
|
1190
|
+
};
|
|
1191
|
+
protoOf(GammaTransferFunctions).w2g = function (x) {
|
|
1192
|
+
return spow(x, 1.0 / this.m2h_1);
|
|
1193
|
+
};
|
|
1194
|
+
protoOf(GammaTransferFunctions).toString = function () {
|
|
1195
|
+
return 'GammaTransferFunctions(gamma=' + this.m2h_1 + ')';
|
|
1196
|
+
};
|
|
1197
|
+
protoOf(GammaTransferFunctions).hashCode = function () {
|
|
1198
|
+
return getNumberHashCode(this.m2h_1);
|
|
1199
|
+
};
|
|
1200
|
+
protoOf(GammaTransferFunctions).equals = function (other) {
|
|
1201
|
+
if (this === other)
|
|
1202
|
+
return true;
|
|
1203
|
+
if (!(other instanceof GammaTransferFunctions))
|
|
1204
|
+
return false;
|
|
1205
|
+
var tmp0_other_with_cast = other instanceof GammaTransferFunctions ? other : THROW_CCE();
|
|
1206
|
+
if (!equals(this.m2h_1, tmp0_other_with_cast.m2h_1))
|
|
1207
|
+
return false;
|
|
1208
|
+
return true;
|
|
1209
|
+
};
|
|
1210
|
+
function LinearTransferFunctions() {
|
|
1211
|
+
LinearTransferFunctions_instance = this;
|
|
1212
|
+
}
|
|
1213
|
+
protoOf(LinearTransferFunctions).v2g = function (x) {
|
|
1214
|
+
return x;
|
|
1215
|
+
};
|
|
1216
|
+
protoOf(LinearTransferFunctions).w2g = function (x) {
|
|
1217
|
+
return x;
|
|
1218
|
+
};
|
|
1219
|
+
var LinearTransferFunctions_instance;
|
|
1220
|
+
function LinearTransferFunctions_getInstance() {
|
|
1221
|
+
if (LinearTransferFunctions_instance == null)
|
|
1222
|
+
new LinearTransferFunctions();
|
|
1223
|
+
return LinearTransferFunctions_instance;
|
|
1224
|
+
}
|
|
1225
|
+
function RGBColorSpace() {
|
|
1226
|
+
}
|
|
1227
|
+
function Companion_1() {
|
|
1228
|
+
Companion_instance_1 = this;
|
|
1229
|
+
this.a2h_1 = RGBColorSpaces_getInstance().z2e_1;
|
|
1230
|
+
}
|
|
1231
|
+
protoOf(Companion_1).o2h = function () {
|
|
1232
|
+
return this.a2h_1.o2h();
|
|
1233
|
+
};
|
|
1234
|
+
protoOf(Companion_1).n2h = function () {
|
|
1235
|
+
return this.a2h_1.n2h();
|
|
1236
|
+
};
|
|
1237
|
+
protoOf(Companion_1).l2f = function () {
|
|
1238
|
+
return this.a2h_1.l2f();
|
|
1239
|
+
};
|
|
1240
|
+
protoOf(Companion_1).m2g = function () {
|
|
1241
|
+
return this.a2h_1.m2g();
|
|
1242
|
+
};
|
|
1243
|
+
protoOf(Companion_1).p2e = function () {
|
|
1244
|
+
return this.a2h_1.p2e();
|
|
1245
|
+
};
|
|
1246
|
+
protoOf(Companion_1).o2e = function (color) {
|
|
1247
|
+
return this.a2h_1.o2e(color);
|
|
1248
|
+
};
|
|
1249
|
+
protoOf(Companion_1).x2g = function (r, g, b, alpha) {
|
|
1250
|
+
return this.a2h_1.x2g(r, g, b, alpha);
|
|
1251
|
+
};
|
|
1252
|
+
protoOf(Companion_1).z2g = function (r, g, b, alpha) {
|
|
1253
|
+
return this.a2h_1.z2g(r, g, b, alpha);
|
|
1254
|
+
};
|
|
1255
|
+
var Companion_instance_1;
|
|
1256
|
+
function Companion_getInstance_1() {
|
|
1257
|
+
if (Companion_instance_1 == null)
|
|
1258
|
+
new Companion_1();
|
|
1259
|
+
return Companion_instance_1;
|
|
1260
|
+
}
|
|
1261
|
+
function RGB(r, g, b, alpha, space) {
|
|
1262
|
+
Companion_getInstance_1();
|
|
1263
|
+
this.x2d_1 = r;
|
|
1264
|
+
this.y2d_1 = g;
|
|
1265
|
+
this.z2d_1 = b;
|
|
1266
|
+
this.a2e_1 = alpha;
|
|
1267
|
+
this.b2e_1 = space;
|
|
1268
|
+
}
|
|
1269
|
+
protoOf(RGB).t2d = function () {
|
|
1270
|
+
return this.a2e_1;
|
|
1271
|
+
};
|
|
1272
|
+
protoOf(RGB).u2d = function () {
|
|
1273
|
+
return this.b2e_1;
|
|
1274
|
+
};
|
|
1275
|
+
protoOf(RGB).m2f = function () {
|
|
1276
|
+
var tmp$ret$1;
|
|
1277
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
1278
|
+
var tmp$ret$0;
|
|
1279
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.toRGBInt.<anonymous>' call
|
|
1280
|
+
var tmp0__anonymous__q1qw7t = this.p2h(SRGB_getInstance());
|
|
1281
|
+
tmp$ret$0 = _RGBInt___init__impl__lqova7_1(tmp0__anonymous__q1qw7t.x2d_1, tmp0__anonymous__q1qw7t.y2d_1, tmp0__anonymous__q1qw7t.z2d_1, nanToOne(tmp0__anonymous__q1qw7t.a2e_1));
|
|
1282
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1283
|
+
return tmp$ret$1;
|
|
1284
|
+
};
|
|
1285
|
+
protoOf(RGB).p2h = function (space) {
|
|
1286
|
+
var f = SRGB_getInstance().t2h_1;
|
|
1287
|
+
return equals(this.b2e_1, space) ? this : (equals(this.b2e_1, SRGB_getInstance()) ? equals(space, RGBColorSpaces_getInstance().a2f_1) : false) ? space.x2g(f.v2g(this.x2d_1), f.v2g(this.y2d_1), f.v2g(this.z2d_1), this.a2e_1) : (equals(this.b2e_1, RGBColorSpaces_getInstance().a2f_1) ? equals(space, SRGB_getInstance()) : false) ? space.x2g(f.w2g(this.x2d_1), f.w2g(this.y2d_1), f.w2g(this.z2d_1), this.a2e_1) : this.w2d().w2h(space);
|
|
1288
|
+
};
|
|
1289
|
+
protoOf(RGB).w2d = function () {
|
|
1290
|
+
var f = this.b2e_1.m2g();
|
|
1291
|
+
var tmp$ret$1;
|
|
1292
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1293
|
+
var tmp0_dot = _Matrix___init__impl__q3kp4w(this.b2e_1.n2h());
|
|
1294
|
+
var tmp1_dot = f.v2g(this.x2d_1);
|
|
1295
|
+
var tmp2_dot = f.v2g(this.y2d_1);
|
|
1296
|
+
var tmp3_dot = f.v2g(this.z2d_1);
|
|
1297
|
+
var tmp$ret$0;
|
|
1298
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.toXYZ.<anonymous>' call
|
|
1299
|
+
var tmp4__anonymous__pkmkx7 = Matrix__get_impl_xogbpk(tmp0_dot, 0, 0) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 0) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 0) * tmp3_dot;
|
|
1300
|
+
var tmp5__anonymous__kpxxpo = Matrix__get_impl_xogbpk(tmp0_dot, 0, 1) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 1) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 1) * tmp3_dot;
|
|
1301
|
+
var tmp6__anonymous__fv9ai5 = Matrix__get_impl_xogbpk(tmp0_dot, 0, 2) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 2) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 2) * tmp3_dot;
|
|
1302
|
+
tmp$ret$0 = XYZColorSpace_0(this.b2e_1.p2e()).x2g(tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo, tmp6__anonymous__fv9ai5, this.a2e_1);
|
|
1303
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1304
|
+
return tmp$ret$1;
|
|
1305
|
+
};
|
|
1306
|
+
protoOf(RGB).v2d = function () {
|
|
1307
|
+
return this.p2h(RGBColorSpaces_getInstance().z2e_1);
|
|
1308
|
+
};
|
|
1309
|
+
protoOf(RGB).v7 = function () {
|
|
1310
|
+
var tmp$ret$0;
|
|
1311
|
+
// Inline function 'kotlin.floatArrayOf' call
|
|
1312
|
+
var tmp0_floatArrayOf = new Float32Array([this.x2d_1, this.y2d_1, this.z2d_1, this.a2e_1]);
|
|
1313
|
+
tmp$ret$0 = tmp0_floatArrayOf;
|
|
1314
|
+
return tmp$ret$0;
|
|
1315
|
+
};
|
|
1316
|
+
protoOf(RGB).toString = function () {
|
|
1317
|
+
return 'RGB(r=' + this.x2d_1 + ', g=' + this.y2d_1 + ', b=' + this.z2d_1 + ', alpha=' + this.a2e_1 + ', space=' + this.b2e_1 + ')';
|
|
1318
|
+
};
|
|
1319
|
+
protoOf(RGB).hashCode = function () {
|
|
1320
|
+
var result = getNumberHashCode(this.x2d_1);
|
|
1321
|
+
result = imul(result, 31) + getNumberHashCode(this.y2d_1) | 0;
|
|
1322
|
+
result = imul(result, 31) + getNumberHashCode(this.z2d_1) | 0;
|
|
1323
|
+
result = imul(result, 31) + getNumberHashCode(this.a2e_1) | 0;
|
|
1324
|
+
result = imul(result, 31) + hashCode(this.b2e_1) | 0;
|
|
1325
|
+
return result;
|
|
1326
|
+
};
|
|
1327
|
+
protoOf(RGB).equals = function (other) {
|
|
1328
|
+
if (this === other)
|
|
1329
|
+
return true;
|
|
1330
|
+
if (!(other instanceof RGB))
|
|
1331
|
+
return false;
|
|
1332
|
+
var tmp0_other_with_cast = other instanceof RGB ? other : THROW_CCE();
|
|
1333
|
+
if (!equals(this.x2d_1, tmp0_other_with_cast.x2d_1))
|
|
1334
|
+
return false;
|
|
1335
|
+
if (!equals(this.y2d_1, tmp0_other_with_cast.y2d_1))
|
|
1336
|
+
return false;
|
|
1337
|
+
if (!equals(this.z2d_1, tmp0_other_with_cast.z2d_1))
|
|
1338
|
+
return false;
|
|
1339
|
+
if (!equals(this.a2e_1, tmp0_other_with_cast.a2e_1))
|
|
1340
|
+
return false;
|
|
1341
|
+
if (!equals(this.b2e_1, tmp0_other_with_cast.b2e_1))
|
|
1342
|
+
return false;
|
|
1343
|
+
return true;
|
|
1344
|
+
};
|
|
1345
|
+
function get_SRGB_R() {
|
|
1346
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1347
|
+
return SRGB_R;
|
|
1348
|
+
}
|
|
1349
|
+
var SRGB_R;
|
|
1350
|
+
function get_SRGB_G() {
|
|
1351
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1352
|
+
return SRGB_G;
|
|
1353
|
+
}
|
|
1354
|
+
var SRGB_G;
|
|
1355
|
+
function get_SRGB_B() {
|
|
1356
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1357
|
+
return SRGB_B;
|
|
1358
|
+
}
|
|
1359
|
+
var SRGB_B;
|
|
1360
|
+
function get_ACES_WHITE_POINT() {
|
|
1361
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1362
|
+
return ACES_WHITE_POINT;
|
|
1363
|
+
}
|
|
1364
|
+
var ACES_WHITE_POINT;
|
|
1365
|
+
function get_ACES_AP0_R() {
|
|
1366
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1367
|
+
return ACES_AP0_R;
|
|
1368
|
+
}
|
|
1369
|
+
var ACES_AP0_R;
|
|
1370
|
+
function get_ACES_AP0_G() {
|
|
1371
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1372
|
+
return ACES_AP0_G;
|
|
1373
|
+
}
|
|
1374
|
+
var ACES_AP0_G;
|
|
1375
|
+
function get_ACES_AP0_B() {
|
|
1376
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1377
|
+
return ACES_AP0_B;
|
|
1378
|
+
}
|
|
1379
|
+
var ACES_AP0_B;
|
|
1380
|
+
function get_ACES_AP1_R() {
|
|
1381
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1382
|
+
return ACES_AP1_R;
|
|
1383
|
+
}
|
|
1384
|
+
var ACES_AP1_R;
|
|
1385
|
+
function get_ACES_AP1_G() {
|
|
1386
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1387
|
+
return ACES_AP1_G;
|
|
1388
|
+
}
|
|
1389
|
+
var ACES_AP1_G;
|
|
1390
|
+
function get_ACES_AP1_B() {
|
|
1391
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1392
|
+
return ACES_AP1_B;
|
|
1393
|
+
}
|
|
1394
|
+
var ACES_AP1_B;
|
|
1395
|
+
function RGBColorSpaces() {
|
|
1396
|
+
RGBColorSpaces_instance = this;
|
|
1397
|
+
this.z2e_1 = SRGB_getInstance();
|
|
1398
|
+
this.a2f_1 = RGBColorSpace_0('Linear sRGB', Illuminant_getInstance().e2g_1, LinearTransferFunctions_getInstance(), get_SRGB_R(), get_SRGB_G(), get_SRGB_B());
|
|
1399
|
+
this.b2f_1 = RGBColorSpace_0('ACES2065-1', get_ACES_WHITE_POINT(), LinearTransferFunctions_getInstance(), get_ACES_AP0_R(), get_ACES_AP0_G(), get_ACES_AP0_B());
|
|
1400
|
+
this.c2f_1 = RGBColorSpace_0('ACEScc', get_ACES_WHITE_POINT(), ACESccTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1401
|
+
this.d2f_1 = RGBColorSpace_0('ACEScct', get_ACES_WHITE_POINT(), ACEScctTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1402
|
+
this.e2f_1 = RGBColorSpace_0('ACEScg', get_ACES_WHITE_POINT(), LinearTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1403
|
+
this.f2f_1 = RGBColorSpace_0('Adobe RGB', Illuminant_getInstance().e2g_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));
|
|
1404
|
+
this.g2f_1 = BT2020Space_getInstance();
|
|
1405
|
+
this.h2f_1 = RGBColorSpace_0('BT.709', Illuminant_getInstance().e2g_1, BT709TransferFunctions_getInstance(), xyY_init_$Create$(0.64, 0.33), xyY_init_$Create$(0.3, 0.6), xyY_init_$Create$(0.15, 0.06));
|
|
1406
|
+
this.i2f_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));
|
|
1407
|
+
this.j2f_1 = RGBColorSpace_0('Display P3', Illuminant_getInstance().e2g_1, SRGBTransferFunctions_getInstance(), xyY_init_$Create$(0.68, 0.32), xyY_init_$Create$(0.265, 0.69), xyY_init_$Create$(0.15, 0.06));
|
|
1408
|
+
this.k2f_1 = RGBColorSpace_0('ROMM RGB', Illuminant_getInstance().c2g_1, ROMMTransferFunctions_getInstance(), xyY_init_$Create$(0.7347, 0.2653), xyY_init_$Create$(0.1596, 0.8404), xyY_init_$Create$(0.0366, 1.0E-4));
|
|
1409
|
+
}
|
|
1410
|
+
var RGBColorSpaces_instance;
|
|
1411
|
+
function RGBColorSpaces_getInstance() {
|
|
1412
|
+
if (RGBColorSpaces_instance == null)
|
|
1413
|
+
new RGBColorSpaces();
|
|
1414
|
+
return RGBColorSpaces_instance;
|
|
1415
|
+
}
|
|
1416
|
+
function SRGB() {
|
|
1417
|
+
SRGB_instance = this;
|
|
1418
|
+
this.q2h_1 = 'sRGB';
|
|
1419
|
+
this.r2h_1 = rectangularComponentInfo('RGB');
|
|
1420
|
+
this.s2h_1 = Illuminant_getInstance().e2g_1;
|
|
1421
|
+
this.t2h_1 = SRGBTransferFunctions_getInstance();
|
|
1422
|
+
this.u2h_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.s2h_1, get_SRGB_R(), get_SRGB_G(), get_SRGB_B()));
|
|
1423
|
+
this.v2h_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.u2h_1)));
|
|
1424
|
+
}
|
|
1425
|
+
protoOf(SRGB).l2f = function () {
|
|
1426
|
+
return this.q2h_1;
|
|
1427
|
+
};
|
|
1428
|
+
protoOf(SRGB).p2e = function () {
|
|
1429
|
+
return this.s2h_1;
|
|
1430
|
+
};
|
|
1431
|
+
protoOf(SRGB).m2g = function () {
|
|
1432
|
+
return this.t2h_1;
|
|
1433
|
+
};
|
|
1434
|
+
protoOf(SRGB).n2h = function () {
|
|
1435
|
+
return this.u2h_1;
|
|
1436
|
+
};
|
|
1437
|
+
protoOf(SRGB).o2h = function () {
|
|
1438
|
+
return this.v2h_1;
|
|
1439
|
+
};
|
|
1440
|
+
protoOf(SRGB).o2e = function (color) {
|
|
1441
|
+
return color.v2d();
|
|
1442
|
+
};
|
|
1443
|
+
protoOf(SRGB).toString = function () {
|
|
1444
|
+
return this.q2h_1;
|
|
1445
|
+
};
|
|
1446
|
+
protoOf(SRGB).x2g = function (r, g, b, alpha) {
|
|
1447
|
+
return new RGB(r, g, b, alpha, this);
|
|
1448
|
+
};
|
|
1449
|
+
var SRGB_instance;
|
|
1450
|
+
function SRGB_getInstance() {
|
|
1451
|
+
if (SRGB_instance == null)
|
|
1452
|
+
new SRGB();
|
|
1453
|
+
return SRGB_instance;
|
|
1454
|
+
}
|
|
1455
|
+
function RGBColorSpace_0(name, whitePoint, transferFunctions, r, g, b) {
|
|
1456
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1457
|
+
return new RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b);
|
|
1458
|
+
}
|
|
1459
|
+
function ACESccTransferFunctions() {
|
|
1460
|
+
ACESccTransferFunctions_instance = this;
|
|
1461
|
+
this.x2h_1 = 3.0517578125E-5;
|
|
1462
|
+
this.y2h_1 = 1.52587890625E-5;
|
|
1463
|
+
this.z2h_1 = -0.3013698630136986;
|
|
1464
|
+
var tmp = this;
|
|
1465
|
+
var tmp$ret$0;
|
|
1466
|
+
// Inline function 'kotlin.math.log2' call
|
|
1467
|
+
tmp$ret$0 = log2(65504.0);
|
|
1468
|
+
tmp.a2i_1 = (tmp$ret$0 + 9.72) / 17.52;
|
|
1469
|
+
}
|
|
1470
|
+
protoOf(ACESccTransferFunctions).v2g = function (x) {
|
|
1471
|
+
var tmp;
|
|
1472
|
+
if (x <= -0.3013698630136986) {
|
|
1473
|
+
tmp = (spow_0(2.0, x * 17.52 - 9.72) - 1.52587890625E-5) * 2.0;
|
|
1474
|
+
} else if (x < this.a2i_1) {
|
|
1475
|
+
var tmp$ret$0;
|
|
1476
|
+
// Inline function 'kotlin.math.pow' call
|
|
1477
|
+
var tmp0_pow = x * 17.52 - 9.72;
|
|
1478
|
+
tmp$ret$0 = Math.pow(2.0, tmp0_pow);
|
|
1479
|
+
tmp = tmp$ret$0;
|
|
1480
|
+
} else {
|
|
1481
|
+
tmp = 65504.0;
|
|
1482
|
+
}
|
|
1483
|
+
return tmp;
|
|
1484
|
+
};
|
|
1485
|
+
protoOf(ACESccTransferFunctions).w2g = function (x) {
|
|
1486
|
+
var tmp;
|
|
1487
|
+
if (x < 3.0517578125E-5) {
|
|
1488
|
+
var tmp$ret$0;
|
|
1489
|
+
// Inline function 'kotlin.math.log2' call
|
|
1490
|
+
var tmp0_log2 = 1.52587890625E-5 + coerceAtLeast_0(x, 0.0) / 2.0;
|
|
1491
|
+
tmp$ret$0 = log2(tmp0_log2);
|
|
1492
|
+
tmp = (tmp$ret$0 + 9.72) / 17.52;
|
|
1493
|
+
} else {
|
|
1494
|
+
var tmp$ret$1;
|
|
1495
|
+
// Inline function 'kotlin.math.log2' call
|
|
1496
|
+
tmp$ret$1 = log2(x);
|
|
1497
|
+
tmp = (tmp$ret$1 + 9.72) / 17.52;
|
|
1498
|
+
}
|
|
1499
|
+
return tmp;
|
|
1500
|
+
};
|
|
1501
|
+
var ACESccTransferFunctions_instance;
|
|
1502
|
+
function ACESccTransferFunctions_getInstance() {
|
|
1503
|
+
if (ACESccTransferFunctions_instance == null)
|
|
1504
|
+
new ACESccTransferFunctions();
|
|
1505
|
+
return ACESccTransferFunctions_instance;
|
|
1506
|
+
}
|
|
1507
|
+
function ACEScctTransferFunctions() {
|
|
1508
|
+
ACEScctTransferFunctions_instance = this;
|
|
1509
|
+
this.b2i_1 = 10.5402377416545;
|
|
1510
|
+
this.c2i_1 = 0.0729055341958355;
|
|
1511
|
+
var tmp = this;
|
|
1512
|
+
var tmp$ret$0;
|
|
1513
|
+
// Inline function 'kotlin.math.log2' call
|
|
1514
|
+
tmp$ret$0 = log2(65504.0);
|
|
1515
|
+
tmp.d2i_1 = (tmp$ret$0 + 9.72) / 17.52;
|
|
1516
|
+
}
|
|
1517
|
+
protoOf(ACEScctTransferFunctions).v2g = function (x) {
|
|
1518
|
+
var tmp;
|
|
1519
|
+
if (x <= 0.155251141552511) {
|
|
1520
|
+
tmp = (x - 0.0729055341958355) / 10.5402377416545;
|
|
1521
|
+
} else if (x < this.d2i_1) {
|
|
1522
|
+
var tmp$ret$0;
|
|
1523
|
+
// Inline function 'kotlin.math.pow' call
|
|
1524
|
+
var tmp0_pow = x * 17.52 - 9.72;
|
|
1525
|
+
tmp$ret$0 = Math.pow(2.0, tmp0_pow);
|
|
1526
|
+
tmp = tmp$ret$0;
|
|
1527
|
+
} else {
|
|
1528
|
+
tmp = 65504.0;
|
|
1529
|
+
}
|
|
1530
|
+
return tmp;
|
|
1531
|
+
};
|
|
1532
|
+
protoOf(ACEScctTransferFunctions).w2g = function (x) {
|
|
1533
|
+
var tmp;
|
|
1534
|
+
if (x < 0.0078125) {
|
|
1535
|
+
tmp = 10.5402377416545 * x + 0.0729055341958355;
|
|
1536
|
+
} else {
|
|
1537
|
+
var tmp$ret$0;
|
|
1538
|
+
// Inline function 'kotlin.math.log2' call
|
|
1539
|
+
tmp$ret$0 = log2(x);
|
|
1540
|
+
tmp = (tmp$ret$0 + 9.72) / 17.52;
|
|
1541
|
+
}
|
|
1542
|
+
return tmp;
|
|
1543
|
+
};
|
|
1544
|
+
var ACEScctTransferFunctions_instance;
|
|
1545
|
+
function ACEScctTransferFunctions_getInstance() {
|
|
1546
|
+
if (ACEScctTransferFunctions_instance == null)
|
|
1547
|
+
new ACEScctTransferFunctions();
|
|
1548
|
+
return ACEScctTransferFunctions_instance;
|
|
1549
|
+
}
|
|
1550
|
+
function BT2020Space() {
|
|
1551
|
+
BT2020Space_instance = this;
|
|
1552
|
+
this.e2i_1 = 'BT.2020';
|
|
1553
|
+
this.f2i_1 = rectangularComponentInfo('RGB');
|
|
1554
|
+
this.g2i_1 = Illuminant_getInstance().e2g_1;
|
|
1555
|
+
this.h2i_1 = BT2020TransferFunctions_getInstance();
|
|
1556
|
+
this.i2i_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.g2i_1, xyY_init_$Create$(0.708, 0.292), xyY_init_$Create$(0.17, 0.797), xyY_init_$Create$(0.131, 0.046)));
|
|
1557
|
+
this.j2i_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.i2i_1)));
|
|
1558
|
+
}
|
|
1559
|
+
protoOf(BT2020Space).l2f = function () {
|
|
1560
|
+
return this.e2i_1;
|
|
1561
|
+
};
|
|
1562
|
+
protoOf(BT2020Space).p2e = function () {
|
|
1563
|
+
return this.g2i_1;
|
|
1564
|
+
};
|
|
1565
|
+
protoOf(BT2020Space).m2g = function () {
|
|
1566
|
+
return this.h2i_1;
|
|
1567
|
+
};
|
|
1568
|
+
protoOf(BT2020Space).x2g = function (r, g, b, alpha) {
|
|
1569
|
+
return new RGB(r, g, b, alpha, this);
|
|
1570
|
+
};
|
|
1571
|
+
protoOf(BT2020Space).o2e = function (color) {
|
|
1572
|
+
var tmp0_subject = color;
|
|
1573
|
+
var tmp;
|
|
1574
|
+
if (tmp0_subject instanceof RGB) {
|
|
1575
|
+
tmp = color.p2h(this);
|
|
1576
|
+
} else {
|
|
1577
|
+
if (tmp0_subject instanceof ICtCp) {
|
|
1578
|
+
tmp = color.l2g();
|
|
1579
|
+
} else {
|
|
1580
|
+
tmp = color.w2d().w2h(this);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
return tmp;
|
|
1584
|
+
};
|
|
1585
|
+
protoOf(BT2020Space).n2h = function () {
|
|
1586
|
+
return this.i2i_1;
|
|
1587
|
+
};
|
|
1588
|
+
protoOf(BT2020Space).o2h = function () {
|
|
1589
|
+
return this.j2i_1;
|
|
1590
|
+
};
|
|
1591
|
+
protoOf(BT2020Space).toString = function () {
|
|
1592
|
+
return this.e2i_1;
|
|
1593
|
+
};
|
|
1594
|
+
var BT2020Space_instance;
|
|
1595
|
+
function BT2020Space_getInstance() {
|
|
1596
|
+
if (BT2020Space_instance == null)
|
|
1597
|
+
new BT2020Space();
|
|
1598
|
+
return BT2020Space_instance;
|
|
1599
|
+
}
|
|
1600
|
+
function BT709TransferFunctions() {
|
|
1601
|
+
BT709TransferFunctions_instance = this;
|
|
1602
|
+
this.k2i_1 = 1.099 * spow_0(0.018, 0.45) - 0.099;
|
|
1603
|
+
}
|
|
1604
|
+
protoOf(BT709TransferFunctions).v2g = function (x) {
|
|
1605
|
+
return numberToDouble(x < this.k2i_1 ? x / 4.5 : spow_0((x + 0.099) / 1.099, 2.2222222222222223));
|
|
1606
|
+
};
|
|
1607
|
+
protoOf(BT709TransferFunctions).w2g = function (x) {
|
|
1608
|
+
return x < 0.018 ? 4.5 * x : 1.099 * spow(x, 0.45) - 0.099;
|
|
1609
|
+
};
|
|
1610
|
+
var BT709TransferFunctions_instance;
|
|
1611
|
+
function BT709TransferFunctions_getInstance() {
|
|
1612
|
+
if (BT709TransferFunctions_instance == null)
|
|
1613
|
+
new BT709TransferFunctions();
|
|
1614
|
+
return BT709TransferFunctions_instance;
|
|
1615
|
+
}
|
|
1616
|
+
function SRGBTransferFunctions() {
|
|
1617
|
+
SRGBTransferFunctions_instance = this;
|
|
1618
|
+
}
|
|
1619
|
+
protoOf(SRGBTransferFunctions).w2g = function (x) {
|
|
1620
|
+
return x <= 0.0031308 ? x * 12.92 : 1.055 * spow(x, 0.4166666666666667) - 0.055;
|
|
1621
|
+
};
|
|
1622
|
+
protoOf(SRGBTransferFunctions).v2g = function (x) {
|
|
1623
|
+
return x <= 0.04045 ? x / 12.92 : spow_0((x + 0.055) / 1.055, 2.4);
|
|
1624
|
+
};
|
|
1625
|
+
var SRGBTransferFunctions_instance;
|
|
1626
|
+
function SRGBTransferFunctions_getInstance() {
|
|
1627
|
+
if (SRGBTransferFunctions_instance == null)
|
|
1628
|
+
new SRGBTransferFunctions();
|
|
1629
|
+
return SRGBTransferFunctions_instance;
|
|
1630
|
+
}
|
|
1631
|
+
function ROMMTransferFunctions() {
|
|
1632
|
+
ROMMTransferFunctions_instance = this;
|
|
1633
|
+
this.l2i_1 = 0.001953;
|
|
1634
|
+
}
|
|
1635
|
+
protoOf(ROMMTransferFunctions).v2g = function (x) {
|
|
1636
|
+
return x < 0.031248 ? x / 16.0 : spow(x, 1.8);
|
|
1637
|
+
};
|
|
1638
|
+
protoOf(ROMMTransferFunctions).w2g = function (x) {
|
|
1639
|
+
return x < 0.001953 ? x * 16.0 : spow(x, 0.5555555555555556);
|
|
1640
|
+
};
|
|
1641
|
+
var ROMMTransferFunctions_instance;
|
|
1642
|
+
function ROMMTransferFunctions_getInstance() {
|
|
1643
|
+
if (ROMMTransferFunctions_instance == null)
|
|
1644
|
+
new ROMMTransferFunctions();
|
|
1645
|
+
return ROMMTransferFunctions_instance;
|
|
1646
|
+
}
|
|
1647
|
+
function rgbToXyzMatrix(whitePoint, r, g, b) {
|
|
1648
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1649
|
+
var primaries = _Matrix___init__impl__q3kp4w_0(r.c2h_1, g.c2h_1, b.c2h_1, r.d2h_1, g.d2h_1, b.d2h_1, r.m2i(), g.m2i(), b.m2i());
|
|
1650
|
+
var wp = whitePoint.y2f_1;
|
|
1651
|
+
var tmp$ret$1;
|
|
1652
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1653
|
+
var tmp0_dot = inverse(primaries);
|
|
1654
|
+
var tmp1_dot = wp.f2h();
|
|
1655
|
+
var tmp2_dot = wp.e2h_1;
|
|
1656
|
+
var tmp3_dot = wp.g2h();
|
|
1657
|
+
var tmp$ret$0;
|
|
1658
|
+
// Inline function 'com.github.ajalt.colormath.model.rgbToXyzMatrix.<anonymous>' call
|
|
1659
|
+
var tmp4__anonymous__pkmkx7 = Matrix__get_impl_xogbpk(tmp0_dot, 0, 0) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 0) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 0) * tmp3_dot;
|
|
1660
|
+
var tmp5__anonymous__kpxxpo = Matrix__get_impl_xogbpk(tmp0_dot, 0, 1) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 1) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 1) * tmp3_dot;
|
|
1661
|
+
var tmp6__anonymous__fv9ai5 = Matrix__get_impl_xogbpk(tmp0_dot, 0, 2) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 2) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 2) * tmp3_dot;
|
|
1662
|
+
tmp$ret$0 = dotDiagonal(primaries, tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo, tmp6__anonymous__fv9ai5);
|
|
1663
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1664
|
+
return tmp$ret$1;
|
|
1665
|
+
}
|
|
1666
|
+
function RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b) {
|
|
1667
|
+
this.n2i_1 = name;
|
|
1668
|
+
this.o2i_1 = whitePoint;
|
|
1669
|
+
this.p2i_1 = transferFunctions;
|
|
1670
|
+
this.q2i_1 = r;
|
|
1671
|
+
this.r2i_1 = g;
|
|
1672
|
+
this.s2i_1 = b;
|
|
1673
|
+
this.t2i_1 = rectangularComponentInfo('RGB');
|
|
1674
|
+
this.u2i_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.o2i_1, this.q2i_1, this.r2i_1, this.s2i_1));
|
|
1675
|
+
this.v2i_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.u2i_1)));
|
|
1676
|
+
}
|
|
1677
|
+
protoOf(RGBColorSpaceImpl).l2f = function () {
|
|
1678
|
+
return this.n2i_1;
|
|
1679
|
+
};
|
|
1680
|
+
protoOf(RGBColorSpaceImpl).p2e = function () {
|
|
1681
|
+
return this.o2i_1;
|
|
1682
|
+
};
|
|
1683
|
+
protoOf(RGBColorSpaceImpl).m2g = function () {
|
|
1684
|
+
return this.p2i_1;
|
|
1685
|
+
};
|
|
1686
|
+
protoOf(RGBColorSpaceImpl).o2e = function (color) {
|
|
1687
|
+
var tmp;
|
|
1688
|
+
if (color instanceof RGB) {
|
|
1689
|
+
tmp = color.p2h(this);
|
|
1690
|
+
} else {
|
|
1691
|
+
tmp = color.w2d().w2h(this);
|
|
1692
|
+
}
|
|
1693
|
+
return tmp;
|
|
1694
|
+
};
|
|
1695
|
+
protoOf(RGBColorSpaceImpl).n2h = function () {
|
|
1696
|
+
return this.u2i_1;
|
|
1697
|
+
};
|
|
1698
|
+
protoOf(RGBColorSpaceImpl).o2h = function () {
|
|
1699
|
+
return this.v2i_1;
|
|
1700
|
+
};
|
|
1701
|
+
protoOf(RGBColorSpaceImpl).toString = function () {
|
|
1702
|
+
return this.n2i_1;
|
|
1703
|
+
};
|
|
1704
|
+
protoOf(RGBColorSpaceImpl).x2g = function (r, g, b, alpha) {
|
|
1705
|
+
return new RGB(r, g, b, alpha, this);
|
|
1706
|
+
};
|
|
1707
|
+
protoOf(RGBColorSpaceImpl).hashCode = function () {
|
|
1708
|
+
var result = getStringHashCode(this.n2i_1);
|
|
1709
|
+
result = imul(result, 31) + this.o2i_1.hashCode() | 0;
|
|
1710
|
+
result = imul(result, 31) + hashCode(this.p2i_1) | 0;
|
|
1711
|
+
result = imul(result, 31) + this.q2i_1.hashCode() | 0;
|
|
1712
|
+
result = imul(result, 31) + this.r2i_1.hashCode() | 0;
|
|
1713
|
+
result = imul(result, 31) + this.s2i_1.hashCode() | 0;
|
|
1714
|
+
return result;
|
|
1715
|
+
};
|
|
1716
|
+
protoOf(RGBColorSpaceImpl).equals = function (other) {
|
|
1717
|
+
if (this === other)
|
|
1718
|
+
return true;
|
|
1719
|
+
if (!(other instanceof RGBColorSpaceImpl))
|
|
1720
|
+
return false;
|
|
1721
|
+
var tmp0_other_with_cast = other instanceof RGBColorSpaceImpl ? other : THROW_CCE();
|
|
1722
|
+
if (!(this.n2i_1 === tmp0_other_with_cast.n2i_1))
|
|
1723
|
+
return false;
|
|
1724
|
+
if (!this.o2i_1.equals(tmp0_other_with_cast.o2i_1))
|
|
1725
|
+
return false;
|
|
1726
|
+
if (!equals(this.p2i_1, tmp0_other_with_cast.p2i_1))
|
|
1727
|
+
return false;
|
|
1728
|
+
if (!this.q2i_1.equals(tmp0_other_with_cast.q2i_1))
|
|
1729
|
+
return false;
|
|
1730
|
+
if (!this.r2i_1.equals(tmp0_other_with_cast.r2i_1))
|
|
1731
|
+
return false;
|
|
1732
|
+
if (!this.s2i_1.equals(tmp0_other_with_cast.s2i_1))
|
|
1733
|
+
return false;
|
|
1734
|
+
return true;
|
|
1735
|
+
};
|
|
1736
|
+
function BT2020TransferFunctions() {
|
|
1737
|
+
BT2020TransferFunctions_instance = this;
|
|
1738
|
+
this.w2i_1 = 1.0993;
|
|
1739
|
+
this.x2i_1 = 0.0181;
|
|
1740
|
+
var tmp = this;
|
|
1741
|
+
var tmp$ret$0;
|
|
1742
|
+
// Inline function 'kotlin.math.pow' call
|
|
1743
|
+
var tmp0_pow = 0.0181;
|
|
1744
|
+
tmp$ret$0 = Math.pow(tmp0_pow, 0.45);
|
|
1745
|
+
tmp.y2i_1 = 1.0993 * tmp$ret$0 - 0.09929999999999994;
|
|
1746
|
+
}
|
|
1747
|
+
protoOf(BT2020TransferFunctions).v2g = function (x) {
|
|
1748
|
+
return numberToDouble(x < this.y2i_1 ? x / 4.5 : spow_0((x + 0.09929999999999994) / 1.0993, 2.2222222222222223));
|
|
1749
|
+
};
|
|
1750
|
+
protoOf(BT2020TransferFunctions).w2g = function (x) {
|
|
1751
|
+
return x < 0.0181 ? 4.5 * x : 1.0993 * spow(x, 0.45) - 0.09929999999999994;
|
|
1752
|
+
};
|
|
1753
|
+
var BT2020TransferFunctions_instance;
|
|
1754
|
+
function BT2020TransferFunctions_getInstance() {
|
|
1755
|
+
if (BT2020TransferFunctions_instance == null)
|
|
1756
|
+
new BT2020TransferFunctions();
|
|
1757
|
+
return BT2020TransferFunctions_instance;
|
|
1758
|
+
}
|
|
1759
|
+
var properties_initialized_RGBColorSpaces_kt_fsnpad;
|
|
1760
|
+
function _init_properties_RGBColorSpaces_kt__nc9fsz() {
|
|
1761
|
+
if (properties_initialized_RGBColorSpaces_kt_fsnpad) {
|
|
1762
|
+
} else {
|
|
1763
|
+
properties_initialized_RGBColorSpaces_kt_fsnpad = true;
|
|
1764
|
+
SRGB_R = xyY_init_$Create$(0.64, 0.33);
|
|
1765
|
+
SRGB_G = xyY_init_$Create$(0.3, 0.6);
|
|
1766
|
+
SRGB_B = xyY_init_$Create$(0.15, 0.06);
|
|
1767
|
+
ACES_WHITE_POINT = new WhitePoint('ACES', xyY_init_$Create$(0.32168, 0.33767));
|
|
1768
|
+
ACES_AP0_R = xyY_init_$Create$(0.7347, 0.2653);
|
|
1769
|
+
ACES_AP0_G = xyY_init_$Create$(0.0, 1.0);
|
|
1770
|
+
ACES_AP0_B = xyY_init_$Create$(1.0E-4, -0.077);
|
|
1771
|
+
ACES_AP1_R = xyY_init_$Create$(0.713, 0.293);
|
|
1772
|
+
ACES_AP1_G = xyY_init_$Create$(0.165, 0.83);
|
|
1773
|
+
ACES_AP1_B = xyY_init_$Create$(0.128, 0.044);
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
function _RGBInt___init__impl__lqova7(argb) {
|
|
1777
|
+
return argb;
|
|
1778
|
+
}
|
|
1779
|
+
function _RGBInt___get_argb__impl__xiee7i($this) {
|
|
1780
|
+
return $this;
|
|
1781
|
+
}
|
|
1782
|
+
function _RGBInt___init__impl__lqova7_0(r, g, b, alpha) {
|
|
1783
|
+
alpha = alpha === VOID ? 255 : alpha;
|
|
1784
|
+
var tmp$ret$9;
|
|
1785
|
+
// Inline function 'kotlin.UInt.or' call
|
|
1786
|
+
var tmp$ret$7;
|
|
1787
|
+
// Inline function 'kotlin.UInt.or' call
|
|
1788
|
+
var tmp$ret$4;
|
|
1789
|
+
// Inline function 'kotlin.UInt.or' call
|
|
1790
|
+
var tmp$ret$1;
|
|
1791
|
+
// Inline function 'kotlin.UInt.shl' call
|
|
1792
|
+
var tmp$ret$0;
|
|
1793
|
+
// Inline function 'kotlin.toUInt' call
|
|
1794
|
+
tmp$ret$0 = _UInt___init__impl__l7qpdl(alpha);
|
|
1795
|
+
var tmp0_shl = tmp$ret$0;
|
|
1796
|
+
tmp$ret$1 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp0_shl) << 24);
|
|
1797
|
+
var tmp2_or = tmp$ret$1;
|
|
1798
|
+
var tmp$ret$3;
|
|
1799
|
+
// Inline function 'kotlin.UInt.shl' call
|
|
1800
|
+
var tmp$ret$2;
|
|
1801
|
+
// Inline function 'kotlin.toUInt' call
|
|
1802
|
+
tmp$ret$2 = _UInt___init__impl__l7qpdl(r);
|
|
1803
|
+
var tmp1_shl = tmp$ret$2;
|
|
1804
|
+
tmp$ret$3 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp1_shl) << 16);
|
|
1805
|
+
var tmp3_or = tmp$ret$3;
|
|
1806
|
+
tmp$ret$4 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp2_or) | _UInt___get_data__impl__f0vqqw(tmp3_or));
|
|
1807
|
+
var tmp5_or = tmp$ret$4;
|
|
1808
|
+
var tmp$ret$6;
|
|
1809
|
+
// Inline function 'kotlin.UInt.shl' call
|
|
1810
|
+
var tmp$ret$5;
|
|
1811
|
+
// Inline function 'kotlin.toUInt' call
|
|
1812
|
+
tmp$ret$5 = _UInt___init__impl__l7qpdl(g);
|
|
1813
|
+
var tmp4_shl = tmp$ret$5;
|
|
1814
|
+
tmp$ret$6 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp4_shl) << 8);
|
|
1815
|
+
var tmp6_or = tmp$ret$6;
|
|
1816
|
+
tmp$ret$7 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp5_or) | _UInt___get_data__impl__f0vqqw(tmp6_or));
|
|
1817
|
+
var tmp7_or = tmp$ret$7;
|
|
1818
|
+
var tmp$ret$8;
|
|
1819
|
+
// Inline function 'kotlin.toUInt' call
|
|
1820
|
+
tmp$ret$8 = _UInt___init__impl__l7qpdl(b);
|
|
1821
|
+
var tmp8_or = tmp$ret$8;
|
|
1822
|
+
tmp$ret$9 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp7_or) | _UInt___get_data__impl__f0vqqw(tmp8_or));
|
|
1823
|
+
var tmp = _RGBInt___init__impl__lqova7(tmp$ret$9);
|
|
1824
|
+
return tmp;
|
|
1825
|
+
}
|
|
1826
|
+
function _RGBInt___init__impl__lqova7_1(r, g, b, alpha) {
|
|
1827
|
+
alpha = alpha === VOID ? 1.0 : alpha;
|
|
1828
|
+
var tmp;
|
|
1829
|
+
if (isNaN_0(r)) {
|
|
1830
|
+
tmp = 0;
|
|
1831
|
+
} else {
|
|
1832
|
+
var tmp$ret$0;
|
|
1833
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
1834
|
+
var tmp0_roundToInt = r * 255;
|
|
1835
|
+
tmp$ret$0 = roundToInt(tmp0_roundToInt);
|
|
1836
|
+
tmp = coerceIn(tmp$ret$0, 0, 255);
|
|
1837
|
+
}
|
|
1838
|
+
var tmp_0 = tmp;
|
|
1839
|
+
var tmp_1;
|
|
1840
|
+
if (isNaN_0(b)) {
|
|
1841
|
+
tmp_1 = 0;
|
|
1842
|
+
} else {
|
|
1843
|
+
var tmp$ret$1;
|
|
1844
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
1845
|
+
var tmp1_roundToInt = g * 255;
|
|
1846
|
+
tmp$ret$1 = roundToInt(tmp1_roundToInt);
|
|
1847
|
+
tmp_1 = coerceIn(tmp$ret$1, 0, 255);
|
|
1848
|
+
}
|
|
1849
|
+
var tmp_2 = tmp_1;
|
|
1850
|
+
var tmp_3;
|
|
1851
|
+
if (isNaN_0(g)) {
|
|
1852
|
+
tmp_3 = 0;
|
|
1853
|
+
} else {
|
|
1854
|
+
var tmp$ret$2;
|
|
1855
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
1856
|
+
var tmp2_roundToInt = b * 255;
|
|
1857
|
+
tmp$ret$2 = roundToInt(tmp2_roundToInt);
|
|
1858
|
+
tmp_3 = coerceIn(tmp$ret$2, 0, 255);
|
|
1859
|
+
}
|
|
1860
|
+
var tmp_4 = tmp_3;
|
|
1861
|
+
var tmp$ret$3;
|
|
1862
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
1863
|
+
var tmp3_roundToInt = alpha * 255;
|
|
1864
|
+
tmp$ret$3 = roundToInt(tmp3_roundToInt);
|
|
1865
|
+
var tmp_5 = _RGBInt___init__impl__lqova7_0(tmp_0, tmp_2, tmp_4, coerceIn(tmp$ret$3, 0, 255));
|
|
1866
|
+
return tmp_5;
|
|
1867
|
+
}
|
|
1868
|
+
function _RGBInt___get_r__impl__dulq0e($this) {
|
|
1869
|
+
var tmp$ret$2;
|
|
1870
|
+
// Inline function 'kotlin.UInt.toUByte' call
|
|
1871
|
+
var tmp$ret$0;
|
|
1872
|
+
// Inline function 'kotlin.UInt.shr' call
|
|
1873
|
+
var tmp0_shr = _RGBInt___get_argb__impl__xiee7i($this);
|
|
1874
|
+
tmp$ret$0 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp0_shr) >>> 16 | 0);
|
|
1875
|
+
var tmp2_toUByte = tmp$ret$0;
|
|
1876
|
+
var tmp$ret$1;
|
|
1877
|
+
// Inline function 'kotlin.toUByte' call
|
|
1878
|
+
var tmp1_toUByte = _UInt___get_data__impl__f0vqqw(tmp2_toUByte);
|
|
1879
|
+
tmp$ret$1 = _UByte___init__impl__g9hnc4(toByte(tmp1_toUByte));
|
|
1880
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1881
|
+
return tmp$ret$2;
|
|
1882
|
+
}
|
|
1883
|
+
function _RGBInt___get_g__impl__o93c71($this) {
|
|
1884
|
+
var tmp$ret$2;
|
|
1885
|
+
// Inline function 'kotlin.UInt.toUByte' call
|
|
1886
|
+
var tmp$ret$0;
|
|
1887
|
+
// Inline function 'kotlin.UInt.shr' call
|
|
1888
|
+
var tmp0_shr = _RGBInt___get_argb__impl__xiee7i($this);
|
|
1889
|
+
tmp$ret$0 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp0_shr) >>> 8 | 0);
|
|
1890
|
+
var tmp2_toUByte = tmp$ret$0;
|
|
1891
|
+
var tmp$ret$1;
|
|
1892
|
+
// Inline function 'kotlin.toUByte' call
|
|
1893
|
+
var tmp1_toUByte = _UInt___get_data__impl__f0vqqw(tmp2_toUByte);
|
|
1894
|
+
tmp$ret$1 = _UByte___init__impl__g9hnc4(toByte(tmp1_toUByte));
|
|
1895
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1896
|
+
return tmp$ret$2;
|
|
1897
|
+
}
|
|
1898
|
+
function _RGBInt___get_b__impl__m772ua($this) {
|
|
1899
|
+
var tmp$ret$2;
|
|
1900
|
+
// Inline function 'kotlin.UInt.toUByte' call
|
|
1901
|
+
var tmp$ret$0;
|
|
1902
|
+
// Inline function 'kotlin.UInt.shr' call
|
|
1903
|
+
var tmp0_shr = _RGBInt___get_argb__impl__xiee7i($this);
|
|
1904
|
+
tmp$ret$0 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(tmp0_shr) >>> 0 | 0);
|
|
1905
|
+
var tmp2_toUByte = tmp$ret$0;
|
|
1906
|
+
var tmp$ret$1;
|
|
1907
|
+
// Inline function 'kotlin.toUByte' call
|
|
1908
|
+
var tmp1_toUByte = _UInt___get_data__impl__f0vqqw(tmp2_toUByte);
|
|
1909
|
+
tmp$ret$1 = _UByte___init__impl__g9hnc4(toByte(tmp1_toUByte));
|
|
1910
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1911
|
+
return tmp$ret$2;
|
|
1912
|
+
}
|
|
1913
|
+
function Companion_2() {
|
|
1914
|
+
Companion_instance_2 = this;
|
|
1915
|
+
this.z2i_1 = XYZColorSpaces_getInstance().s2e_1;
|
|
1916
|
+
}
|
|
1917
|
+
protoOf(Companion_2).l2f = function () {
|
|
1918
|
+
return this.z2i_1.l2f();
|
|
1919
|
+
};
|
|
1920
|
+
protoOf(Companion_2).p2e = function () {
|
|
1921
|
+
return this.z2i_1.p2e();
|
|
1922
|
+
};
|
|
1923
|
+
protoOf(Companion_2).o2e = function (color) {
|
|
1924
|
+
return this.z2i_1.o2e(color);
|
|
1925
|
+
};
|
|
1926
|
+
protoOf(Companion_2).x2g = function (x, y, z, alpha) {
|
|
1927
|
+
return this.z2i_1.x2g(x, y, z, alpha);
|
|
1928
|
+
};
|
|
1929
|
+
protoOf(Companion_2).z2g = function (x, y, z, alpha) {
|
|
1930
|
+
return this.z2i_1.z2g(x, y, z, alpha);
|
|
1931
|
+
};
|
|
1932
|
+
var Companion_instance_2;
|
|
1933
|
+
function Companion_getInstance_2() {
|
|
1934
|
+
if (Companion_instance_2 == null)
|
|
1935
|
+
new Companion_2();
|
|
1936
|
+
return Companion_instance_2;
|
|
1937
|
+
}
|
|
1938
|
+
function adaptToM($this, space, m, mi) {
|
|
1939
|
+
if (space.p2e().equals($this.h2e_1.p2e()))
|
|
1940
|
+
return $this;
|
|
1941
|
+
var transform = chromaticAdaptationMatrix(space, $this.h2e_1.p2e().y2f_1, m, mi);
|
|
1942
|
+
var tmp$ret$1;
|
|
1943
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1944
|
+
var tmp0_dot = $this.d2e_1;
|
|
1945
|
+
var tmp1_dot = $this.e2e_1;
|
|
1946
|
+
var tmp2_dot = $this.f2e_1;
|
|
1947
|
+
var tmp$ret$0;
|
|
1948
|
+
// Inline function 'com.github.ajalt.colormath.model.XYZ.adaptToM.<anonymous>' call
|
|
1949
|
+
var tmp3__anonymous__ufb84q = Matrix__get_impl_xogbpk(transform, 0, 0) * tmp0_dot + Matrix__get_impl_xogbpk(transform, 1, 0) * tmp1_dot + Matrix__get_impl_xogbpk(transform, 2, 0) * tmp2_dot;
|
|
1950
|
+
var tmp4__anonymous__pkmkx7 = Matrix__get_impl_xogbpk(transform, 0, 1) * tmp0_dot + Matrix__get_impl_xogbpk(transform, 1, 1) * tmp1_dot + Matrix__get_impl_xogbpk(transform, 2, 1) * tmp2_dot;
|
|
1951
|
+
var tmp5__anonymous__kpxxpo = Matrix__get_impl_xogbpk(transform, 0, 2) * tmp0_dot + Matrix__get_impl_xogbpk(transform, 1, 2) * tmp1_dot + Matrix__get_impl_xogbpk(transform, 2, 2) * tmp2_dot;
|
|
1952
|
+
tmp$ret$0 = space.x2g(tmp3__anonymous__ufb84q, tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo, $this.g2e_1);
|
|
1953
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1954
|
+
return tmp$ret$1;
|
|
1955
|
+
}
|
|
1956
|
+
function toLAB$f(t) {
|
|
1957
|
+
return t > get_CIE_E() ? cbrt(t) : (t * get_CIE_K() + 16) / 116;
|
|
1958
|
+
}
|
|
1959
|
+
function XYZ(x, y, z, alpha, space) {
|
|
1960
|
+
Companion_getInstance_2();
|
|
1961
|
+
this.d2e_1 = x;
|
|
1962
|
+
this.e2e_1 = y;
|
|
1963
|
+
this.f2e_1 = z;
|
|
1964
|
+
this.g2e_1 = alpha;
|
|
1965
|
+
this.h2e_1 = space;
|
|
1966
|
+
}
|
|
1967
|
+
protoOf(XYZ).t2d = function () {
|
|
1968
|
+
return this.g2e_1;
|
|
1969
|
+
};
|
|
1970
|
+
protoOf(XYZ).u2d = function () {
|
|
1971
|
+
return this.h2e_1;
|
|
1972
|
+
};
|
|
1973
|
+
protoOf(XYZ).u2e = function (space) {
|
|
1974
|
+
return adaptToM(this, space, get_CAT02_XYZ_TO_LMS(), get_CAT02_LMS_TO_XYZ());
|
|
1975
|
+
};
|
|
1976
|
+
protoOf(XYZ).w2h = function (space) {
|
|
1977
|
+
var tmp0_container = this.u2e(XYZColorSpace_0(space.p2e()));
|
|
1978
|
+
var x = tmp0_container.s2();
|
|
1979
|
+
var y = tmp0_container.t2();
|
|
1980
|
+
var z = tmp0_container.a2j();
|
|
1981
|
+
var f = space.m2g();
|
|
1982
|
+
var tmp$ret$1;
|
|
1983
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1984
|
+
var tmp0_dot = _Matrix___init__impl__q3kp4w(space.o2h());
|
|
1985
|
+
var tmp$ret$0;
|
|
1986
|
+
// Inline function 'com.github.ajalt.colormath.model.XYZ.toRGB.<anonymous>' call
|
|
1987
|
+
var tmp1__anonymous__uwfjfc = Matrix__get_impl_xogbpk(tmp0_dot, 0, 0) * x + Matrix__get_impl_xogbpk(tmp0_dot, 1, 0) * y + Matrix__get_impl_xogbpk(tmp0_dot, 2, 0) * z;
|
|
1988
|
+
var tmp2__anonymous__z9zvc9 = Matrix__get_impl_xogbpk(tmp0_dot, 0, 1) * x + Matrix__get_impl_xogbpk(tmp0_dot, 1, 1) * y + Matrix__get_impl_xogbpk(tmp0_dot, 2, 1) * z;
|
|
1989
|
+
var tmp3__anonymous__ufb84q = Matrix__get_impl_xogbpk(tmp0_dot, 0, 2) * x + Matrix__get_impl_xogbpk(tmp0_dot, 1, 2) * y + Matrix__get_impl_xogbpk(tmp0_dot, 2, 2) * z;
|
|
1990
|
+
tmp$ret$0 = space.x2g(f.w2g(tmp1__anonymous__uwfjfc), f.w2g(tmp2__anonymous__z9zvc9), f.w2g(tmp3__anonymous__ufb84q), this.g2e_1);
|
|
1991
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1992
|
+
return tmp$ret$1;
|
|
1993
|
+
};
|
|
1994
|
+
protoOf(XYZ).v2d = function () {
|
|
1995
|
+
return this.w2h(RGBColorSpaces_getInstance().z2e_1);
|
|
1996
|
+
};
|
|
1997
|
+
protoOf(XYZ).c2e = function () {
|
|
1998
|
+
var fx = toLAB$f(this.d2e_1 / this.h2e_1.p2e().y2f_1.f2h());
|
|
1999
|
+
var fy = toLAB$f(this.e2e_1 / this.h2e_1.p2e().y2f_1.e2h_1);
|
|
2000
|
+
var fz = toLAB$f(this.f2e_1 / this.h2e_1.p2e().y2f_1.g2h());
|
|
2001
|
+
var l = 116 * fy - 16;
|
|
2002
|
+
var a = 500 * (fx - fy);
|
|
2003
|
+
var b = 200 * (fy - fz);
|
|
2004
|
+
return LABColorSpace_0(this.h2e_1.p2e()).z2g(l, a, b, this.g2e_1);
|
|
2005
|
+
};
|
|
2006
|
+
protoOf(XYZ).w2d = function () {
|
|
2007
|
+
return this;
|
|
2008
|
+
};
|
|
2009
|
+
protoOf(XYZ).v7 = function () {
|
|
2010
|
+
var tmp$ret$0;
|
|
2011
|
+
// Inline function 'kotlin.floatArrayOf' call
|
|
2012
|
+
var tmp0_floatArrayOf = new Float32Array([this.d2e_1, this.e2e_1, this.f2e_1, this.g2e_1]);
|
|
2013
|
+
tmp$ret$0 = tmp0_floatArrayOf;
|
|
2014
|
+
return tmp$ret$0;
|
|
2015
|
+
};
|
|
2016
|
+
protoOf(XYZ).s2 = function () {
|
|
2017
|
+
return this.d2e_1;
|
|
2018
|
+
};
|
|
2019
|
+
protoOf(XYZ).t2 = function () {
|
|
2020
|
+
return this.e2e_1;
|
|
2021
|
+
};
|
|
2022
|
+
protoOf(XYZ).a2j = function () {
|
|
2023
|
+
return this.f2e_1;
|
|
2024
|
+
};
|
|
2025
|
+
protoOf(XYZ).toString = function () {
|
|
2026
|
+
return 'XYZ(x=' + this.d2e_1 + ', y=' + this.e2e_1 + ', z=' + this.f2e_1 + ', alpha=' + this.g2e_1 + ', space=' + this.h2e_1 + ')';
|
|
2027
|
+
};
|
|
2028
|
+
protoOf(XYZ).hashCode = function () {
|
|
2029
|
+
var result = getNumberHashCode(this.d2e_1);
|
|
2030
|
+
result = imul(result, 31) + getNumberHashCode(this.e2e_1) | 0;
|
|
2031
|
+
result = imul(result, 31) + getNumberHashCode(this.f2e_1) | 0;
|
|
2032
|
+
result = imul(result, 31) + getNumberHashCode(this.g2e_1) | 0;
|
|
2033
|
+
result = imul(result, 31) + hashCode(this.h2e_1) | 0;
|
|
2034
|
+
return result;
|
|
2035
|
+
};
|
|
2036
|
+
protoOf(XYZ).equals = function (other) {
|
|
2037
|
+
if (this === other)
|
|
2038
|
+
return true;
|
|
2039
|
+
if (!(other instanceof XYZ))
|
|
2040
|
+
return false;
|
|
2041
|
+
var tmp0_other_with_cast = other instanceof XYZ ? other : THROW_CCE();
|
|
2042
|
+
if (!equals(this.d2e_1, tmp0_other_with_cast.d2e_1))
|
|
2043
|
+
return false;
|
|
2044
|
+
if (!equals(this.e2e_1, tmp0_other_with_cast.e2e_1))
|
|
2045
|
+
return false;
|
|
2046
|
+
if (!equals(this.f2e_1, tmp0_other_with_cast.f2e_1))
|
|
2047
|
+
return false;
|
|
2048
|
+
if (!equals(this.g2e_1, tmp0_other_with_cast.g2e_1))
|
|
2049
|
+
return false;
|
|
2050
|
+
if (!equals(this.h2e_1, tmp0_other_with_cast.h2e_1))
|
|
2051
|
+
return false;
|
|
2052
|
+
return true;
|
|
2053
|
+
};
|
|
2054
|
+
function XYZColorSpace() {
|
|
2055
|
+
}
|
|
2056
|
+
function XYZColorSpace_0(whitePoint) {
|
|
2057
|
+
var tmp0_subject = whitePoint;
|
|
2058
|
+
return tmp0_subject.equals(Illuminant_getInstance().e2g_1) ? XYZColorSpaces_getInstance().s2e_1 : tmp0_subject.equals(Illuminant_getInstance().c2g_1) ? XYZColorSpaces_getInstance().t2e_1 : new XYZColorSpaceImpl(whitePoint);
|
|
2059
|
+
}
|
|
2060
|
+
function XYZColorSpaces() {
|
|
2061
|
+
XYZColorSpaces_instance = this;
|
|
2062
|
+
this.s2e_1 = new XYZColorSpaceImpl(Illuminant_getInstance().e2g_1);
|
|
2063
|
+
this.t2e_1 = new XYZColorSpaceImpl(Illuminant_getInstance().c2g_1);
|
|
2064
|
+
}
|
|
2065
|
+
var XYZColorSpaces_instance;
|
|
2066
|
+
function XYZColorSpaces_getInstance() {
|
|
2067
|
+
if (XYZColorSpaces_instance == null)
|
|
2068
|
+
new XYZColorSpaces();
|
|
2069
|
+
return XYZColorSpaces_instance;
|
|
2070
|
+
}
|
|
2071
|
+
function chromaticAdaptationMatrix(_this__u8e3s4, srcWp, xyzToLms, lmsToXyz) {
|
|
2072
|
+
xyzToLms = xyzToLms === VOID ? get_CAT02_XYZ_TO_LMS() : xyzToLms;
|
|
2073
|
+
lmsToXyz = lmsToXyz === VOID ? get_CAT02_LMS_TO_XYZ() : lmsToXyz;
|
|
2074
|
+
var dstWp = _this__u8e3s4.p2e().y2f_1;
|
|
2075
|
+
var src = dot_0(xyzToLms, srcWp.f2h(), srcWp.e2h_1, srcWp.g2h());
|
|
2076
|
+
var dst = dot_0(xyzToLms, dstWp.f2h(), dstWp.e2h_1, dstWp.g2h());
|
|
2077
|
+
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);
|
|
2078
|
+
}
|
|
2079
|
+
function XYZColorSpaceImpl(whitePoint) {
|
|
2080
|
+
this.b2j_1 = whitePoint;
|
|
2081
|
+
this.c2j_1 = rectangularComponentInfo('XYZ');
|
|
2082
|
+
}
|
|
2083
|
+
protoOf(XYZColorSpaceImpl).p2e = function () {
|
|
2084
|
+
return this.b2j_1;
|
|
2085
|
+
};
|
|
2086
|
+
protoOf(XYZColorSpaceImpl).l2f = function () {
|
|
2087
|
+
return 'XYZ';
|
|
2088
|
+
};
|
|
2089
|
+
protoOf(XYZColorSpaceImpl).o2e = function (color) {
|
|
2090
|
+
return color.w2d().u2e(this);
|
|
2091
|
+
};
|
|
2092
|
+
protoOf(XYZColorSpaceImpl).toString = function () {
|
|
2093
|
+
return 'XYZColorSpace(' + this.b2j_1 + ')';
|
|
2094
|
+
};
|
|
2095
|
+
protoOf(XYZColorSpaceImpl).x2g = function (x, y, z, alpha) {
|
|
2096
|
+
return new XYZ(x, y, z, alpha, this);
|
|
2097
|
+
};
|
|
2098
|
+
protoOf(XYZColorSpaceImpl).hashCode = function () {
|
|
2099
|
+
return this.b2j_1.hashCode();
|
|
2100
|
+
};
|
|
2101
|
+
protoOf(XYZColorSpaceImpl).equals = function (other) {
|
|
2102
|
+
if (this === other)
|
|
2103
|
+
return true;
|
|
2104
|
+
if (!(other instanceof XYZColorSpaceImpl))
|
|
2105
|
+
return false;
|
|
2106
|
+
var tmp0_other_with_cast = other instanceof XYZColorSpaceImpl ? other : THROW_CCE();
|
|
2107
|
+
if (!this.b2j_1.equals(tmp0_other_with_cast.b2j_1))
|
|
2108
|
+
return false;
|
|
2109
|
+
return true;
|
|
2110
|
+
};
|
|
2111
|
+
function xyY_init_$Init$(x, y, Y, $this) {
|
|
2112
|
+
Y = Y === VOID ? 1.0 : Y;
|
|
2113
|
+
xyY.call($this, numberToDouble(x), numberToDouble(y), numberToDouble(Y));
|
|
2114
|
+
return $this;
|
|
2115
|
+
}
|
|
2116
|
+
function xyY_init_$Create$(x, y, Y) {
|
|
2117
|
+
return xyY_init_$Init$(x, y, Y, objectCreate(protoOf(xyY)));
|
|
2118
|
+
}
|
|
2119
|
+
function xyY(x, y, Y) {
|
|
2120
|
+
Y = Y === VOID ? 1.0 : Y;
|
|
2121
|
+
this.c2h_1 = x;
|
|
2122
|
+
this.d2h_1 = y;
|
|
2123
|
+
this.e2h_1 = Y;
|
|
2124
|
+
}
|
|
2125
|
+
protoOf(xyY).m2i = function () {
|
|
2126
|
+
return 1 - this.c2h_1 - this.d2h_1;
|
|
2127
|
+
};
|
|
2128
|
+
protoOf(xyY).f2h = function () {
|
|
2129
|
+
return this.c2h_1 * this.e2h_1 / this.d2h_1;
|
|
2130
|
+
};
|
|
2131
|
+
protoOf(xyY).g2h = function () {
|
|
2132
|
+
return (1 - this.c2h_1 - this.d2h_1) * this.e2h_1 / this.d2h_1;
|
|
2133
|
+
};
|
|
2134
|
+
protoOf(xyY).toString = function () {
|
|
2135
|
+
return 'xyY(x=' + this.c2h_1 + ', y=' + this.d2h_1 + ', Y=' + this.e2h_1 + ')';
|
|
2136
|
+
};
|
|
2137
|
+
protoOf(xyY).hashCode = function () {
|
|
2138
|
+
var result = getNumberHashCode(this.c2h_1);
|
|
2139
|
+
result = imul(result, 31) + getNumberHashCode(this.d2h_1) | 0;
|
|
2140
|
+
result = imul(result, 31) + getNumberHashCode(this.e2h_1) | 0;
|
|
2141
|
+
return result;
|
|
2142
|
+
};
|
|
2143
|
+
protoOf(xyY).equals = function (other) {
|
|
2144
|
+
if (this === other)
|
|
2145
|
+
return true;
|
|
2146
|
+
if (!(other instanceof xyY))
|
|
2147
|
+
return false;
|
|
2148
|
+
var tmp0_other_with_cast = other instanceof xyY ? other : THROW_CCE();
|
|
2149
|
+
if (!equals(this.c2h_1, tmp0_other_with_cast.c2h_1))
|
|
2150
|
+
return false;
|
|
2151
|
+
if (!equals(this.d2h_1, tmp0_other_with_cast.d2h_1))
|
|
2152
|
+
return false;
|
|
2153
|
+
if (!equals(this.e2h_1, tmp0_other_with_cast.e2h_1))
|
|
2154
|
+
return false;
|
|
2155
|
+
return true;
|
|
2156
|
+
};
|
|
2157
|
+
function cbrt(float) {
|
|
2158
|
+
var tmp = Math.cbrt(float);
|
|
2159
|
+
return numberToDouble(isNumber(tmp) ? tmp : THROW_CCE());
|
|
2160
|
+
}
|
|
2161
|
+
//region block: post-declaration
|
|
2162
|
+
protoOf(LABColorSpaceImpl).z2g = invoke;
|
|
2163
|
+
protoOf(RGB).c2e = toLAB;
|
|
2164
|
+
protoOf(RGB).i2e = toLCHab;
|
|
2165
|
+
protoOf(SRGB).z2g = invoke_0;
|
|
2166
|
+
protoOf(BT2020Space).z2g = invoke_0;
|
|
2167
|
+
protoOf(RGBColorSpaceImpl).z2g = invoke_0;
|
|
2168
|
+
protoOf(Companion_2).b2h = invoke$default;
|
|
2169
|
+
protoOf(XYZ).i2e = toLCHab;
|
|
2170
|
+
protoOf(XYZColorSpaceImpl).z2g = invoke_1;
|
|
2171
|
+
protoOf(XYZColorSpaceImpl).b2h = invoke$default;
|
|
2172
|
+
//endregion
|
|
2173
|
+
//region block: init
|
|
2174
|
+
CIE_E = 0.008856451679035631;
|
|
2175
|
+
CIE_K = 903.2962962962963;
|
|
2176
|
+
CIE_E_times_K = 8.0;
|
|
2177
|
+
//endregion
|
|
2178
|
+
//region block: exports
|
|
2179
|
+
_.$_$ = _.$_$ || {};
|
|
2180
|
+
_.$_$.a = formatCssString;
|
|
2181
|
+
_.$_$.b = RenderCondition_ALWAYS_getInstance;
|
|
2182
|
+
_.$_$.c = Companion_getInstance_1;
|
|
11
2183
|
//endregion
|
|
12
2184
|
return _;
|
|
13
2185
|
}));
|