@flock/wirespec 0.15.2 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +11 -11
- package/arrow-arrow-core.mjs +101 -101
- package/arrow-arrow-core.mjs.map +1 -1
- package/clikt-clikt.mjs +1743 -1667
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +483 -464
- package/colormath-root-colormath.mjs.map +1 -1
- package/kotlin-kotlin-stdlib.mjs +1700 -1492
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +5037 -5033
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1916 -1911
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-io-kotlinx-io-core.mjs +544 -538
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1858 -1836
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1527 -1523
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/markdown.mjs +2031 -2028
- package/markdown.mjs.map +1 -1
- package/mordant-mordant.mjs +2173 -2045
- package/mordant-mordant.mjs.map +1 -1
- package/package.json +4 -2
- package/wirespec-src-compiler-core.mjs +2451 -2309
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +466 -460
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +555 -558
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-common.mjs +4 -0
- package/wirespec-src-converter-common.mjs.map +1 -0
- package/wirespec-src-converter-openapi.mjs +1287 -1227
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +264 -299
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +256 -154
- package/wirespec-src-plugin-cli.mjs.map +1 -1
- package/wirespec-src-plugin-npm.mjs +107 -111
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +55 -50
- package/wirespec-src-tools-generator.mjs.map +1 -1
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
12
12
|
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
13
13
|
toString14fd7g605f91p as toString_0,
|
|
14
|
-
|
|
14
|
+
Unit_instanceat14thlj150z as Unit_instance,
|
|
15
15
|
_Char___init__impl__6a9atx367vrx0avsvbg as _Char___init__impl__6a9atx,
|
|
16
16
|
arrayConcat3qsij7vh68m69 as arrayConcat,
|
|
17
17
|
listOf1jh22dvmctj1r as listOf,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getNumberHashCode2l4nbdcihl25f as getNumberHashCode,
|
|
26
26
|
numberToDouble210hrknaofnhf as numberToDouble,
|
|
27
27
|
roundToInt1ue8x8yshtznx as roundToInt,
|
|
28
|
-
|
|
28
|
+
DoubleCompanionObject_instance173s5lyb0q261 as DoubleCompanionObject_instance,
|
|
29
29
|
coerceInlzh524ulyz3c as coerceIn,
|
|
30
30
|
Char19o2r8palgjof as Char,
|
|
31
31
|
toInt5qdj874w69jh as toInt,
|
|
@@ -43,7 +43,7 @@ var log2 = Math.log2;
|
|
|
43
43
|
//endregion
|
|
44
44
|
//region block: pre-declaration
|
|
45
45
|
function toXYZ() {
|
|
46
|
-
return this.
|
|
46
|
+
return this.t2m().u2m();
|
|
47
47
|
}
|
|
48
48
|
initMetadataForInterface(Color, 'Color');
|
|
49
49
|
initMetadataForClass(ColorComponentInfo, 'ColorComponentInfo');
|
|
@@ -62,21 +62,21 @@ initMetadataForClass(GammaTransferFunctions, 'GammaTransferFunctions');
|
|
|
62
62
|
initMetadataForObject(LinearTransferFunctions, 'LinearTransferFunctions');
|
|
63
63
|
function invoke$default(r, g, b, alpha, $super) {
|
|
64
64
|
alpha = alpha === VOID ? 1.0 : alpha;
|
|
65
|
-
return $super === VOID ? this.
|
|
65
|
+
return $super === VOID ? this.e2o(r, g, b, alpha) : $super.e2o.call(this, r, g, b, alpha);
|
|
66
66
|
}
|
|
67
67
|
function invoke(r, g, b, alpha) {
|
|
68
|
-
return this.
|
|
68
|
+
return this.e2o(numberToDouble(r), numberToDouble(g), numberToDouble(b), numberToDouble(alpha));
|
|
69
69
|
}
|
|
70
70
|
function invoke$default_0(r, g, b, alpha, $super) {
|
|
71
71
|
alpha = alpha === VOID ? 1.0 : alpha;
|
|
72
|
-
return $super === VOID ? this.
|
|
72
|
+
return $super === VOID ? this.j2p(r, g, b, alpha) : invoke(r, g, b, alpha);
|
|
73
73
|
}
|
|
74
74
|
function from255(r, g, b, alpha) {
|
|
75
|
-
return this.
|
|
75
|
+
return this.e2o(r / 255.0, g / 255.0, b / 255.0, alpha / 255.0);
|
|
76
76
|
}
|
|
77
77
|
function from255$default(r, g, b, alpha, $super) {
|
|
78
78
|
alpha = alpha === VOID ? 255 : alpha;
|
|
79
|
-
return $super === VOID ? this.
|
|
79
|
+
return $super === VOID ? this.k2p(r, g, b, alpha) : from255(r, g, b, alpha);
|
|
80
80
|
}
|
|
81
81
|
function invoke_0(hex) {
|
|
82
82
|
var tmp = parseHex(validateHex(hex), 0);
|
|
@@ -84,6 +84,7 @@ function invoke_0(hex) {
|
|
|
84
84
|
var tmp_1 = parseHex(hex, 2);
|
|
85
85
|
var tmp_2;
|
|
86
86
|
// Inline function 'kotlin.let' call
|
|
87
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
87
88
|
// Inline function 'com.github.ajalt.colormath.model.RGBColorSpace.invoke.<anonymous>' call
|
|
88
89
|
var it = get_hexLength(hex);
|
|
89
90
|
if (it === 4 || it === 8) {
|
|
@@ -91,7 +92,7 @@ function invoke_0(hex) {
|
|
|
91
92
|
} else {
|
|
92
93
|
tmp_2 = 255;
|
|
93
94
|
}
|
|
94
|
-
return this.
|
|
95
|
+
return this.k2p(tmp, tmp_0, tmp_1, tmp_2);
|
|
95
96
|
}
|
|
96
97
|
initMetadataForInterface(RGBColorSpace, 'RGBColorSpace');
|
|
97
98
|
initMetadataForCompanion(Companion_2, VOID, [RGBColorSpace]);
|
|
@@ -115,27 +116,28 @@ initMetadataForClass(xyY, 'xyY');
|
|
|
115
116
|
function Color() {
|
|
116
117
|
}
|
|
117
118
|
function ColorComponentInfo(name, isPolar, min, max) {
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
121
|
-
this.
|
|
119
|
+
this.a2n_1 = name;
|
|
120
|
+
this.b2n_1 = isPolar;
|
|
121
|
+
this.c2n_1 = min;
|
|
122
|
+
this.d2n_1 = max;
|
|
122
123
|
// Inline function 'kotlin.require' call
|
|
123
|
-
|
|
124
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
125
|
+
if (!(this.c2n_1 <= this.d2n_1)) {
|
|
124
126
|
// Inline function 'com.github.ajalt.colormath.ColorComponentInfo.<anonymous>' call
|
|
125
127
|
var message = 'min must be less than or equal to max';
|
|
126
128
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
function WhitePoint(name, chromaticity) {
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
132
|
+
this.e2n_1 = name;
|
|
133
|
+
this.f2n_1 = chromaticity;
|
|
132
134
|
}
|
|
133
135
|
protoOf(WhitePoint).toString = function () {
|
|
134
|
-
return this.
|
|
136
|
+
return this.e2n_1;
|
|
135
137
|
};
|
|
136
138
|
protoOf(WhitePoint).hashCode = function () {
|
|
137
|
-
var result = getStringHashCode(this.
|
|
138
|
-
result = imul(result, 31) + this.
|
|
139
|
+
var result = getStringHashCode(this.e2n_1);
|
|
140
|
+
result = imul(result, 31) + this.f2n_1.hashCode() | 0;
|
|
139
141
|
return result;
|
|
140
142
|
};
|
|
141
143
|
protoOf(WhitePoint).equals = function (other) {
|
|
@@ -144,22 +146,22 @@ protoOf(WhitePoint).equals = function (other) {
|
|
|
144
146
|
if (!(other instanceof WhitePoint))
|
|
145
147
|
return false;
|
|
146
148
|
var tmp0_other_with_cast = other instanceof WhitePoint ? other : THROW_CCE();
|
|
147
|
-
if (!(this.
|
|
149
|
+
if (!(this.e2n_1 === tmp0_other_with_cast.e2n_1))
|
|
148
150
|
return false;
|
|
149
|
-
if (!this.
|
|
151
|
+
if (!this.f2n_1.equals(tmp0_other_with_cast.f2n_1))
|
|
150
152
|
return false;
|
|
151
153
|
return true;
|
|
152
154
|
};
|
|
153
155
|
function Illuminant() {
|
|
154
156
|
Illuminant_instance = this;
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
157
|
-
this.
|
|
158
|
-
this.
|
|
159
|
-
this.
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
157
|
+
this.g2n_1 = new WhitePoint('A', xyY_init_$Create$(0.44758, 0.40745));
|
|
158
|
+
this.h2n_1 = new WhitePoint('B', xyY_init_$Create$(0.34842, 0.35161));
|
|
159
|
+
this.i2n_1 = new WhitePoint('C', xyY_init_$Create$(0.31006, 0.31616));
|
|
160
|
+
this.j2n_1 = new WhitePoint('D50', xyY_init_$Create$(0.3457, 0.3585));
|
|
161
|
+
this.k2n_1 = new WhitePoint('D55', xyY_init_$Create$(0.33243, 0.34744));
|
|
162
|
+
this.l2n_1 = new WhitePoint('D65', xyY_init_$Create$(0.3127, 0.329));
|
|
163
|
+
this.m2n_1 = new WhitePoint('D75', xyY_init_$Create$(0.29903, 0.31488));
|
|
164
|
+
this.n2n_1 = new WhitePoint('E', xyY_init_$Create$(1.0 / 3.0, 1.0 / 3.0));
|
|
163
165
|
}
|
|
164
166
|
var Illuminant_instance;
|
|
165
167
|
function Illuminant_getInstance() {
|
|
@@ -175,9 +177,11 @@ var alphaInfo;
|
|
|
175
177
|
function zeroOneComponentInfo(name) {
|
|
176
178
|
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
177
179
|
// Inline function 'kotlin.collections.buildList' call
|
|
180
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
178
181
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
179
182
|
// Inline function 'kotlin.apply' call
|
|
180
183
|
var this_0 = ArrayList_init_$Create$();
|
|
184
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
181
185
|
// Inline function 'com.github.ajalt.colormath.internal.zeroOneComponentInfo.<anonymous>' call
|
|
182
186
|
// Inline function 'kotlin.text.mapTo' call
|
|
183
187
|
var inductionVariable = 0;
|
|
@@ -194,9 +198,11 @@ function zeroOneComponentInfo(name) {
|
|
|
194
198
|
function polarComponentInfo(name, l, r) {
|
|
195
199
|
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
196
200
|
// Inline function 'kotlin.collections.buildList' call
|
|
201
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
197
202
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
198
203
|
// Inline function 'kotlin.apply' call
|
|
199
204
|
var this_0 = ArrayList_init_$Create$();
|
|
205
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
200
206
|
// Inline function 'com.github.ajalt.colormath.internal.polarComponentInfo.<anonymous>' call
|
|
201
207
|
// Inline function 'kotlin.text.mapTo' call
|
|
202
208
|
var inductionVariable = 0;
|
|
@@ -246,8 +252,8 @@ function normalizeDeg(_this__u8e3s4) {
|
|
|
246
252
|
return (_this__u8e3s4 % 360.0 + 360.0) % 360.0;
|
|
247
253
|
}
|
|
248
254
|
function spow_0(_this__u8e3s4, p) {
|
|
249
|
-
// Inline function 'kotlin.math.absoluteValue' call
|
|
250
255
|
// Inline function 'kotlin.math.pow' call
|
|
256
|
+
// Inline function 'kotlin.math.absoluteValue' call
|
|
251
257
|
var this_0 = Math.abs(_this__u8e3s4);
|
|
252
258
|
var tmp$ret$1 = Math.pow(this_0, p);
|
|
253
259
|
return withSign(tmp$ret$1, _this__u8e3s4);
|
|
@@ -290,22 +296,22 @@ function Matrix__hashCode_impl_s9ntm9($this) {
|
|
|
290
296
|
function Matrix__equals_impl_g5p8p9($this, other) {
|
|
291
297
|
if (!(other instanceof Matrix))
|
|
292
298
|
return false;
|
|
293
|
-
var tmp0_other_with_cast = other instanceof Matrix ? other.
|
|
299
|
+
var tmp0_other_with_cast = other instanceof Matrix ? other.o2n_1 : THROW_CCE();
|
|
294
300
|
if (!equals($this, tmp0_other_with_cast))
|
|
295
301
|
return false;
|
|
296
302
|
return true;
|
|
297
303
|
}
|
|
298
304
|
function Matrix(rowMajor) {
|
|
299
|
-
this.
|
|
305
|
+
this.o2n_1 = rowMajor;
|
|
300
306
|
}
|
|
301
307
|
protoOf(Matrix).toString = function () {
|
|
302
|
-
return Matrix__toString_impl_l0abk0(this.
|
|
308
|
+
return Matrix__toString_impl_l0abk0(this.o2n_1);
|
|
303
309
|
};
|
|
304
310
|
protoOf(Matrix).hashCode = function () {
|
|
305
|
-
return Matrix__hashCode_impl_s9ntm9(this.
|
|
311
|
+
return Matrix__hashCode_impl_s9ntm9(this.o2n_1);
|
|
306
312
|
};
|
|
307
313
|
protoOf(Matrix).equals = function (other) {
|
|
308
|
-
return Matrix__equals_impl_g5p8p9(this.
|
|
314
|
+
return Matrix__equals_impl_g5p8p9(this.o2n_1, other);
|
|
309
315
|
};
|
|
310
316
|
function inverse(_this__u8e3s4, inPlace) {
|
|
311
317
|
inPlace = inPlace === VOID ? false : inPlace;
|
|
@@ -376,21 +382,20 @@ function _Vector___get_s__impl__pzuljk($this) {
|
|
|
376
382
|
}
|
|
377
383
|
function dot_0(_this__u8e3s4, v0, v1, v2) {
|
|
378
384
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
379
|
-
var
|
|
380
|
-
var
|
|
381
|
-
// Inline function 'com.github.ajalt.colormath.internal.dot.stub_for_inlining' call
|
|
385
|
+
var p0 = 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;
|
|
386
|
+
var p1 = 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;
|
|
382
387
|
var p2 = 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;
|
|
383
|
-
return _Vector___init__impl__y7x4qq_0(
|
|
388
|
+
return _Vector___init__impl__y7x4qq_0(p0, p1, p2);
|
|
384
389
|
}
|
|
385
390
|
function dot$f($this_dot, $other, x, y) {
|
|
386
391
|
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);
|
|
387
392
|
}
|
|
388
393
|
function Companion() {
|
|
389
394
|
Companion_instance = this;
|
|
390
|
-
this.
|
|
395
|
+
this.p2n_1 = componentInfoList([new ColorComponentInfo('code', false, 30.0, 107.0)]);
|
|
391
396
|
}
|
|
392
|
-
protoOf(Companion).
|
|
393
|
-
return this.
|
|
397
|
+
protoOf(Companion).q2n = function () {
|
|
398
|
+
return this.p2n_1;
|
|
394
399
|
};
|
|
395
400
|
var Companion_instance;
|
|
396
401
|
function Companion_getInstance() {
|
|
@@ -400,38 +405,38 @@ function Companion_getInstance() {
|
|
|
400
405
|
}
|
|
401
406
|
function Ansi16(code) {
|
|
402
407
|
Companion_getInstance();
|
|
403
|
-
this.
|
|
408
|
+
this.r2n_1 = code;
|
|
404
409
|
}
|
|
405
|
-
protoOf(Ansi16).
|
|
410
|
+
protoOf(Ansi16).s2m = function () {
|
|
406
411
|
return Companion_getInstance();
|
|
407
412
|
};
|
|
408
|
-
protoOf(Ansi16).
|
|
409
|
-
switch (this.
|
|
413
|
+
protoOf(Ansi16).t2m = function () {
|
|
414
|
+
switch (this.r2n_1) {
|
|
410
415
|
case 30:
|
|
411
416
|
case 40:
|
|
412
|
-
return Companion_getInstance_2().
|
|
417
|
+
return Companion_getInstance_2().s2n(0.0, 0.0, 0.0);
|
|
413
418
|
case 90:
|
|
414
419
|
case 100:
|
|
415
|
-
return Companion_getInstance_2().
|
|
420
|
+
return Companion_getInstance_2().t2n(128, 128, 128);
|
|
416
421
|
case 37:
|
|
417
422
|
case 47:
|
|
418
|
-
return Companion_getInstance_2().
|
|
423
|
+
return Companion_getInstance_2().t2n(192, 192, 192);
|
|
419
424
|
case 97:
|
|
420
425
|
case 107:
|
|
421
|
-
return Companion_getInstance_2().
|
|
426
|
+
return Companion_getInstance_2().s2n(1.0, 1.0, 1.0);
|
|
422
427
|
}
|
|
423
|
-
var color = this.
|
|
424
|
-
var mul = this.
|
|
428
|
+
var color = this.r2n_1 % 10 | 0;
|
|
429
|
+
var mul = this.r2n_1 > 50 ? 1.0 : 0.5;
|
|
425
430
|
var r = (color % 2 | 0) * mul;
|
|
426
431
|
var g = ((color / 2 | 0) % 2 | 0) * mul;
|
|
427
432
|
var b = ((color / 4 | 0) % 2 | 0) * mul;
|
|
428
|
-
return Companion_getInstance_2().
|
|
433
|
+
return Companion_getInstance_2().s2n(r, g, b);
|
|
429
434
|
};
|
|
430
435
|
protoOf(Ansi16).toString = function () {
|
|
431
|
-
return 'Ansi16(code=' + this.
|
|
436
|
+
return 'Ansi16(code=' + this.r2n_1 + ')';
|
|
432
437
|
};
|
|
433
438
|
protoOf(Ansi16).hashCode = function () {
|
|
434
|
-
return this.
|
|
439
|
+
return this.r2n_1;
|
|
435
440
|
};
|
|
436
441
|
protoOf(Ansi16).equals = function (other) {
|
|
437
442
|
if (this === other)
|
|
@@ -439,16 +444,16 @@ protoOf(Ansi16).equals = function (other) {
|
|
|
439
444
|
if (!(other instanceof Ansi16))
|
|
440
445
|
return false;
|
|
441
446
|
var tmp0_other_with_cast = other instanceof Ansi16 ? other : THROW_CCE();
|
|
442
|
-
if (!(this.
|
|
447
|
+
if (!(this.r2n_1 === tmp0_other_with_cast.r2n_1))
|
|
443
448
|
return false;
|
|
444
449
|
return true;
|
|
445
450
|
};
|
|
446
451
|
function Companion_0() {
|
|
447
452
|
Companion_instance_0 = this;
|
|
448
|
-
this.
|
|
453
|
+
this.u2n_1 = componentInfoList([new ColorComponentInfo('code', false, 0.0, 255.0)]);
|
|
449
454
|
}
|
|
450
|
-
protoOf(Companion_0).
|
|
451
|
-
return this.
|
|
455
|
+
protoOf(Companion_0).q2n = function () {
|
|
456
|
+
return this.u2n_1;
|
|
452
457
|
};
|
|
453
458
|
var Companion_instance_0;
|
|
454
459
|
function Companion_getInstance_0() {
|
|
@@ -458,19 +463,19 @@ function Companion_getInstance_0() {
|
|
|
458
463
|
}
|
|
459
464
|
function Ansi256(code) {
|
|
460
465
|
Companion_getInstance_0();
|
|
461
|
-
this.
|
|
466
|
+
this.v2n_1 = code;
|
|
462
467
|
}
|
|
463
|
-
protoOf(Ansi256).
|
|
468
|
+
protoOf(Ansi256).s2m = function () {
|
|
464
469
|
return Companion_getInstance_0();
|
|
465
470
|
};
|
|
466
|
-
protoOf(Ansi256).
|
|
467
|
-
if (this.
|
|
468
|
-
return this.
|
|
469
|
-
if (this.
|
|
470
|
-
var c = imul(this.
|
|
471
|
-
return Companion_getInstance_2().
|
|
471
|
+
protoOf(Ansi256).t2m = function () {
|
|
472
|
+
if (this.v2n_1 < 16)
|
|
473
|
+
return this.w2n().t2m();
|
|
474
|
+
if (this.v2n_1 >= 232) {
|
|
475
|
+
var c = imul(this.v2n_1 - 232 | 0, 10) + 8 | 0;
|
|
476
|
+
return Companion_getInstance_2().t2n(c, c, c);
|
|
472
477
|
}
|
|
473
|
-
var c_0 = this.
|
|
478
|
+
var c_0 = this.v2n_1 - 16 | 0;
|
|
474
479
|
var rem = c_0 % 36 | 0;
|
|
475
480
|
// Inline function 'kotlin.math.floor' call
|
|
476
481
|
var x = c_0 / 36.0;
|
|
@@ -479,16 +484,16 @@ protoOf(Ansi256).l2n = function () {
|
|
|
479
484
|
var x_0 = rem / 6.0;
|
|
480
485
|
var g = Math.floor(x_0) / 5.0;
|
|
481
486
|
var b = (rem % 6 | 0) / 5.0;
|
|
482
|
-
return Companion_getInstance_2().
|
|
487
|
+
return Companion_getInstance_2().x2n(r, g, b);
|
|
483
488
|
};
|
|
484
|
-
protoOf(Ansi256).
|
|
485
|
-
return this.
|
|
489
|
+
protoOf(Ansi256).w2n = function () {
|
|
490
|
+
return this.v2n_1 < 8 ? new Ansi16(this.v2n_1 + 30 | 0) : this.v2n_1 < 16 ? new Ansi16((this.v2n_1 - 8 | 0) + 90 | 0) : this.t2m().w2n();
|
|
486
491
|
};
|
|
487
492
|
protoOf(Ansi256).toString = function () {
|
|
488
|
-
return 'Ansi256(code=' + this.
|
|
493
|
+
return 'Ansi256(code=' + this.v2n_1 + ')';
|
|
489
494
|
};
|
|
490
495
|
protoOf(Ansi256).hashCode = function () {
|
|
491
|
-
return this.
|
|
496
|
+
return this.v2n_1;
|
|
492
497
|
};
|
|
493
498
|
protoOf(Ansi256).equals = function (other) {
|
|
494
499
|
if (this === other)
|
|
@@ -496,16 +501,16 @@ protoOf(Ansi256).equals = function (other) {
|
|
|
496
501
|
if (!(other instanceof Ansi256))
|
|
497
502
|
return false;
|
|
498
503
|
var tmp0_other_with_cast = other instanceof Ansi256 ? other : THROW_CCE();
|
|
499
|
-
if (!(this.
|
|
504
|
+
if (!(this.v2n_1 === tmp0_other_with_cast.v2n_1))
|
|
500
505
|
return false;
|
|
501
506
|
return true;
|
|
502
507
|
};
|
|
503
508
|
function Companion_1() {
|
|
504
509
|
Companion_instance_1 = this;
|
|
505
|
-
this.
|
|
510
|
+
this.y2n_1 = polarComponentInfo('HSV', 0.0, 1.0);
|
|
506
511
|
}
|
|
507
|
-
protoOf(Companion_1).
|
|
508
|
-
return this.
|
|
512
|
+
protoOf(Companion_1).q2n = function () {
|
|
513
|
+
return this.y2n_1;
|
|
509
514
|
};
|
|
510
515
|
var Companion_instance_1;
|
|
511
516
|
function Companion_getInstance_1() {
|
|
@@ -524,30 +529,30 @@ function toSRGB$f(h, v, s, n) {
|
|
|
524
529
|
function HSV(h, s, v, alpha) {
|
|
525
530
|
Companion_getInstance_1();
|
|
526
531
|
alpha = alpha === VOID ? 1.0 : alpha;
|
|
527
|
-
this.
|
|
528
|
-
this.
|
|
529
|
-
this.
|
|
530
|
-
this.
|
|
532
|
+
this.z2n_1 = h;
|
|
533
|
+
this.a2o_1 = s;
|
|
534
|
+
this.b2o_1 = v;
|
|
535
|
+
this.c2o_1 = alpha;
|
|
531
536
|
}
|
|
532
|
-
protoOf(HSV).
|
|
537
|
+
protoOf(HSV).s2m = function () {
|
|
533
538
|
return Companion_getInstance_1();
|
|
534
539
|
};
|
|
535
|
-
protoOf(HSV).
|
|
536
|
-
if (this.
|
|
537
|
-
return Companion_getInstance_2().
|
|
538
|
-
var v = this.
|
|
539
|
-
var h = normalizeDeg_0(this.
|
|
540
|
-
var s = this.
|
|
541
|
-
return SRGB_getInstance().
|
|
540
|
+
protoOf(HSV).t2m = function () {
|
|
541
|
+
if (this.a2o_1 < 1.0E-7)
|
|
542
|
+
return Companion_getInstance_2().e2o(this.b2o_1, this.b2o_1, this.b2o_1, this.c2o_1);
|
|
543
|
+
var v = this.b2o_1;
|
|
544
|
+
var h = normalizeDeg_0(this.z2n_1) / 60.0;
|
|
545
|
+
var s = this.a2o_1;
|
|
546
|
+
return SRGB_getInstance().e2o(toSRGB$f(h, v, s, 5), toSRGB$f(h, v, s, 3), toSRGB$f(h, v, s, 1), this.c2o_1);
|
|
542
547
|
};
|
|
543
548
|
protoOf(HSV).toString = function () {
|
|
544
|
-
return 'HSV(h=' + this.
|
|
549
|
+
return 'HSV(h=' + this.z2n_1 + ', s=' + this.a2o_1 + ', v=' + this.b2o_1 + ', alpha=' + this.c2o_1 + ')';
|
|
545
550
|
};
|
|
546
551
|
protoOf(HSV).hashCode = function () {
|
|
547
|
-
var result = getNumberHashCode(this.
|
|
548
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
549
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
550
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
552
|
+
var result = getNumberHashCode(this.z2n_1);
|
|
553
|
+
result = imul(result, 31) + getNumberHashCode(this.a2o_1) | 0;
|
|
554
|
+
result = imul(result, 31) + getNumberHashCode(this.b2o_1) | 0;
|
|
555
|
+
result = imul(result, 31) + getNumberHashCode(this.c2o_1) | 0;
|
|
551
556
|
return result;
|
|
552
557
|
};
|
|
553
558
|
protoOf(HSV).equals = function (other) {
|
|
@@ -556,13 +561,13 @@ protoOf(HSV).equals = function (other) {
|
|
|
556
561
|
if (!(other instanceof HSV))
|
|
557
562
|
return false;
|
|
558
563
|
var tmp0_other_with_cast = other instanceof HSV ? other : THROW_CCE();
|
|
559
|
-
if (!equals(this.
|
|
564
|
+
if (!equals(this.z2n_1, tmp0_other_with_cast.z2n_1))
|
|
560
565
|
return false;
|
|
561
|
-
if (!equals(this.
|
|
566
|
+
if (!equals(this.a2o_1, tmp0_other_with_cast.a2o_1))
|
|
562
567
|
return false;
|
|
563
|
-
if (!equals(this.
|
|
568
|
+
if (!equals(this.b2o_1, tmp0_other_with_cast.b2o_1))
|
|
564
569
|
return false;
|
|
565
|
-
if (!equals(this.
|
|
570
|
+
if (!equals(this.c2o_1, tmp0_other_with_cast.c2o_1))
|
|
566
571
|
return false;
|
|
567
572
|
return true;
|
|
568
573
|
};
|
|
@@ -604,46 +609,46 @@ var ICTCP_XYZ_TO_LMS;
|
|
|
604
609
|
var ICTCP_LMS_TO_XYZ;
|
|
605
610
|
function ICtCp() {
|
|
606
611
|
}
|
|
607
|
-
protoOf(ICtCp).
|
|
608
|
-
var fo = RGBColorSpaces_getInstance().
|
|
609
|
-
var tmp0 = get_ICTCP_ICTCP_to_LMS();
|
|
610
|
-
var tmp1 = this.y2o_1;
|
|
611
|
-
var tmp2 = this.z2o_1;
|
|
612
|
+
protoOf(ICtCp).k2o = function () {
|
|
613
|
+
var fo = RGBColorSpaces_getInstance().s2o_1.x2o();
|
|
612
614
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
613
|
-
var
|
|
614
|
-
var
|
|
615
|
-
var
|
|
615
|
+
var this_0 = get_ICTCP_ICTCP_to_LMS();
|
|
616
|
+
var v0 = this.g2o_1;
|
|
617
|
+
var v1 = this.h2o_1;
|
|
618
|
+
var v2 = this.i2o_1;
|
|
616
619
|
// Inline function 'com.github.ajalt.colormath.model.ICtCp.toBT2020.<anonymous>' call
|
|
617
|
-
var
|
|
618
|
-
var
|
|
619
|
-
var
|
|
620
|
-
var tmp2_0 = PqNonlinearity_instance.y2p(tmp5);
|
|
620
|
+
var l = Matrix__get_impl_xogbpk(this_0, 0, 0) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 0) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 0) * v2;
|
|
621
|
+
var m = Matrix__get_impl_xogbpk(this_0, 0, 1) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 1) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 1) * v2;
|
|
622
|
+
var s = Matrix__get_impl_xogbpk(this_0, 0, 2) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 2) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 2) * v2;
|
|
621
623
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
622
|
-
var
|
|
623
|
-
var
|
|
624
|
-
var
|
|
624
|
+
var this_1 = get_ICTCP_LMS_to_RGB();
|
|
625
|
+
var v0_0 = PqNonlinearity_instance.g2p(l);
|
|
626
|
+
var v1_0 = PqNonlinearity_instance.g2p(m);
|
|
627
|
+
var v2_0 = PqNonlinearity_instance.g2p(s);
|
|
625
628
|
// Inline function 'com.github.ajalt.colormath.model.ICtCp.toBT2020.<anonymous>.<anonymous>' call
|
|
626
|
-
var
|
|
627
|
-
|
|
629
|
+
var r = Matrix__get_impl_xogbpk(this_1, 0, 0) * v0_0 + Matrix__get_impl_xogbpk(this_1, 1, 0) * v1_0 + Matrix__get_impl_xogbpk(this_1, 2, 0) * v2_0;
|
|
630
|
+
var g = Matrix__get_impl_xogbpk(this_1, 0, 1) * v0_0 + Matrix__get_impl_xogbpk(this_1, 1, 1) * v1_0 + Matrix__get_impl_xogbpk(this_1, 2, 1) * v2_0;
|
|
631
|
+
var b = Matrix__get_impl_xogbpk(this_1, 0, 2) * v0_0 + Matrix__get_impl_xogbpk(this_1, 1, 2) * v1_0 + Matrix__get_impl_xogbpk(this_1, 2, 2) * v2_0;
|
|
632
|
+
return RGBColorSpaces_getInstance().s2o_1.e2o(fo.h2p(r), fo.h2p(g), fo.h2p(b), this.j2o_1);
|
|
628
633
|
};
|
|
629
634
|
function PqNonlinearity() {
|
|
630
|
-
this.
|
|
631
|
-
this.
|
|
632
|
-
this.
|
|
633
|
-
this.
|
|
634
|
-
this.
|
|
635
|
-
this.
|
|
636
|
-
this.
|
|
637
|
-
this.
|
|
638
|
-
}
|
|
639
|
-
protoOf(PqNonlinearity).
|
|
635
|
+
this.y2o_1 = 0.1593017578125;
|
|
636
|
+
this.z2o_1 = 78.84375;
|
|
637
|
+
this.a2p_1 = 0.8359375;
|
|
638
|
+
this.b2p_1 = 18.8515625;
|
|
639
|
+
this.c2p_1 = 18.6875;
|
|
640
|
+
this.d2p_1 = 10000.0;
|
|
641
|
+
this.e2p_1 = 6.277394636015326;
|
|
642
|
+
this.f2p_1 = 0.012683313515655966;
|
|
643
|
+
}
|
|
644
|
+
protoOf(PqNonlinearity).g2p = function (x) {
|
|
640
645
|
var vp = spow(x, 0.012683313515655966);
|
|
641
646
|
var n = coerceAtLeast(vp - 0.8359375, 0.0);
|
|
642
647
|
var tmp = n / (18.8515625 - 18.6875 * vp);
|
|
643
648
|
var l = spow_0(tmp, 6.277394636015326);
|
|
644
649
|
return 10000.0 * l;
|
|
645
650
|
};
|
|
646
|
-
protoOf(PqNonlinearity).
|
|
651
|
+
protoOf(PqNonlinearity).h2p = function (x) {
|
|
647
652
|
var tmp = x / 10000.0;
|
|
648
653
|
var yp = spow_0(tmp, 0.1593017578125);
|
|
649
654
|
var tmp_0 = 0.8359375 + 18.8515625 * yp;
|
|
@@ -669,19 +674,19 @@ function _init_properties_ICtCp_kt__7vx7or() {
|
|
|
669
674
|
}
|
|
670
675
|
}
|
|
671
676
|
function GammaTransferFunctions(gamma) {
|
|
672
|
-
this.
|
|
677
|
+
this.i2p_1 = gamma;
|
|
673
678
|
}
|
|
674
|
-
protoOf(GammaTransferFunctions).
|
|
675
|
-
return spow(x, this.
|
|
679
|
+
protoOf(GammaTransferFunctions).g2p = function (x) {
|
|
680
|
+
return spow(x, this.i2p_1);
|
|
676
681
|
};
|
|
677
|
-
protoOf(GammaTransferFunctions).
|
|
678
|
-
return spow(x, 1.0 / this.
|
|
682
|
+
protoOf(GammaTransferFunctions).h2p = function (x) {
|
|
683
|
+
return spow(x, 1.0 / this.i2p_1);
|
|
679
684
|
};
|
|
680
685
|
protoOf(GammaTransferFunctions).toString = function () {
|
|
681
|
-
return 'GammaTransferFunctions(gamma=' + this.
|
|
686
|
+
return 'GammaTransferFunctions(gamma=' + this.i2p_1 + ')';
|
|
682
687
|
};
|
|
683
688
|
protoOf(GammaTransferFunctions).hashCode = function () {
|
|
684
|
-
return getNumberHashCode(this.
|
|
689
|
+
return getNumberHashCode(this.i2p_1);
|
|
685
690
|
};
|
|
686
691
|
protoOf(GammaTransferFunctions).equals = function (other) {
|
|
687
692
|
if (this === other)
|
|
@@ -689,16 +694,16 @@ protoOf(GammaTransferFunctions).equals = function (other) {
|
|
|
689
694
|
if (!(other instanceof GammaTransferFunctions))
|
|
690
695
|
return false;
|
|
691
696
|
var tmp0_other_with_cast = other instanceof GammaTransferFunctions ? other : THROW_CCE();
|
|
692
|
-
if (!equals(this.
|
|
697
|
+
if (!equals(this.i2p_1, tmp0_other_with_cast.i2p_1))
|
|
693
698
|
return false;
|
|
694
699
|
return true;
|
|
695
700
|
};
|
|
696
701
|
function LinearTransferFunctions() {
|
|
697
702
|
}
|
|
698
|
-
protoOf(LinearTransferFunctions).
|
|
703
|
+
protoOf(LinearTransferFunctions).g2p = function (x) {
|
|
699
704
|
return x;
|
|
700
705
|
};
|
|
701
|
-
protoOf(LinearTransferFunctions).
|
|
706
|
+
protoOf(LinearTransferFunctions).h2p = function (x) {
|
|
702
707
|
return x;
|
|
703
708
|
};
|
|
704
709
|
var LinearTransferFunctions_instance;
|
|
@@ -709,43 +714,43 @@ function RGBColorSpace() {
|
|
|
709
714
|
}
|
|
710
715
|
function Companion_2() {
|
|
711
716
|
Companion_instance_2 = this;
|
|
712
|
-
this.
|
|
717
|
+
this.d2o_1 = RGBColorSpaces_getInstance().l2o_1;
|
|
713
718
|
}
|
|
714
|
-
protoOf(Companion_2).
|
|
715
|
-
return this.
|
|
719
|
+
protoOf(Companion_2).q2n = function () {
|
|
720
|
+
return this.d2o_1.q2n();
|
|
716
721
|
};
|
|
717
|
-
protoOf(Companion_2).
|
|
718
|
-
return this.
|
|
722
|
+
protoOf(Companion_2).m2p = function () {
|
|
723
|
+
return this.d2o_1.m2p();
|
|
719
724
|
};
|
|
720
|
-
protoOf(Companion_2).
|
|
721
|
-
return this.
|
|
725
|
+
protoOf(Companion_2).l2p = function () {
|
|
726
|
+
return this.d2o_1.l2p();
|
|
722
727
|
};
|
|
723
728
|
protoOf(Companion_2).s2 = function () {
|
|
724
|
-
return this.
|
|
729
|
+
return this.d2o_1.s2();
|
|
725
730
|
};
|
|
726
|
-
protoOf(Companion_2).
|
|
727
|
-
return this.
|
|
731
|
+
protoOf(Companion_2).x2o = function () {
|
|
732
|
+
return this.d2o_1.x2o();
|
|
728
733
|
};
|
|
729
|
-
protoOf(Companion_2).
|
|
730
|
-
return this.
|
|
734
|
+
protoOf(Companion_2).n2p = function () {
|
|
735
|
+
return this.d2o_1.n2p();
|
|
731
736
|
};
|
|
732
|
-
protoOf(Companion_2).
|
|
733
|
-
return this.
|
|
737
|
+
protoOf(Companion_2).k2p = function (r, g, b, alpha) {
|
|
738
|
+
return this.d2o_1.k2p(r, g, b, alpha);
|
|
734
739
|
};
|
|
735
|
-
protoOf(Companion_2).
|
|
736
|
-
return this.
|
|
740
|
+
protoOf(Companion_2).e2o = function (r, g, b, alpha) {
|
|
741
|
+
return this.d2o_1.e2o(r, g, b, alpha);
|
|
737
742
|
};
|
|
738
|
-
protoOf(Companion_2).
|
|
739
|
-
return this.
|
|
743
|
+
protoOf(Companion_2).j2p = function (r, g, b, alpha) {
|
|
744
|
+
return this.d2o_1.j2p(r, g, b, alpha);
|
|
740
745
|
};
|
|
741
|
-
protoOf(Companion_2).
|
|
742
|
-
return this.
|
|
746
|
+
protoOf(Companion_2).p2j = function (hex) {
|
|
747
|
+
return this.d2o_1.p2j(hex);
|
|
743
748
|
};
|
|
744
749
|
protoOf(Companion_2).equals = function (other) {
|
|
745
|
-
return equals(RGBColorSpaces_getInstance().
|
|
750
|
+
return equals(RGBColorSpaces_getInstance().l2o_1, other);
|
|
746
751
|
};
|
|
747
752
|
protoOf(Companion_2).hashCode = function () {
|
|
748
|
-
return hashCode(RGBColorSpaces_getInstance().
|
|
753
|
+
return hashCode(RGBColorSpaces_getInstance().l2o_1);
|
|
749
754
|
};
|
|
750
755
|
var Companion_instance_2;
|
|
751
756
|
function Companion_getInstance_2() {
|
|
@@ -754,47 +759,47 @@ function Companion_getInstance_2() {
|
|
|
754
759
|
return Companion_instance_2;
|
|
755
760
|
}
|
|
756
761
|
function clamp$copy(receiver, p0, p1, p2, p3) {
|
|
757
|
-
return receiver.
|
|
762
|
+
return receiver.o2p(p0, p1, p2, p3);
|
|
758
763
|
}
|
|
759
764
|
function RGB(r, g, b, alpha, space) {
|
|
760
765
|
Companion_getInstance_2();
|
|
761
|
-
this.
|
|
762
|
-
this.
|
|
763
|
-
this.
|
|
764
|
-
this.
|
|
765
|
-
this.
|
|
766
|
+
this.v2m_1 = r;
|
|
767
|
+
this.w2m_1 = g;
|
|
768
|
+
this.x2m_1 = b;
|
|
769
|
+
this.y2m_1 = alpha;
|
|
770
|
+
this.z2m_1 = space;
|
|
766
771
|
}
|
|
767
|
-
protoOf(RGB).
|
|
768
|
-
return this.
|
|
772
|
+
protoOf(RGB).s2m = function () {
|
|
773
|
+
return this.z2m_1;
|
|
769
774
|
};
|
|
770
|
-
protoOf(RGB).
|
|
775
|
+
protoOf(RGB).p2p = function () {
|
|
771
776
|
// Inline function 'kotlin.math.roundToInt' call
|
|
772
|
-
var this_0 = this.
|
|
777
|
+
var this_0 = this.v2m_1 * 255;
|
|
773
778
|
return roundToInt(this_0);
|
|
774
779
|
};
|
|
775
|
-
protoOf(RGB).
|
|
780
|
+
protoOf(RGB).q2p = function () {
|
|
776
781
|
// Inline function 'kotlin.math.roundToInt' call
|
|
777
|
-
var this_0 = this.
|
|
782
|
+
var this_0 = this.w2m_1 * 255;
|
|
778
783
|
return roundToInt(this_0);
|
|
779
784
|
};
|
|
780
|
-
protoOf(RGB).
|
|
785
|
+
protoOf(RGB).r2p = function () {
|
|
781
786
|
// Inline function 'kotlin.math.roundToInt' call
|
|
782
|
-
var this_0 = this.
|
|
787
|
+
var this_0 = this.x2m_1 * 255;
|
|
783
788
|
return roundToInt(this_0);
|
|
784
789
|
};
|
|
785
|
-
protoOf(RGB).
|
|
786
|
-
var f = SRGB_getInstance().
|
|
787
|
-
return equals(this.
|
|
790
|
+
protoOf(RGB).s2p = function (space) {
|
|
791
|
+
var f = SRGB_getInstance().x2o();
|
|
792
|
+
return equals(this.z2m_1, space) ? this : equals(this.z2m_1, SRGB_getInstance()) && equals(space, RGBColorSpaces_getInstance().m2o_1) ? space.e2o(f.g2p(this.v2m_1), f.g2p(this.w2m_1), f.g2p(this.x2m_1), this.y2m_1) : equals(this.z2m_1, RGBColorSpaces_getInstance().m2o_1) && equals(space, SRGB_getInstance()) ? space.e2o(f.h2p(this.v2m_1), f.h2p(this.w2m_1), f.h2p(this.x2m_1), this.y2m_1) : this.u2m().y2p(space);
|
|
788
793
|
};
|
|
789
|
-
protoOf(RGB).
|
|
794
|
+
protoOf(RGB).z2p = function () {
|
|
790
795
|
var tmp$ret$3;
|
|
791
796
|
$l$block: {
|
|
792
797
|
// Inline function 'com.github.ajalt.colormath.model.RGB.srgbHueMinMaxChroma' call
|
|
793
798
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
794
|
-
var $this$toSRGB = this.
|
|
795
|
-
var r = $this$toSRGB.
|
|
796
|
-
var g = $this$toSRGB.
|
|
797
|
-
var b = $this$toSRGB.
|
|
799
|
+
var $this$toSRGB = this.s2p(SRGB_getInstance());
|
|
800
|
+
var r = $this$toSRGB.v2m_1;
|
|
801
|
+
var g = $this$toSRGB.w2m_1;
|
|
802
|
+
var b = $this$toSRGB.x2m_1;
|
|
798
803
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
799
804
|
var min = Math.min(r, g, b);
|
|
800
805
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
@@ -816,81 +821,81 @@ protoOf(RGB).r2q = function () {
|
|
|
816
821
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toHSV.<anonymous>' call
|
|
817
822
|
var h_0 = normalizeDeg(h);
|
|
818
823
|
var s = max === 0.0 ? 0.0 : chroma / max;
|
|
819
|
-
tmp$ret$3 = new HSV(h_0, s, max, this.
|
|
824
|
+
tmp$ret$3 = new HSV(h_0, s, max, this.y2m_1);
|
|
820
825
|
break $l$block;
|
|
821
826
|
}
|
|
822
827
|
return tmp$ret$3;
|
|
823
828
|
};
|
|
824
|
-
protoOf(RGB).
|
|
825
|
-
var f = this.
|
|
826
|
-
var tmp0 = _Matrix___init__impl__q3kp4w(this.r2n_1.d2q());
|
|
827
|
-
var tmp1 = f.y2p(this.n2n_1);
|
|
828
|
-
var tmp2 = f.y2p(this.o2n_1);
|
|
829
|
+
protoOf(RGB).u2m = function () {
|
|
830
|
+
var f = this.z2m_1.x2o();
|
|
829
831
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
830
|
-
var
|
|
831
|
-
var
|
|
832
|
-
var
|
|
832
|
+
var this_0 = _Matrix___init__impl__q3kp4w(this.z2m_1.l2p());
|
|
833
|
+
var v0 = f.g2p(this.v2m_1);
|
|
834
|
+
var v1 = f.g2p(this.w2m_1);
|
|
835
|
+
var v2 = f.g2p(this.x2m_1);
|
|
833
836
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toXYZ.<anonymous>' call
|
|
834
|
-
var
|
|
835
|
-
|
|
837
|
+
var x = Matrix__get_impl_xogbpk(this_0, 0, 0) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 0) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 0) * v2;
|
|
838
|
+
var y = Matrix__get_impl_xogbpk(this_0, 0, 1) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 1) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 1) * v2;
|
|
839
|
+
var z = Matrix__get_impl_xogbpk(this_0, 0, 2) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 2) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 2) * v2;
|
|
840
|
+
return XYZColorSpace_0(this.z2m_1.n2p()).e2o(x, y, z, this.y2m_1);
|
|
836
841
|
};
|
|
837
|
-
protoOf(RGB).
|
|
842
|
+
protoOf(RGB).w2n = function () {
|
|
838
843
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
839
|
-
var $this$toSRGB = this.
|
|
844
|
+
var $this$toSRGB = this.s2p(SRGB_getInstance());
|
|
840
845
|
// Inline function 'kotlin.math.roundToInt' call
|
|
841
|
-
var this_0 = $this$toSRGB.
|
|
846
|
+
var this_0 = $this$toSRGB.z2p().b2o_1 * 100;
|
|
842
847
|
var value = roundToInt(this_0);
|
|
843
848
|
if (value === 30)
|
|
844
849
|
return new Ansi16(30);
|
|
845
850
|
var v = value / 50 | 0;
|
|
846
851
|
// Inline function 'kotlin.math.roundToInt' call
|
|
847
|
-
var this_1 = $this$toSRGB.
|
|
852
|
+
var this_1 = $this$toSRGB.x2m_1;
|
|
848
853
|
var tmp$ret$1 = roundToInt(this_1);
|
|
849
854
|
var tmp = imul(tmp$ret$1, 4);
|
|
850
855
|
// Inline function 'kotlin.math.roundToInt' call
|
|
851
|
-
var this_2 = $this$toSRGB.
|
|
856
|
+
var this_2 = $this$toSRGB.w2m_1;
|
|
852
857
|
var tmp$ret$2 = roundToInt(this_2);
|
|
853
858
|
var tmp_0 = tmp | imul(tmp$ret$2, 2);
|
|
854
859
|
// Inline function 'kotlin.math.roundToInt' call
|
|
855
|
-
var this_3 = $this$toSRGB.
|
|
860
|
+
var this_3 = $this$toSRGB.v2m_1;
|
|
856
861
|
var ansi = 30 + (tmp_0 | roundToInt(this_3)) | 0;
|
|
857
862
|
return new Ansi16(v === 2 ? ansi + 60 | 0 : ansi);
|
|
858
863
|
};
|
|
859
|
-
protoOf(RGB).
|
|
864
|
+
protoOf(RGB).a2q = function () {
|
|
860
865
|
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
861
|
-
var $this$toSRGB = this.
|
|
862
|
-
var ri = $this$toSRGB.
|
|
863
|
-
var gi = $this$toSRGB.
|
|
864
|
-
var bi = $this$toSRGB.
|
|
866
|
+
var $this$toSRGB = this.s2p(SRGB_getInstance());
|
|
867
|
+
var ri = $this$toSRGB.p2p();
|
|
868
|
+
var gi = $this$toSRGB.q2p();
|
|
869
|
+
var bi = $this$toSRGB.r2p();
|
|
865
870
|
var tmp;
|
|
866
871
|
if (ri === gi && gi === bi) {
|
|
867
872
|
tmp = ri < 8 ? 16 : ri > 248 ? 231 : roundToInt((ri - 8 | 0) / 247.0 * 24.0) + 232 | 0;
|
|
868
873
|
} else {
|
|
869
874
|
// Inline function 'kotlin.math.roundToInt' call
|
|
870
|
-
var this_0 = $this$toSRGB.
|
|
875
|
+
var this_0 = $this$toSRGB.v2m_1 * 5;
|
|
871
876
|
var tmp$ret$0 = roundToInt(this_0);
|
|
872
877
|
var tmp_0 = 16 + imul(36, tmp$ret$0) | 0;
|
|
873
878
|
// Inline function 'kotlin.math.roundToInt' call
|
|
874
|
-
var this_1 = $this$toSRGB.
|
|
879
|
+
var this_1 = $this$toSRGB.w2m_1 * 5;
|
|
875
880
|
var tmp$ret$1 = roundToInt(this_1);
|
|
876
881
|
var tmp_1 = tmp_0 + imul(6, tmp$ret$1) | 0;
|
|
877
882
|
// Inline function 'kotlin.math.roundToInt' call
|
|
878
|
-
var this_2 = $this$toSRGB.
|
|
883
|
+
var this_2 = $this$toSRGB.x2m_1 * 5;
|
|
879
884
|
tmp = tmp_1 + roundToInt(this_2) | 0;
|
|
880
885
|
}
|
|
881
886
|
var code = tmp;
|
|
882
887
|
return new Ansi256(code);
|
|
883
888
|
};
|
|
884
|
-
protoOf(RGB).
|
|
885
|
-
return this.
|
|
889
|
+
protoOf(RGB).t2m = function () {
|
|
890
|
+
return this.s2p(RGBColorSpaces_getInstance().l2o_1);
|
|
886
891
|
};
|
|
887
|
-
protoOf(RGB).
|
|
888
|
-
var tmp1 = this.n2n_1;
|
|
889
|
-
var tmp2 = this.o2n_1;
|
|
890
|
-
var tmp3 = this.p2n_1;
|
|
892
|
+
protoOf(RGB).b2q = function () {
|
|
891
893
|
// Inline function 'com.github.ajalt.colormath.internal.clamp3' call
|
|
892
|
-
var
|
|
893
|
-
var
|
|
894
|
+
var v1 = this.v2m_1;
|
|
895
|
+
var v2 = this.w2m_1;
|
|
896
|
+
var v3 = this.x2m_1;
|
|
897
|
+
var alpha = this.y2m_1;
|
|
898
|
+
var tmp0_container = this.s2m().q2n();
|
|
894
899
|
// Inline function 'kotlin.collections.component1' call
|
|
895
900
|
var c1 = tmp0_container.k(0);
|
|
896
901
|
// Inline function 'kotlin.collections.component2' call
|
|
@@ -901,16 +906,16 @@ protoOf(RGB).t2q = function () {
|
|
|
901
906
|
var tmp_0;
|
|
902
907
|
var tmp_1;
|
|
903
908
|
var tmp_2;
|
|
904
|
-
var containsLower = c1.
|
|
905
|
-
if (
|
|
906
|
-
var containsLower_0 = c2.
|
|
907
|
-
tmp_2 =
|
|
909
|
+
var containsLower = c1.c2n_1;
|
|
910
|
+
if (v1 <= c1.d2n_1 ? containsLower <= v1 : false) {
|
|
911
|
+
var containsLower_0 = c2.c2n_1;
|
|
912
|
+
tmp_2 = v2 <= c2.d2n_1 ? containsLower_0 <= v2 : false;
|
|
908
913
|
} else {
|
|
909
914
|
tmp_2 = false;
|
|
910
915
|
}
|
|
911
916
|
if (tmp_2) {
|
|
912
|
-
var containsLower_1 = c3.
|
|
913
|
-
tmp_1 =
|
|
917
|
+
var containsLower_1 = c3.c2n_1;
|
|
918
|
+
tmp_1 = v3 <= c3.d2n_1 ? containsLower_1 <= v3 : false;
|
|
914
919
|
} else {
|
|
915
920
|
tmp_1 = false;
|
|
916
921
|
}
|
|
@@ -922,30 +927,30 @@ protoOf(RGB).t2q = function () {
|
|
|
922
927
|
if (tmp_0) {
|
|
923
928
|
tmp = this;
|
|
924
929
|
} else {
|
|
925
|
-
tmp = clamp$copy(this, coerceIn(
|
|
930
|
+
tmp = clamp$copy(this, coerceIn(v1, c1.c2n_1, c1.d2n_1), coerceIn(v2, c2.c2n_1, c2.d2n_1), coerceIn(v3, c3.c2n_1, c3.d2n_1), coerceIn(alpha, 0.0, 1.0));
|
|
926
931
|
}
|
|
927
932
|
return tmp;
|
|
928
933
|
};
|
|
929
|
-
protoOf(RGB).
|
|
934
|
+
protoOf(RGB).c2q = function (r, g, b, alpha, space) {
|
|
930
935
|
return new RGB(r, g, b, alpha, space);
|
|
931
936
|
};
|
|
932
|
-
protoOf(RGB).
|
|
933
|
-
r = r === VOID ? this.
|
|
934
|
-
g = g === VOID ? this.
|
|
935
|
-
b = b === VOID ? this.
|
|
936
|
-
alpha = alpha === VOID ? this.
|
|
937
|
-
space = space === VOID ? this.
|
|
938
|
-
return $super === VOID ? this.
|
|
937
|
+
protoOf(RGB).o2p = function (r, g, b, alpha, space, $super) {
|
|
938
|
+
r = r === VOID ? this.v2m_1 : r;
|
|
939
|
+
g = g === VOID ? this.w2m_1 : g;
|
|
940
|
+
b = b === VOID ? this.x2m_1 : b;
|
|
941
|
+
alpha = alpha === VOID ? this.y2m_1 : alpha;
|
|
942
|
+
space = space === VOID ? this.z2m_1 : space;
|
|
943
|
+
return $super === VOID ? this.c2q(r, g, b, alpha, space) : $super.c2q.call(this, r, g, b, alpha, space);
|
|
939
944
|
};
|
|
940
945
|
protoOf(RGB).toString = function () {
|
|
941
|
-
return 'RGB(r=' + this.
|
|
946
|
+
return 'RGB(r=' + this.v2m_1 + ', g=' + this.w2m_1 + ', b=' + this.x2m_1 + ', alpha=' + this.y2m_1 + ', space=' + toString(this.z2m_1) + ')';
|
|
942
947
|
};
|
|
943
948
|
protoOf(RGB).hashCode = function () {
|
|
944
|
-
var result = getNumberHashCode(this.
|
|
945
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
946
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
947
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
948
|
-
result = imul(result, 31) + hashCode(this.
|
|
949
|
+
var result = getNumberHashCode(this.v2m_1);
|
|
950
|
+
result = imul(result, 31) + getNumberHashCode(this.w2m_1) | 0;
|
|
951
|
+
result = imul(result, 31) + getNumberHashCode(this.x2m_1) | 0;
|
|
952
|
+
result = imul(result, 31) + getNumberHashCode(this.y2m_1) | 0;
|
|
953
|
+
result = imul(result, 31) + hashCode(this.z2m_1) | 0;
|
|
949
954
|
return result;
|
|
950
955
|
};
|
|
951
956
|
protoOf(RGB).equals = function (other) {
|
|
@@ -954,15 +959,15 @@ protoOf(RGB).equals = function (other) {
|
|
|
954
959
|
if (!(other instanceof RGB))
|
|
955
960
|
return false;
|
|
956
961
|
var tmp0_other_with_cast = other instanceof RGB ? other : THROW_CCE();
|
|
957
|
-
if (!equals(this.
|
|
962
|
+
if (!equals(this.v2m_1, tmp0_other_with_cast.v2m_1))
|
|
958
963
|
return false;
|
|
959
|
-
if (!equals(this.
|
|
964
|
+
if (!equals(this.w2m_1, tmp0_other_with_cast.w2m_1))
|
|
960
965
|
return false;
|
|
961
|
-
if (!equals(this.
|
|
966
|
+
if (!equals(this.x2m_1, tmp0_other_with_cast.x2m_1))
|
|
962
967
|
return false;
|
|
963
|
-
if (!equals(this.
|
|
968
|
+
if (!equals(this.y2m_1, tmp0_other_with_cast.y2m_1))
|
|
964
969
|
return false;
|
|
965
|
-
if (!equals(this.
|
|
970
|
+
if (!equals(this.z2m_1, tmp0_other_with_cast.z2m_1))
|
|
966
971
|
return false;
|
|
967
972
|
return true;
|
|
968
973
|
};
|
|
@@ -974,6 +979,7 @@ function parseHex(_this__u8e3s4, startIndex) {
|
|
|
974
979
|
} else {
|
|
975
980
|
var i_0 = charSequenceGet(_this__u8e3s4, 0) === _Char___init__impl__6a9atx(35) ? startIndex + 1 | 0 : startIndex;
|
|
976
981
|
// Inline function 'kotlin.let' call
|
|
982
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
977
983
|
// Inline function 'com.github.ajalt.colormath.model.parseHex.<anonymous>' call
|
|
978
984
|
var it = charSequenceGet(_this__u8e3s4, i_0);
|
|
979
985
|
var tmp$ret$1 = toString_0(it) + toString_0(it);
|
|
@@ -983,12 +989,25 @@ function parseHex(_this__u8e3s4, startIndex) {
|
|
|
983
989
|
}
|
|
984
990
|
function validateHex(_this__u8e3s4) {
|
|
985
991
|
// Inline function 'kotlin.apply' call
|
|
992
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
986
993
|
// Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>' call
|
|
994
|
+
// Inline function 'kotlin.require' call
|
|
987
995
|
// Inline function 'kotlin.let' call
|
|
996
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
988
997
|
// Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>.<anonymous>' call
|
|
989
998
|
var it = get_hexLength(_this__u8e3s4);
|
|
990
|
-
|
|
991
|
-
|
|
999
|
+
switch (it) {
|
|
1000
|
+
case 3:
|
|
1001
|
+
case 4:
|
|
1002
|
+
case 6:
|
|
1003
|
+
var tmp$ret$0 = true;
|
|
1004
|
+
break;
|
|
1005
|
+
default:
|
|
1006
|
+
tmp$ret$0 = it === 8;
|
|
1007
|
+
break;
|
|
1008
|
+
}
|
|
1009
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1010
|
+
if (!tmp$ret$0) {
|
|
992
1011
|
// Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>.<anonymous>' call
|
|
993
1012
|
var message = 'Hex string must be in the format "#ffffff" or "ffffff"';
|
|
994
1013
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
@@ -1049,17 +1068,17 @@ function get_ACES_AP1_B() {
|
|
|
1049
1068
|
}
|
|
1050
1069
|
var ACES_AP1_B;
|
|
1051
1070
|
function RGBColorSpaces$SRGB$lambda($this$$receiver, it) {
|
|
1052
|
-
return it.
|
|
1071
|
+
return it.t2m();
|
|
1053
1072
|
}
|
|
1054
1073
|
function RGBColorSpaces$BT2020$lambda($this$$receiver, color) {
|
|
1055
1074
|
var tmp;
|
|
1056
1075
|
if (color instanceof RGB) {
|
|
1057
|
-
tmp = color.
|
|
1076
|
+
tmp = color.s2p($this$$receiver);
|
|
1058
1077
|
} else {
|
|
1059
1078
|
if (color instanceof ICtCp) {
|
|
1060
|
-
tmp = color.
|
|
1079
|
+
tmp = color.k2o();
|
|
1061
1080
|
} else {
|
|
1062
|
-
tmp = color.
|
|
1081
|
+
tmp = color.u2m().y2p($this$$receiver);
|
|
1063
1082
|
}
|
|
1064
1083
|
}
|
|
1065
1084
|
return tmp;
|
|
@@ -1067,29 +1086,29 @@ function RGBColorSpaces$BT2020$lambda($this$$receiver, color) {
|
|
|
1067
1086
|
function RGBColorSpaces() {
|
|
1068
1087
|
RGBColorSpaces_instance = this;
|
|
1069
1088
|
var tmp = this;
|
|
1070
|
-
var tmp_0 = Illuminant_getInstance().
|
|
1089
|
+
var tmp_0 = Illuminant_getInstance().l2n_1;
|
|
1071
1090
|
var tmp_1 = SRGBTransferFunctions_instance;
|
|
1072
1091
|
var tmp_2 = get_SRGB_R();
|
|
1073
1092
|
var tmp_3 = get_SRGB_G();
|
|
1074
1093
|
var tmp_4 = get_SRGB_B();
|
|
1075
|
-
tmp.
|
|
1076
|
-
this.
|
|
1077
|
-
this.
|
|
1078
|
-
this.
|
|
1079
|
-
this.
|
|
1080
|
-
this.
|
|
1081
|
-
this.
|
|
1094
|
+
tmp.l2o_1 = new RGBColorSpaceImpl('sRGB', tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, RGBColorSpaces$SRGB$lambda);
|
|
1095
|
+
this.m2o_1 = RGBColorSpace_0('Linear sRGB', Illuminant_getInstance().l2n_1, LinearTransferFunctions_instance, get_SRGB_R(), get_SRGB_G(), get_SRGB_B());
|
|
1096
|
+
this.n2o_1 = RGBColorSpace_0('ACES2065-1', get_ACES_WHITE_POINT(), LinearTransferFunctions_instance, get_ACES_AP0_R(), get_ACES_AP0_G(), get_ACES_AP0_B());
|
|
1097
|
+
this.o2o_1 = RGBColorSpace_0('ACEScc', get_ACES_WHITE_POINT(), ACESccTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1098
|
+
this.p2o_1 = RGBColorSpace_0('ACEScct', get_ACES_WHITE_POINT(), ACEScctTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1099
|
+
this.q2o_1 = RGBColorSpace_0('ACEScg', get_ACES_WHITE_POINT(), LinearTransferFunctions_instance, get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1100
|
+
this.r2o_1 = RGBColorSpace_0('Adobe RGB', Illuminant_getInstance().l2n_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));
|
|
1082
1101
|
var tmp_5 = this;
|
|
1083
|
-
var tmp_6 = Illuminant_getInstance().
|
|
1102
|
+
var tmp_6 = Illuminant_getInstance().l2n_1;
|
|
1084
1103
|
var tmp_7 = BT2020TransferFunctions_getInstance();
|
|
1085
1104
|
var tmp_8 = xyY_init_$Create$(0.708, 0.292);
|
|
1086
1105
|
var tmp_9 = xyY_init_$Create$(0.17, 0.797);
|
|
1087
1106
|
var tmp_10 = xyY_init_$Create$(0.131, 0.046);
|
|
1088
|
-
tmp_5.
|
|
1089
|
-
this.
|
|
1090
|
-
this.
|
|
1091
|
-
this.
|
|
1092
|
-
this.
|
|
1107
|
+
tmp_5.s2o_1 = new RGBColorSpaceImpl('BT.2020', tmp_6, tmp_7, tmp_8, tmp_9, tmp_10, RGBColorSpaces$BT2020$lambda);
|
|
1108
|
+
this.t2o_1 = RGBColorSpace_0('BT.709', Illuminant_getInstance().l2n_1, BT709TransferFunctions_getInstance(), xyY_init_$Create$(0.64, 0.33), xyY_init_$Create$(0.3, 0.6), xyY_init_$Create$(0.15, 0.06));
|
|
1109
|
+
this.u2o_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));
|
|
1110
|
+
this.v2o_1 = RGBColorSpace_0('Display P3', Illuminant_getInstance().l2n_1, SRGBTransferFunctions_instance, xyY_init_$Create$(0.68, 0.32), xyY_init_$Create$(0.265, 0.69), xyY_init_$Create$(0.15, 0.06));
|
|
1111
|
+
this.w2o_1 = RGBColorSpace_0('ROMM RGB', Illuminant_getInstance().j2n_1, ROMMTransferFunctions_instance, xyY_init_$Create$(0.7347, 0.2653), xyY_init_$Create$(0.1596, 0.8404), xyY_init_$Create$(0.0366, 1.0E-4));
|
|
1093
1112
|
}
|
|
1094
1113
|
var RGBColorSpaces_instance;
|
|
1095
1114
|
function RGBColorSpaces_getInstance() {
|
|
@@ -1099,43 +1118,43 @@ function RGBColorSpaces_getInstance() {
|
|
|
1099
1118
|
}
|
|
1100
1119
|
function SRGB() {
|
|
1101
1120
|
SRGB_instance = this;
|
|
1102
|
-
this.
|
|
1121
|
+
this.f2o_1 = RGBColorSpaces_getInstance().l2o_1;
|
|
1103
1122
|
}
|
|
1104
|
-
protoOf(SRGB).
|
|
1105
|
-
return this.
|
|
1123
|
+
protoOf(SRGB).q2n = function () {
|
|
1124
|
+
return this.f2o_1.q2n();
|
|
1106
1125
|
};
|
|
1107
|
-
protoOf(SRGB).
|
|
1108
|
-
return this.
|
|
1126
|
+
protoOf(SRGB).m2p = function () {
|
|
1127
|
+
return this.f2o_1.m2p();
|
|
1109
1128
|
};
|
|
1110
|
-
protoOf(SRGB).
|
|
1111
|
-
return this.
|
|
1129
|
+
protoOf(SRGB).l2p = function () {
|
|
1130
|
+
return this.f2o_1.l2p();
|
|
1112
1131
|
};
|
|
1113
1132
|
protoOf(SRGB).s2 = function () {
|
|
1114
|
-
return this.
|
|
1133
|
+
return this.f2o_1.s2();
|
|
1115
1134
|
};
|
|
1116
|
-
protoOf(SRGB).
|
|
1117
|
-
return this.
|
|
1135
|
+
protoOf(SRGB).x2o = function () {
|
|
1136
|
+
return this.f2o_1.x2o();
|
|
1118
1137
|
};
|
|
1119
|
-
protoOf(SRGB).
|
|
1120
|
-
return this.
|
|
1138
|
+
protoOf(SRGB).n2p = function () {
|
|
1139
|
+
return this.f2o_1.n2p();
|
|
1121
1140
|
};
|
|
1122
|
-
protoOf(SRGB).
|
|
1123
|
-
return this.
|
|
1141
|
+
protoOf(SRGB).k2p = function (r, g, b, alpha) {
|
|
1142
|
+
return this.f2o_1.k2p(r, g, b, alpha);
|
|
1124
1143
|
};
|
|
1125
|
-
protoOf(SRGB).
|
|
1126
|
-
return this.
|
|
1144
|
+
protoOf(SRGB).e2o = function (r, g, b, alpha) {
|
|
1145
|
+
return this.f2o_1.e2o(r, g, b, alpha);
|
|
1127
1146
|
};
|
|
1128
|
-
protoOf(SRGB).
|
|
1129
|
-
return this.
|
|
1147
|
+
protoOf(SRGB).j2p = function (r, g, b, alpha) {
|
|
1148
|
+
return this.f2o_1.j2p(r, g, b, alpha);
|
|
1130
1149
|
};
|
|
1131
|
-
protoOf(SRGB).
|
|
1132
|
-
return this.
|
|
1150
|
+
protoOf(SRGB).p2j = function (hex) {
|
|
1151
|
+
return this.f2o_1.p2j(hex);
|
|
1133
1152
|
};
|
|
1134
1153
|
protoOf(SRGB).equals = function (other) {
|
|
1135
|
-
return equals(RGBColorSpaces_getInstance().
|
|
1154
|
+
return equals(RGBColorSpaces_getInstance().l2o_1, other);
|
|
1136
1155
|
};
|
|
1137
1156
|
protoOf(SRGB).hashCode = function () {
|
|
1138
|
-
return hashCode(RGBColorSpaces_getInstance().
|
|
1157
|
+
return hashCode(RGBColorSpaces_getInstance().l2o_1);
|
|
1139
1158
|
};
|
|
1140
1159
|
protoOf(SRGB).toString = function () {
|
|
1141
1160
|
return 'sRGB';
|
|
@@ -1147,39 +1166,39 @@ function SRGB_getInstance() {
|
|
|
1147
1166
|
return SRGB_instance;
|
|
1148
1167
|
}
|
|
1149
1168
|
function RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b, convertImpl) {
|
|
1150
|
-
this.
|
|
1151
|
-
this.
|
|
1152
|
-
this.
|
|
1153
|
-
this.
|
|
1154
|
-
this.
|
|
1155
|
-
this.
|
|
1156
|
-
this.
|
|
1157
|
-
this.
|
|
1158
|
-
this.
|
|
1159
|
-
this.
|
|
1169
|
+
this.d2q_1 = name;
|
|
1170
|
+
this.e2q_1 = whitePoint;
|
|
1171
|
+
this.f2q_1 = transferFunctions;
|
|
1172
|
+
this.g2q_1 = r;
|
|
1173
|
+
this.h2q_1 = g;
|
|
1174
|
+
this.i2q_1 = b;
|
|
1175
|
+
this.j2q_1 = convertImpl;
|
|
1176
|
+
this.k2q_1 = zeroOneComponentInfo('RGB');
|
|
1177
|
+
this.l2q_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.e2q_1, this.g2q_1, this.h2q_1, this.i2q_1));
|
|
1178
|
+
this.m2q_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.l2q_1)));
|
|
1160
1179
|
}
|
|
1161
1180
|
protoOf(RGBColorSpaceImpl).s2 = function () {
|
|
1162
|
-
return this.
|
|
1181
|
+
return this.d2q_1;
|
|
1163
1182
|
};
|
|
1164
|
-
protoOf(RGBColorSpaceImpl).
|
|
1165
|
-
return this.
|
|
1183
|
+
protoOf(RGBColorSpaceImpl).n2p = function () {
|
|
1184
|
+
return this.e2q_1;
|
|
1166
1185
|
};
|
|
1167
|
-
protoOf(RGBColorSpaceImpl).
|
|
1168
|
-
return this.
|
|
1186
|
+
protoOf(RGBColorSpaceImpl).x2o = function () {
|
|
1187
|
+
return this.f2q_1;
|
|
1169
1188
|
};
|
|
1170
|
-
protoOf(RGBColorSpaceImpl).
|
|
1171
|
-
return this.
|
|
1189
|
+
protoOf(RGBColorSpaceImpl).q2n = function () {
|
|
1190
|
+
return this.k2q_1;
|
|
1172
1191
|
};
|
|
1173
|
-
protoOf(RGBColorSpaceImpl).
|
|
1174
|
-
return this.
|
|
1192
|
+
protoOf(RGBColorSpaceImpl).l2p = function () {
|
|
1193
|
+
return this.l2q_1;
|
|
1175
1194
|
};
|
|
1176
|
-
protoOf(RGBColorSpaceImpl).
|
|
1177
|
-
return this.
|
|
1195
|
+
protoOf(RGBColorSpaceImpl).m2p = function () {
|
|
1196
|
+
return this.m2q_1;
|
|
1178
1197
|
};
|
|
1179
1198
|
protoOf(RGBColorSpaceImpl).toString = function () {
|
|
1180
|
-
return this.
|
|
1199
|
+
return this.d2q_1;
|
|
1181
1200
|
};
|
|
1182
|
-
protoOf(RGBColorSpaceImpl).
|
|
1201
|
+
protoOf(RGBColorSpaceImpl).e2o = function (r, g, b, alpha) {
|
|
1183
1202
|
return new RGB(r, g, b, alpha, this);
|
|
1184
1203
|
};
|
|
1185
1204
|
protoOf(RGBColorSpaceImpl).equals = function (other) {
|
|
@@ -1187,42 +1206,42 @@ protoOf(RGBColorSpaceImpl).equals = function (other) {
|
|
|
1187
1206
|
return true;
|
|
1188
1207
|
if (!(!(other == null) ? isInterface(other, RGBColorSpace) : false))
|
|
1189
1208
|
return false;
|
|
1190
|
-
if (!(this.
|
|
1209
|
+
if (!(this.d2q_1 === other.s2()))
|
|
1191
1210
|
return false;
|
|
1192
|
-
if (!this.
|
|
1211
|
+
if (!this.e2q_1.equals(other.n2p()))
|
|
1193
1212
|
return false;
|
|
1194
|
-
if (!equals(this.
|
|
1213
|
+
if (!equals(this.f2q_1, other.x2o()))
|
|
1195
1214
|
return false;
|
|
1196
1215
|
if (other instanceof RGBColorSpaceImpl) {
|
|
1197
|
-
if (!this.
|
|
1216
|
+
if (!this.g2q_1.equals(other.g2q_1))
|
|
1198
1217
|
return false;
|
|
1199
|
-
if (!this.
|
|
1218
|
+
if (!this.h2q_1.equals(other.h2q_1))
|
|
1200
1219
|
return false;
|
|
1201
|
-
if (!this.
|
|
1220
|
+
if (!this.i2q_1.equals(other.i2q_1))
|
|
1202
1221
|
return false;
|
|
1203
1222
|
} else {
|
|
1204
|
-
if (!contentEquals(this.
|
|
1223
|
+
if (!contentEquals(this.l2q_1, other.l2p()))
|
|
1205
1224
|
return false;
|
|
1206
|
-
if (!contentEquals(this.
|
|
1225
|
+
if (!contentEquals(this.m2q_1, other.m2p()))
|
|
1207
1226
|
return false;
|
|
1208
1227
|
}
|
|
1209
1228
|
return true;
|
|
1210
1229
|
};
|
|
1211
1230
|
protoOf(RGBColorSpaceImpl).hashCode = function () {
|
|
1212
|
-
var result = getStringHashCode(this.
|
|
1213
|
-
result = imul(31, result) + this.
|
|
1214
|
-
result = imul(31, result) + hashCode(this.
|
|
1215
|
-
result = imul(31, result) + this.
|
|
1216
|
-
result = imul(31, result) + this.
|
|
1217
|
-
result = imul(31, result) + this.
|
|
1231
|
+
var result = getStringHashCode(this.d2q_1);
|
|
1232
|
+
result = imul(31, result) + this.e2q_1.hashCode() | 0;
|
|
1233
|
+
result = imul(31, result) + hashCode(this.f2q_1) | 0;
|
|
1234
|
+
result = imul(31, result) + this.g2q_1.hashCode() | 0;
|
|
1235
|
+
result = imul(31, result) + this.h2q_1.hashCode() | 0;
|
|
1236
|
+
result = imul(31, result) + this.i2q_1.hashCode() | 0;
|
|
1218
1237
|
return result;
|
|
1219
1238
|
};
|
|
1220
1239
|
function SRGBTransferFunctions() {
|
|
1221
1240
|
}
|
|
1222
|
-
protoOf(SRGBTransferFunctions).
|
|
1241
|
+
protoOf(SRGBTransferFunctions).h2p = function (x) {
|
|
1223
1242
|
return x <= 0.0031308 ? x * 12.92 : 1.055 * spow(x, 1 / 2.4) - 0.055;
|
|
1224
1243
|
};
|
|
1225
|
-
protoOf(SRGBTransferFunctions).
|
|
1244
|
+
protoOf(SRGBTransferFunctions).g2p = function (x) {
|
|
1226
1245
|
return x <= 0.04045 ? x / 12.92 : spow_0((x + 0.055) / 1.055, 2.4);
|
|
1227
1246
|
};
|
|
1228
1247
|
var SRGBTransferFunctions_instance;
|
|
@@ -1235,14 +1254,14 @@ function RGBColorSpace_0(name, whitePoint, transferFunctions, r, g, b) {
|
|
|
1235
1254
|
}
|
|
1236
1255
|
function ACESccTransferFunctions() {
|
|
1237
1256
|
ACESccTransferFunctions_instance = this;
|
|
1238
|
-
this.
|
|
1239
|
-
this.
|
|
1240
|
-
this.
|
|
1257
|
+
this.n2q_1 = 3.0517578125E-5;
|
|
1258
|
+
this.o2q_1 = 1.52587890625E-5;
|
|
1259
|
+
this.p2q_1 = -0.3013698630136986;
|
|
1241
1260
|
var tmp = this;
|
|
1242
1261
|
// Inline function 'kotlin.math.log2' call
|
|
1243
|
-
tmp.
|
|
1262
|
+
tmp.q2q_1 = (log2(65504.0) + 9.72) / 17.52;
|
|
1244
1263
|
}
|
|
1245
|
-
protoOf(ACESccTransferFunctions).
|
|
1264
|
+
protoOf(ACESccTransferFunctions).g2p = function (x) {
|
|
1246
1265
|
var tmp;
|
|
1247
1266
|
var tmp_0 = x;
|
|
1248
1267
|
ACESccTransferFunctions_getInstance();
|
|
@@ -1251,7 +1270,7 @@ protoOf(ACESccTransferFunctions).y2p = function (x) {
|
|
|
1251
1270
|
ACESccTransferFunctions_getInstance();
|
|
1252
1271
|
tmp = (tmp_1 - 1.52587890625E-5) * 2.0;
|
|
1253
1272
|
} else {
|
|
1254
|
-
if (x < this.
|
|
1273
|
+
if (x < this.q2q_1) {
|
|
1255
1274
|
// Inline function 'kotlin.math.pow' call
|
|
1256
1275
|
var x_0 = x * 17.52 - 9.72;
|
|
1257
1276
|
tmp = Math.pow(2.0, x_0);
|
|
@@ -1261,13 +1280,13 @@ protoOf(ACESccTransferFunctions).y2p = function (x) {
|
|
|
1261
1280
|
}
|
|
1262
1281
|
return tmp;
|
|
1263
1282
|
};
|
|
1264
|
-
protoOf(ACESccTransferFunctions).
|
|
1283
|
+
protoOf(ACESccTransferFunctions).h2p = function (x) {
|
|
1265
1284
|
var tmp;
|
|
1266
1285
|
var tmp_0 = x;
|
|
1267
1286
|
ACESccTransferFunctions_getInstance();
|
|
1268
1287
|
if (tmp_0 < 3.0517578125E-5) {
|
|
1269
|
-
ACESccTransferFunctions_getInstance();
|
|
1270
1288
|
// Inline function 'kotlin.math.log2' call
|
|
1289
|
+
ACESccTransferFunctions_getInstance();
|
|
1271
1290
|
var x_0 = 1.52587890625E-5 + coerceAtLeast_0(x, 0.0) / 2.0;
|
|
1272
1291
|
tmp = (log2(x_0) + 9.72) / 17.52;
|
|
1273
1292
|
} else {
|
|
@@ -1284,20 +1303,20 @@ function ACESccTransferFunctions_getInstance() {
|
|
|
1284
1303
|
}
|
|
1285
1304
|
function ACEScctTransferFunctions() {
|
|
1286
1305
|
ACEScctTransferFunctions_instance = this;
|
|
1287
|
-
this.
|
|
1288
|
-
this.
|
|
1306
|
+
this.r2q_1 = 10.5402377416545;
|
|
1307
|
+
this.s2q_1 = 0.0729055341958355;
|
|
1289
1308
|
var tmp = this;
|
|
1290
1309
|
// Inline function 'kotlin.math.log2' call
|
|
1291
|
-
tmp.
|
|
1310
|
+
tmp.t2q_1 = (log2(65504.0) + 9.72) / 17.52;
|
|
1292
1311
|
}
|
|
1293
|
-
protoOf(ACEScctTransferFunctions).
|
|
1312
|
+
protoOf(ACEScctTransferFunctions).g2p = function (x) {
|
|
1294
1313
|
var tmp;
|
|
1295
1314
|
if (x <= 0.155251141552511) {
|
|
1296
1315
|
ACEScctTransferFunctions_getInstance();
|
|
1297
1316
|
var tmp_0 = x - 0.0729055341958355;
|
|
1298
1317
|
ACEScctTransferFunctions_getInstance();
|
|
1299
1318
|
tmp = tmp_0 / 10.5402377416545;
|
|
1300
|
-
} else if (x < this.
|
|
1319
|
+
} else if (x < this.t2q_1) {
|
|
1301
1320
|
// Inline function 'kotlin.math.pow' call
|
|
1302
1321
|
var x_0 = x * 17.52 - 9.72;
|
|
1303
1322
|
tmp = Math.pow(2.0, x_0);
|
|
@@ -1306,7 +1325,7 @@ protoOf(ACEScctTransferFunctions).y2p = function (x) {
|
|
|
1306
1325
|
}
|
|
1307
1326
|
return tmp;
|
|
1308
1327
|
};
|
|
1309
|
-
protoOf(ACEScctTransferFunctions).
|
|
1328
|
+
protoOf(ACEScctTransferFunctions).h2p = function (x) {
|
|
1310
1329
|
var tmp;
|
|
1311
1330
|
if (x < 0.0078125) {
|
|
1312
1331
|
ACEScctTransferFunctions_getInstance();
|
|
@@ -1327,19 +1346,19 @@ function ACEScctTransferFunctions_getInstance() {
|
|
|
1327
1346
|
}
|
|
1328
1347
|
function BT2020TransferFunctions() {
|
|
1329
1348
|
BT2020TransferFunctions_instance = this;
|
|
1330
|
-
this.
|
|
1331
|
-
this.
|
|
1349
|
+
this.u2q_1 = 1.0993;
|
|
1350
|
+
this.v2q_1 = 0.0181;
|
|
1332
1351
|
var tmp = this;
|
|
1333
1352
|
BT2020TransferFunctions_getInstance();
|
|
1334
|
-
BT2020TransferFunctions_getInstance();
|
|
1335
1353
|
// Inline function 'kotlin.math.pow' call
|
|
1354
|
+
BT2020TransferFunctions_getInstance();
|
|
1336
1355
|
var tmp_0 = 1.0993 * Math.pow(0.0181, 0.45);
|
|
1337
1356
|
BT2020TransferFunctions_getInstance();
|
|
1338
|
-
tmp.
|
|
1357
|
+
tmp.w2q_1 = tmp_0 - (1.0993 - 1);
|
|
1339
1358
|
}
|
|
1340
|
-
protoOf(BT2020TransferFunctions).
|
|
1359
|
+
protoOf(BT2020TransferFunctions).g2p = function (x) {
|
|
1341
1360
|
var tmp;
|
|
1342
|
-
if (x < this.
|
|
1361
|
+
if (x < this.w2q_1) {
|
|
1343
1362
|
tmp = x / 4.5;
|
|
1344
1363
|
} else {
|
|
1345
1364
|
BT2020TransferFunctions_getInstance();
|
|
@@ -1349,7 +1368,7 @@ protoOf(BT2020TransferFunctions).y2p = function (x) {
|
|
|
1349
1368
|
}
|
|
1350
1369
|
return numberToDouble(tmp);
|
|
1351
1370
|
};
|
|
1352
|
-
protoOf(BT2020TransferFunctions).
|
|
1371
|
+
protoOf(BT2020TransferFunctions).h2p = function (x) {
|
|
1353
1372
|
var tmp;
|
|
1354
1373
|
var tmp_0 = x;
|
|
1355
1374
|
BT2020TransferFunctions_getInstance();
|
|
@@ -1371,12 +1390,12 @@ function BT2020TransferFunctions_getInstance() {
|
|
|
1371
1390
|
}
|
|
1372
1391
|
function BT709TransferFunctions() {
|
|
1373
1392
|
BT709TransferFunctions_instance = this;
|
|
1374
|
-
this.
|
|
1393
|
+
this.x2q_1 = 1.099 * spow_0(0.018, 0.45) - 0.099;
|
|
1375
1394
|
}
|
|
1376
|
-
protoOf(BT709TransferFunctions).
|
|
1377
|
-
return numberToDouble(x < this.
|
|
1395
|
+
protoOf(BT709TransferFunctions).g2p = function (x) {
|
|
1396
|
+
return numberToDouble(x < this.x2q_1 ? x / 4.5 : spow_0((x + 0.099) / 1.099, 1 / 0.45));
|
|
1378
1397
|
};
|
|
1379
|
-
protoOf(BT709TransferFunctions).
|
|
1398
|
+
protoOf(BT709TransferFunctions).h2p = function (x) {
|
|
1380
1399
|
return x < 0.018 ? 4.5 * x : 1.099 * spow(x, 0.45) - 0.099;
|
|
1381
1400
|
};
|
|
1382
1401
|
var BT709TransferFunctions_instance;
|
|
@@ -1386,9 +1405,9 @@ function BT709TransferFunctions_getInstance() {
|
|
|
1386
1405
|
return BT709TransferFunctions_instance;
|
|
1387
1406
|
}
|
|
1388
1407
|
function ROMMTransferFunctions() {
|
|
1389
|
-
this.
|
|
1408
|
+
this.y2q_1 = 0.001953;
|
|
1390
1409
|
}
|
|
1391
|
-
protoOf(ROMMTransferFunctions).
|
|
1410
|
+
protoOf(ROMMTransferFunctions).g2p = function (x) {
|
|
1392
1411
|
var tmp;
|
|
1393
1412
|
var tmp_0 = x;
|
|
1394
1413
|
if (tmp_0 < 16 * 0.001953) {
|
|
@@ -1398,7 +1417,7 @@ protoOf(ROMMTransferFunctions).y2p = function (x) {
|
|
|
1398
1417
|
}
|
|
1399
1418
|
return tmp;
|
|
1400
1419
|
};
|
|
1401
|
-
protoOf(ROMMTransferFunctions).
|
|
1420
|
+
protoOf(ROMMTransferFunctions).h2p = function (x) {
|
|
1402
1421
|
var tmp;
|
|
1403
1422
|
var tmp_0 = x;
|
|
1404
1423
|
if (tmp_0 < 0.001953) {
|
|
@@ -1414,26 +1433,26 @@ function ROMMTransferFunctions_getInstance() {
|
|
|
1414
1433
|
}
|
|
1415
1434
|
function rgbToXyzMatrix(whitePoint, r, g, b) {
|
|
1416
1435
|
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1417
|
-
var primaries = _Matrix___init__impl__q3kp4w_0(r.
|
|
1418
|
-
var wp = whitePoint.
|
|
1419
|
-
var tmp0 = inverse(primaries);
|
|
1420
|
-
var tmp1 = wp.v2r();
|
|
1421
|
-
var tmp2 = wp.t2r_1;
|
|
1436
|
+
var primaries = _Matrix___init__impl__q3kp4w_0(r.z2q_1, g.z2q_1, b.z2q_1, r.a2r_1, g.a2r_1, b.a2r_1, r.c2r(), g.c2r(), b.c2r());
|
|
1437
|
+
var wp = whitePoint.f2n_1;
|
|
1422
1438
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1423
|
-
var
|
|
1424
|
-
var
|
|
1425
|
-
var
|
|
1439
|
+
var this_0 = inverse(primaries);
|
|
1440
|
+
var v0 = wp.d2r();
|
|
1441
|
+
var v1 = wp.b2r_1;
|
|
1442
|
+
var v2 = wp.e2r();
|
|
1426
1443
|
// Inline function 'com.github.ajalt.colormath.model.rgbToXyzMatrix.<anonymous>' call
|
|
1427
|
-
var
|
|
1428
|
-
|
|
1444
|
+
var x = Matrix__get_impl_xogbpk(this_0, 0, 0) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 0) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 0) * v2;
|
|
1445
|
+
var y = Matrix__get_impl_xogbpk(this_0, 0, 1) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 1) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 1) * v2;
|
|
1446
|
+
var z = Matrix__get_impl_xogbpk(this_0, 0, 2) * v0 + Matrix__get_impl_xogbpk(this_0, 1, 2) * v1 + Matrix__get_impl_xogbpk(this_0, 2, 2) * v2;
|
|
1447
|
+
return dotDiagonal(primaries, x, y, z);
|
|
1429
1448
|
}
|
|
1430
1449
|
function RGBColorSpace$lambda($this$$receiver, color) {
|
|
1431
1450
|
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1432
1451
|
var tmp;
|
|
1433
1452
|
if (color instanceof RGB) {
|
|
1434
|
-
tmp = color.
|
|
1453
|
+
tmp = color.s2p($this$$receiver);
|
|
1435
1454
|
} else {
|
|
1436
|
-
tmp = color.
|
|
1455
|
+
tmp = color.u2m().y2p($this$$receiver);
|
|
1437
1456
|
}
|
|
1438
1457
|
return tmp;
|
|
1439
1458
|
}
|
|
@@ -1455,22 +1474,22 @@ function _init_properties_RGBColorSpaces_kt__nc9fsz() {
|
|
|
1455
1474
|
}
|
|
1456
1475
|
function Companion_3() {
|
|
1457
1476
|
Companion_instance_3 = this;
|
|
1458
|
-
this.
|
|
1477
|
+
this.f2r_1 = XYZColorSpaces_getInstance().g2r_1;
|
|
1459
1478
|
}
|
|
1460
|
-
protoOf(Companion_3).
|
|
1461
|
-
return this.
|
|
1479
|
+
protoOf(Companion_3).q2n = function () {
|
|
1480
|
+
return this.f2r_1.q2n();
|
|
1462
1481
|
};
|
|
1463
|
-
protoOf(Companion_3).
|
|
1464
|
-
return this.
|
|
1482
|
+
protoOf(Companion_3).n2p = function () {
|
|
1483
|
+
return this.f2r_1.n2p();
|
|
1465
1484
|
};
|
|
1466
|
-
protoOf(Companion_3).
|
|
1467
|
-
return this.
|
|
1485
|
+
protoOf(Companion_3).e2o = function (x, y, z, alpha) {
|
|
1486
|
+
return this.f2r_1.e2o(x, y, z, alpha);
|
|
1468
1487
|
};
|
|
1469
1488
|
protoOf(Companion_3).hashCode = function () {
|
|
1470
|
-
return hashCode(XYZColorSpaces_getInstance().
|
|
1489
|
+
return hashCode(XYZColorSpaces_getInstance().g2r_1);
|
|
1471
1490
|
};
|
|
1472
1491
|
protoOf(Companion_3).equals = function (other) {
|
|
1473
|
-
return equals(XYZColorSpaces_getInstance().
|
|
1492
|
+
return equals(XYZColorSpaces_getInstance().g2r_1, other);
|
|
1474
1493
|
};
|
|
1475
1494
|
var Companion_instance_3;
|
|
1476
1495
|
function Companion_getInstance_3() {
|
|
@@ -1479,71 +1498,71 @@ function Companion_getInstance_3() {
|
|
|
1479
1498
|
return Companion_instance_3;
|
|
1480
1499
|
}
|
|
1481
1500
|
function adaptToM($this, space, m, mi) {
|
|
1482
|
-
if (space.
|
|
1501
|
+
if (space.n2p().equals($this.x2p_1.n2p()))
|
|
1483
1502
|
return $this;
|
|
1484
|
-
var transform = chromaticAdaptationMatrix(space, $this.
|
|
1485
|
-
var tmp1 = $this.l2q_1;
|
|
1486
|
-
var tmp2 = $this.m2q_1;
|
|
1503
|
+
var transform = chromaticAdaptationMatrix(space, $this.x2p_1.n2p().f2n_1, m, mi);
|
|
1487
1504
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1488
|
-
var
|
|
1489
|
-
var
|
|
1490
|
-
var
|
|
1505
|
+
var v0 = $this.t2p_1;
|
|
1506
|
+
var v1 = $this.u2p_1;
|
|
1507
|
+
var v2 = $this.v2p_1;
|
|
1491
1508
|
// Inline function 'com.github.ajalt.colormath.model.XYZ.adaptToM.<anonymous>' call
|
|
1492
|
-
var
|
|
1493
|
-
|
|
1509
|
+
var xx = Matrix__get_impl_xogbpk(transform, 0, 0) * v0 + Matrix__get_impl_xogbpk(transform, 1, 0) * v1 + Matrix__get_impl_xogbpk(transform, 2, 0) * v2;
|
|
1510
|
+
var yy = Matrix__get_impl_xogbpk(transform, 0, 1) * v0 + Matrix__get_impl_xogbpk(transform, 1, 1) * v1 + Matrix__get_impl_xogbpk(transform, 2, 1) * v2;
|
|
1511
|
+
var zz = Matrix__get_impl_xogbpk(transform, 0, 2) * v0 + Matrix__get_impl_xogbpk(transform, 1, 2) * v1 + Matrix__get_impl_xogbpk(transform, 2, 2) * v2;
|
|
1512
|
+
return space.e2o(xx, yy, zz, $this.w2p_1);
|
|
1494
1513
|
}
|
|
1495
1514
|
function XYZ(x, y, z, alpha, space) {
|
|
1496
1515
|
Companion_getInstance_3();
|
|
1497
|
-
this.
|
|
1498
|
-
this.
|
|
1499
|
-
this.
|
|
1500
|
-
this.
|
|
1501
|
-
this.
|
|
1516
|
+
this.t2p_1 = x;
|
|
1517
|
+
this.u2p_1 = y;
|
|
1518
|
+
this.v2p_1 = z;
|
|
1519
|
+
this.w2p_1 = alpha;
|
|
1520
|
+
this.x2p_1 = space;
|
|
1502
1521
|
}
|
|
1503
|
-
protoOf(XYZ).
|
|
1504
|
-
return this.
|
|
1522
|
+
protoOf(XYZ).s2m = function () {
|
|
1523
|
+
return this.x2p_1;
|
|
1505
1524
|
};
|
|
1506
|
-
protoOf(XYZ).
|
|
1525
|
+
protoOf(XYZ).i2r = function (space) {
|
|
1507
1526
|
return adaptToM(this, space, get_CAT02_XYZ_TO_LMS(), get_CAT02_LMS_TO_XYZ());
|
|
1508
1527
|
};
|
|
1509
|
-
protoOf(XYZ).
|
|
1510
|
-
var tmp0_container = this.
|
|
1511
|
-
var x = tmp0_container.
|
|
1512
|
-
var y = tmp0_container.
|
|
1513
|
-
var z = tmp0_container.
|
|
1514
|
-
var f = space.
|
|
1528
|
+
protoOf(XYZ).y2p = function (space) {
|
|
1529
|
+
var tmp0_container = this.i2r(XYZColorSpace_0(space.n2p()));
|
|
1530
|
+
var x = tmp0_container.sd();
|
|
1531
|
+
var y = tmp0_container.td();
|
|
1532
|
+
var z = tmp0_container.th();
|
|
1533
|
+
var f = space.x2o();
|
|
1515
1534
|
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1516
|
-
var this_0 = _Matrix___init__impl__q3kp4w(space.
|
|
1517
|
-
var tmp4 = Matrix__get_impl_xogbpk(this_0, 0, 0) * x + Matrix__get_impl_xogbpk(this_0, 1, 0) * y + Matrix__get_impl_xogbpk(this_0, 2, 0) * z;
|
|
1518
|
-
var tmp5 = Matrix__get_impl_xogbpk(this_0, 0, 1) * x + Matrix__get_impl_xogbpk(this_0, 1, 1) * y + Matrix__get_impl_xogbpk(this_0, 2, 1) * z;
|
|
1535
|
+
var this_0 = _Matrix___init__impl__q3kp4w(space.m2p());
|
|
1519
1536
|
// Inline function 'com.github.ajalt.colormath.model.XYZ.toRGB.<anonymous>' call
|
|
1537
|
+
var r = Matrix__get_impl_xogbpk(this_0, 0, 0) * x + Matrix__get_impl_xogbpk(this_0, 1, 0) * y + Matrix__get_impl_xogbpk(this_0, 2, 0) * z;
|
|
1538
|
+
var g = Matrix__get_impl_xogbpk(this_0, 0, 1) * x + Matrix__get_impl_xogbpk(this_0, 1, 1) * y + Matrix__get_impl_xogbpk(this_0, 2, 1) * z;
|
|
1520
1539
|
var b = Matrix__get_impl_xogbpk(this_0, 0, 2) * x + Matrix__get_impl_xogbpk(this_0, 1, 2) * y + Matrix__get_impl_xogbpk(this_0, 2, 2) * z;
|
|
1521
|
-
return space.
|
|
1540
|
+
return space.e2o(f.h2p(r), f.h2p(g), f.h2p(b), this.w2p_1);
|
|
1522
1541
|
};
|
|
1523
|
-
protoOf(XYZ).
|
|
1524
|
-
return this.
|
|
1542
|
+
protoOf(XYZ).t2m = function () {
|
|
1543
|
+
return this.y2p(RGBColorSpaces_getInstance().l2o_1);
|
|
1525
1544
|
};
|
|
1526
|
-
protoOf(XYZ).
|
|
1545
|
+
protoOf(XYZ).u2m = function () {
|
|
1527
1546
|
return this;
|
|
1528
1547
|
};
|
|
1529
|
-
protoOf(XYZ).
|
|
1530
|
-
return this.
|
|
1548
|
+
protoOf(XYZ).sd = function () {
|
|
1549
|
+
return this.t2p_1;
|
|
1531
1550
|
};
|
|
1532
|
-
protoOf(XYZ).
|
|
1533
|
-
return this.
|
|
1551
|
+
protoOf(XYZ).td = function () {
|
|
1552
|
+
return this.u2p_1;
|
|
1534
1553
|
};
|
|
1535
|
-
protoOf(XYZ).
|
|
1536
|
-
return this.
|
|
1554
|
+
protoOf(XYZ).th = function () {
|
|
1555
|
+
return this.v2p_1;
|
|
1537
1556
|
};
|
|
1538
1557
|
protoOf(XYZ).toString = function () {
|
|
1539
|
-
return 'XYZ(x=' + this.
|
|
1558
|
+
return 'XYZ(x=' + this.t2p_1 + ', y=' + this.u2p_1 + ', z=' + this.v2p_1 + ', alpha=' + this.w2p_1 + ', space=' + toString(this.x2p_1) + ')';
|
|
1540
1559
|
};
|
|
1541
1560
|
protoOf(XYZ).hashCode = function () {
|
|
1542
|
-
var result = getNumberHashCode(this.
|
|
1543
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1544
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1545
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1546
|
-
result = imul(result, 31) + hashCode(this.
|
|
1561
|
+
var result = getNumberHashCode(this.t2p_1);
|
|
1562
|
+
result = imul(result, 31) + getNumberHashCode(this.u2p_1) | 0;
|
|
1563
|
+
result = imul(result, 31) + getNumberHashCode(this.v2p_1) | 0;
|
|
1564
|
+
result = imul(result, 31) + getNumberHashCode(this.w2p_1) | 0;
|
|
1565
|
+
result = imul(result, 31) + hashCode(this.x2p_1) | 0;
|
|
1547
1566
|
return result;
|
|
1548
1567
|
};
|
|
1549
1568
|
protoOf(XYZ).equals = function (other) {
|
|
@@ -1552,27 +1571,27 @@ protoOf(XYZ).equals = function (other) {
|
|
|
1552
1571
|
if (!(other instanceof XYZ))
|
|
1553
1572
|
return false;
|
|
1554
1573
|
var tmp0_other_with_cast = other instanceof XYZ ? other : THROW_CCE();
|
|
1555
|
-
if (!equals(this.
|
|
1574
|
+
if (!equals(this.t2p_1, tmp0_other_with_cast.t2p_1))
|
|
1556
1575
|
return false;
|
|
1557
|
-
if (!equals(this.
|
|
1576
|
+
if (!equals(this.u2p_1, tmp0_other_with_cast.u2p_1))
|
|
1558
1577
|
return false;
|
|
1559
|
-
if (!equals(this.
|
|
1578
|
+
if (!equals(this.v2p_1, tmp0_other_with_cast.v2p_1))
|
|
1560
1579
|
return false;
|
|
1561
|
-
if (!equals(this.
|
|
1580
|
+
if (!equals(this.w2p_1, tmp0_other_with_cast.w2p_1))
|
|
1562
1581
|
return false;
|
|
1563
|
-
if (!equals(this.
|
|
1582
|
+
if (!equals(this.x2p_1, tmp0_other_with_cast.x2p_1))
|
|
1564
1583
|
return false;
|
|
1565
1584
|
return true;
|
|
1566
1585
|
};
|
|
1567
1586
|
function XYZColorSpace() {
|
|
1568
1587
|
}
|
|
1569
1588
|
function XYZColorSpace_0(whitePoint) {
|
|
1570
|
-
return whitePoint.equals(Illuminant_getInstance().
|
|
1589
|
+
return whitePoint.equals(Illuminant_getInstance().l2n_1) ? XYZColorSpaces_getInstance().g2r_1 : whitePoint.equals(Illuminant_getInstance().j2n_1) ? XYZColorSpaces_getInstance().h2r_1 : new XYZColorSpaceImpl(whitePoint);
|
|
1571
1590
|
}
|
|
1572
1591
|
function XYZColorSpaces() {
|
|
1573
1592
|
XYZColorSpaces_instance = this;
|
|
1574
|
-
this.
|
|
1575
|
-
this.
|
|
1593
|
+
this.g2r_1 = new XYZColorSpaceImpl(Illuminant_getInstance().l2n_1);
|
|
1594
|
+
this.h2r_1 = new XYZColorSpaceImpl(Illuminant_getInstance().j2n_1);
|
|
1576
1595
|
}
|
|
1577
1596
|
var XYZColorSpaces_instance;
|
|
1578
1597
|
function XYZColorSpaces_getInstance() {
|
|
@@ -1583,34 +1602,34 @@ function XYZColorSpaces_getInstance() {
|
|
|
1583
1602
|
function chromaticAdaptationMatrix(_this__u8e3s4, srcWp, xyzToLms, lmsToXyz) {
|
|
1584
1603
|
xyzToLms = xyzToLms === VOID ? get_CAT02_XYZ_TO_LMS() : xyzToLms;
|
|
1585
1604
|
lmsToXyz = lmsToXyz === VOID ? get_CAT02_LMS_TO_XYZ() : lmsToXyz;
|
|
1586
|
-
var dstWp = _this__u8e3s4.
|
|
1587
|
-
var src = dot_0(xyzToLms, srcWp.
|
|
1588
|
-
var dst = dot_0(xyzToLms, dstWp.
|
|
1605
|
+
var dstWp = _this__u8e3s4.n2p().f2n_1;
|
|
1606
|
+
var src = dot_0(xyzToLms, srcWp.d2r(), srcWp.b2r_1, srcWp.e2r());
|
|
1607
|
+
var dst = dot_0(xyzToLms, dstWp.d2r(), dstWp.b2r_1, dstWp.e2r());
|
|
1589
1608
|
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);
|
|
1590
1609
|
}
|
|
1591
1610
|
function XYZColorSpaceImpl(whitePoint) {
|
|
1592
|
-
this.
|
|
1593
|
-
this.
|
|
1611
|
+
this.j2r_1 = whitePoint;
|
|
1612
|
+
this.k2r_1 = zeroOneComponentInfo('XYZ');
|
|
1594
1613
|
}
|
|
1595
|
-
protoOf(XYZColorSpaceImpl).
|
|
1596
|
-
return this.
|
|
1614
|
+
protoOf(XYZColorSpaceImpl).n2p = function () {
|
|
1615
|
+
return this.j2r_1;
|
|
1597
1616
|
};
|
|
1598
|
-
protoOf(XYZColorSpaceImpl).
|
|
1599
|
-
return this.
|
|
1617
|
+
protoOf(XYZColorSpaceImpl).q2n = function () {
|
|
1618
|
+
return this.k2r_1;
|
|
1600
1619
|
};
|
|
1601
1620
|
protoOf(XYZColorSpaceImpl).toString = function () {
|
|
1602
|
-
return 'XYZColorSpace(' + this.
|
|
1621
|
+
return 'XYZColorSpace(' + this.j2r_1.toString() + ')';
|
|
1603
1622
|
};
|
|
1604
|
-
protoOf(XYZColorSpaceImpl).
|
|
1623
|
+
protoOf(XYZColorSpaceImpl).e2o = function (x, y, z, alpha) {
|
|
1605
1624
|
return new XYZ(x, y, z, alpha, this);
|
|
1606
1625
|
};
|
|
1607
1626
|
protoOf(XYZColorSpaceImpl).hashCode = function () {
|
|
1608
|
-
return this.
|
|
1627
|
+
return this.j2r_1.hashCode();
|
|
1609
1628
|
};
|
|
1610
1629
|
protoOf(XYZColorSpaceImpl).equals = function (other) {
|
|
1611
1630
|
var tmp;
|
|
1612
1631
|
if (!(other == null) ? isInterface(other, XYZColorSpace) : false) {
|
|
1613
|
-
tmp = this.
|
|
1632
|
+
tmp = this.j2r_1.equals(other.n2p());
|
|
1614
1633
|
} else {
|
|
1615
1634
|
tmp = false;
|
|
1616
1635
|
}
|
|
@@ -1626,26 +1645,26 @@ function xyY_init_$Create$(x, y, Y) {
|
|
|
1626
1645
|
}
|
|
1627
1646
|
function xyY(x, y, Y) {
|
|
1628
1647
|
Y = Y === VOID ? 1.0 : Y;
|
|
1629
|
-
this.
|
|
1630
|
-
this.
|
|
1631
|
-
this.
|
|
1648
|
+
this.z2q_1 = x;
|
|
1649
|
+
this.a2r_1 = y;
|
|
1650
|
+
this.b2r_1 = Y;
|
|
1632
1651
|
}
|
|
1633
|
-
protoOf(xyY).
|
|
1634
|
-
return 1 - this.
|
|
1652
|
+
protoOf(xyY).c2r = function () {
|
|
1653
|
+
return 1 - this.z2q_1 - this.a2r_1;
|
|
1635
1654
|
};
|
|
1636
|
-
protoOf(xyY).
|
|
1637
|
-
return this.
|
|
1655
|
+
protoOf(xyY).d2r = function () {
|
|
1656
|
+
return this.z2q_1 * this.b2r_1 / this.a2r_1;
|
|
1638
1657
|
};
|
|
1639
|
-
protoOf(xyY).
|
|
1640
|
-
return (1 - this.
|
|
1658
|
+
protoOf(xyY).e2r = function () {
|
|
1659
|
+
return (1 - this.z2q_1 - this.a2r_1) * this.b2r_1 / this.a2r_1;
|
|
1641
1660
|
};
|
|
1642
1661
|
protoOf(xyY).toString = function () {
|
|
1643
|
-
return 'xyY(x=' + this.
|
|
1662
|
+
return 'xyY(x=' + this.z2q_1 + ', y=' + this.a2r_1 + ', Y=' + this.b2r_1 + ')';
|
|
1644
1663
|
};
|
|
1645
1664
|
protoOf(xyY).hashCode = function () {
|
|
1646
|
-
var result = getNumberHashCode(this.
|
|
1647
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1648
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1665
|
+
var result = getNumberHashCode(this.z2q_1);
|
|
1666
|
+
result = imul(result, 31) + getNumberHashCode(this.a2r_1) | 0;
|
|
1667
|
+
result = imul(result, 31) + getNumberHashCode(this.b2r_1) | 0;
|
|
1649
1668
|
return result;
|
|
1650
1669
|
};
|
|
1651
1670
|
protoOf(xyY).equals = function (other) {
|
|
@@ -1654,30 +1673,30 @@ protoOf(xyY).equals = function (other) {
|
|
|
1654
1673
|
if (!(other instanceof xyY))
|
|
1655
1674
|
return false;
|
|
1656
1675
|
var tmp0_other_with_cast = other instanceof xyY ? other : THROW_CCE();
|
|
1657
|
-
if (!equals(this.
|
|
1676
|
+
if (!equals(this.z2q_1, tmp0_other_with_cast.z2q_1))
|
|
1658
1677
|
return false;
|
|
1659
|
-
if (!equals(this.
|
|
1678
|
+
if (!equals(this.a2r_1, tmp0_other_with_cast.a2r_1))
|
|
1660
1679
|
return false;
|
|
1661
|
-
if (!equals(this.
|
|
1680
|
+
if (!equals(this.b2r_1, tmp0_other_with_cast.b2r_1))
|
|
1662
1681
|
return false;
|
|
1663
1682
|
return true;
|
|
1664
1683
|
};
|
|
1665
1684
|
//region block: post-declaration
|
|
1666
|
-
protoOf(Ansi16).
|
|
1667
|
-
protoOf(Ansi256).
|
|
1668
|
-
protoOf(HSV).
|
|
1669
|
-
protoOf(Companion_2).
|
|
1670
|
-
protoOf(Companion_2).
|
|
1671
|
-
protoOf(Companion_2).
|
|
1672
|
-
protoOf(SRGB).
|
|
1673
|
-
protoOf(SRGB).
|
|
1674
|
-
protoOf(SRGB).
|
|
1675
|
-
protoOf(RGBColorSpaceImpl).
|
|
1676
|
-
protoOf(RGBColorSpaceImpl).
|
|
1677
|
-
protoOf(RGBColorSpaceImpl).
|
|
1678
|
-
protoOf(RGBColorSpaceImpl).
|
|
1679
|
-
protoOf(RGBColorSpaceImpl).
|
|
1680
|
-
protoOf(RGBColorSpaceImpl).
|
|
1685
|
+
protoOf(Ansi16).u2m = toXYZ;
|
|
1686
|
+
protoOf(Ansi256).u2m = toXYZ;
|
|
1687
|
+
protoOf(HSV).u2m = toXYZ;
|
|
1688
|
+
protoOf(Companion_2).t2n = from255$default;
|
|
1689
|
+
protoOf(Companion_2).s2n = invoke$default;
|
|
1690
|
+
protoOf(Companion_2).x2n = invoke$default_0;
|
|
1691
|
+
protoOf(SRGB).t2n = from255$default;
|
|
1692
|
+
protoOf(SRGB).s2n = invoke$default;
|
|
1693
|
+
protoOf(SRGB).x2n = invoke$default_0;
|
|
1694
|
+
protoOf(RGBColorSpaceImpl).s2n = invoke$default;
|
|
1695
|
+
protoOf(RGBColorSpaceImpl).j2p = invoke;
|
|
1696
|
+
protoOf(RGBColorSpaceImpl).x2n = invoke$default_0;
|
|
1697
|
+
protoOf(RGBColorSpaceImpl).p2j = invoke_0;
|
|
1698
|
+
protoOf(RGBColorSpaceImpl).k2p = from255;
|
|
1699
|
+
protoOf(RGBColorSpaceImpl).t2n = from255$default;
|
|
1681
1700
|
//endregion
|
|
1682
1701
|
//region block: init
|
|
1683
1702
|
PqNonlinearity_instance = new PqNonlinearity();
|
|
@@ -1689,7 +1708,7 @@ ROMMTransferFunctions_instance = new ROMMTransferFunctions();
|
|
|
1689
1708
|
export {
|
|
1690
1709
|
Ansi16 as Ansi161fxj36mncd6rb,
|
|
1691
1710
|
Ansi256 as Ansi25637kncr8jl8m76,
|
|
1692
|
-
Companion_getInstance_2 as
|
|
1711
|
+
Companion_getInstance_2 as Companion_getInstancei3za3j1y8ux1,
|
|
1693
1712
|
};
|
|
1694
1713
|
//endregion
|
|
1695
1714
|
|