@flock/wirespec 0.11.9 → 0.12.1
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-annotations.mjs +4 -0
- package/{kotlinx-io-kotlinx-io-bytestring.js.map → arrow-arrow-annotations.mjs.map} +1 -1
- package/arrow-arrow-atomic.mjs +43 -0
- package/arrow-arrow-atomic.mjs.map +1 -0
- package/arrow-arrow-continuations.mjs +18 -0
- package/{kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map → arrow-arrow-continuations.mjs.map} +1 -1
- package/arrow-arrow-core.mjs +532 -0
- package/arrow-arrow-core.mjs.map +1 -0
- package/clikt-clikt.mjs +6648 -0
- package/clikt-clikt.mjs.map +1 -0
- package/colormath-root-colormath.mjs +1696 -0
- package/colormath-root-colormath.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +13106 -0
- package/kotlin-kotlin-stdlib.mjs.map +1 -0
- package/kotlin-openapi-bindings.mjs +13769 -0
- package/kotlin-openapi-bindings.mjs.map +1 -0
- package/kotlin-rgxgen.mjs +4298 -0
- package/kotlin-rgxgen.mjs.map +1 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
- package/{arrow-arrow-annotations.js.map → kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map} +1 -1
- package/kotlinx-io-kotlinx-io-bytestring.mjs +4 -0
- package/{kotlin-kotlin-test.js.map → kotlinx-io-kotlinx-io-bytestring.mjs.map} +1 -1
- package/kotlinx-io-kotlinx-io-core.mjs +2201 -0
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +5880 -0
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +5109 -0
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/markdown.mjs +6753 -0
- package/markdown.mjs.map +1 -0
- package/mordant-mordant.mjs +11839 -0
- package/mordant-mordant.mjs.map +1 -0
- package/package.json +4 -6
- package/wirespec-bin.mjs +18 -0
- package/wirespec-src-compiler-core.mjs +8313 -0
- package/wirespec-src-compiler-core.mjs.map +1 -0
- package/wirespec-src-compiler-lib.mjs +2565 -0
- package/wirespec-src-compiler-lib.mjs.map +1 -0
- package/wirespec-src-converter-avro.mjs +1933 -0
- package/wirespec-src-converter-avro.mjs.map +1 -0
- package/wirespec-src-converter-openapi.mjs +5301 -0
- package/wirespec-src-converter-openapi.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +587 -0
- package/wirespec-src-plugin-arguments.mjs.map +1 -0
- package/wirespec-src-plugin-cli.mjs +1487 -0
- package/wirespec-src-plugin-cli.mjs.map +1 -0
- package/wirespec-src-plugin-npm.d.ts +485 -466
- package/wirespec-src-plugin-npm.mjs +622 -0
- package/wirespec-src-plugin-npm.mjs.map +1 -0
- package/wirespec-src-tools-generator.mjs +284 -0
- package/wirespec-src-tools-generator.mjs.map +1 -0
- package/arrow-arrow-annotations.js +0 -15
- package/arrow-arrow-atomic.js +0 -55
- package/arrow-arrow-atomic.js.map +0 -1
- package/arrow-arrow-continuations.js +0 -30
- package/arrow-arrow-continuations.js.map +0 -1
- package/arrow-arrow-core.js +0 -410
- package/arrow-arrow-core.js.map +0 -1
- package/clikt-clikt.js +0 -6713
- package/clikt-clikt.js.map +0 -1
- package/colormath-root-colormath.js +0 -1727
- package/colormath-root-colormath.js.map +0 -1
- package/kotlin-kotlin-stdlib.js +0 -13263
- package/kotlin-kotlin-stdlib.js.map +0 -1
- package/kotlin-kotlin-test.js +0 -15
- package/kotlin-openapi-bindings.js +0 -13787
- package/kotlin-openapi-bindings.js.map +0 -1
- package/kotlin-rgxgen.js +0 -4315
- package/kotlin-rgxgen.js.map +0 -1
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +0 -15
- package/kotlinx-io-kotlinx-io-bytestring.js +0 -15
- package/kotlinx-io-kotlinx-io-core.js +0 -2219
- package/kotlinx-io-kotlinx-io-core.js.map +0 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js +0 -5914
- package/kotlinx-serialization-kotlinx-serialization-core.js.map +0 -1
- package/kotlinx-serialization-kotlinx-serialization-json.js +0 -5126
- package/kotlinx-serialization-kotlinx-serialization-json.js.map +0 -1
- package/markdown.js +0 -6768
- package/markdown.js.map +0 -1
- package/mordant-mordant.js +0 -11981
- package/mordant-mordant.js.map +0 -1
- package/resources-library.js +0 -15
- package/resources-library.js.map +0 -1
- package/wirespec-bin.js +0 -3
- package/wirespec-src-compiler-core.js +0 -7894
- package/wirespec-src-compiler-core.js.map +0 -1
- package/wirespec-src-compiler-lib.js +0 -2603
- package/wirespec-src-compiler-lib.js.map +0 -1
- package/wirespec-src-converter-avro.js +0 -1650
- package/wirespec-src-converter-avro.js.map +0 -1
- package/wirespec-src-converter-openapi.js +0 -5366
- package/wirespec-src-converter-openapi.js.map +0 -1
- package/wirespec-src-plugin-arguments.js +0 -640
- package/wirespec-src-plugin-arguments.js.map +0 -1
- package/wirespec-src-plugin-cli.js +0 -1222
- package/wirespec-src-plugin-cli.js.map +0 -1
- package/wirespec-src-plugin-npm.js +0 -480
- package/wirespec-src-plugin-npm.js.map +0 -1
- package/wirespec-src-tools-generator.js +0 -306
- package/wirespec-src-tools-generator.js.map +0 -1
|
@@ -0,0 +1,1696 @@
|
|
|
1
|
+
import {
|
|
2
|
+
protoOf180f3jzyo7rfj as protoOf,
|
|
3
|
+
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
|
|
4
|
+
toString1pkumu07cwy4m as toString,
|
|
5
|
+
IllegalArgumentException_init_$Create$sfel9vrfa7w2 as IllegalArgumentException_init_$Create$,
|
|
6
|
+
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
7
|
+
getStringHashCode26igk1bx568vk as getStringHashCode,
|
|
8
|
+
THROW_CCE2g6jy02ryeudk as THROW_CCE,
|
|
9
|
+
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
10
|
+
ArrayList_init_$Create$2rimpp4x9tjd3 as ArrayList_init_$Create$,
|
|
11
|
+
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
12
|
+
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
13
|
+
toString14fd7g605f91p as toString_0,
|
|
14
|
+
Unit_instance14hm69wy3kr8u as Unit_instance,
|
|
15
|
+
_Char___init__impl__6a9atx367vrx0avsvbg as _Char___init__impl__6a9atx,
|
|
16
|
+
arrayConcat3qsij7vh68m69 as arrayConcat,
|
|
17
|
+
listOf1jh22dvmctj1r as listOf,
|
|
18
|
+
withSignc9p5jv9gifer as withSign,
|
|
19
|
+
trimMarginhyd3fsmh8iev as trimMargin,
|
|
20
|
+
hashCodeq5arwsb9dgti as hashCode,
|
|
21
|
+
equals2au1ep9vhcato as equals,
|
|
22
|
+
VOID7hggqo3abtya as VOID,
|
|
23
|
+
initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
|
|
24
|
+
coerceAtLeastklytehohcpeq as coerceAtLeast,
|
|
25
|
+
getNumberHashCode2l4nbdcihl25f as getNumberHashCode,
|
|
26
|
+
numberToDouble210hrknaofnhf as numberToDouble,
|
|
27
|
+
roundToInt1ue8x8yshtznx as roundToInt,
|
|
28
|
+
DoubleCompanionObject_instanceciblawwgcicl as DoubleCompanionObject_instance,
|
|
29
|
+
coerceInlzh524ulyz3c as coerceIn,
|
|
30
|
+
Char19o2r8palgjof as Char,
|
|
31
|
+
toInt5qdj874w69jh as toInt,
|
|
32
|
+
numberRangeToNumber25vse2rgp6rs8 as numberRangeToNumber,
|
|
33
|
+
slice18he6c86ndeu7 as slice,
|
|
34
|
+
startsWith26w8qjqapeeq6 as startsWith,
|
|
35
|
+
isInterface3d6p8outrmvmk as isInterface,
|
|
36
|
+
contentEquals379bkuxwxaiqz as contentEquals,
|
|
37
|
+
coerceAtLeast1b3m6f7g22ivr as coerceAtLeast_0,
|
|
38
|
+
objectCreate1ve4bgxiu4x98 as objectCreate,
|
|
39
|
+
} from './kotlin-kotlin-stdlib.mjs';
|
|
40
|
+
//region block: imports
|
|
41
|
+
var imul = Math.imul;
|
|
42
|
+
var log2 = Math.log2;
|
|
43
|
+
//endregion
|
|
44
|
+
//region block: pre-declaration
|
|
45
|
+
function toXYZ() {
|
|
46
|
+
return this.v2i().w2i();
|
|
47
|
+
}
|
|
48
|
+
initMetadataForInterface(Color, 'Color');
|
|
49
|
+
initMetadataForClass(ColorComponentInfo, 'ColorComponentInfo');
|
|
50
|
+
initMetadataForClass(WhitePoint, 'WhitePoint');
|
|
51
|
+
initMetadataForObject(Illuminant, 'Illuminant');
|
|
52
|
+
initMetadataForClass(Matrix, 'Matrix');
|
|
53
|
+
initMetadataForCompanion(Companion);
|
|
54
|
+
initMetadataForClass(Ansi16, 'Ansi16', VOID, VOID, [Color]);
|
|
55
|
+
initMetadataForCompanion(Companion_0);
|
|
56
|
+
initMetadataForClass(Ansi256, 'Ansi256', VOID, VOID, [Color]);
|
|
57
|
+
initMetadataForCompanion(Companion_1);
|
|
58
|
+
initMetadataForClass(HSV, 'HSV', VOID, VOID, [Color]);
|
|
59
|
+
initMetadataForClass(ICtCp, 'ICtCp', VOID, VOID, [Color]);
|
|
60
|
+
initMetadataForObject(PqNonlinearity, 'PqNonlinearity');
|
|
61
|
+
initMetadataForClass(GammaTransferFunctions, 'GammaTransferFunctions');
|
|
62
|
+
initMetadataForObject(LinearTransferFunctions, 'LinearTransferFunctions');
|
|
63
|
+
function invoke$default(r, g, b, alpha, $super) {
|
|
64
|
+
alpha = alpha === VOID ? 1.0 : alpha;
|
|
65
|
+
return $super === VOID ? this.g2k(r, g, b, alpha) : $super.g2k.call(this, r, g, b, alpha);
|
|
66
|
+
}
|
|
67
|
+
function invoke(r, g, b, alpha) {
|
|
68
|
+
return this.g2k(numberToDouble(r), numberToDouble(g), numberToDouble(b), numberToDouble(alpha));
|
|
69
|
+
}
|
|
70
|
+
function invoke$default_0(r, g, b, alpha, $super) {
|
|
71
|
+
alpha = alpha === VOID ? 1.0 : alpha;
|
|
72
|
+
return $super === VOID ? this.l2l(r, g, b, alpha) : invoke(r, g, b, alpha);
|
|
73
|
+
}
|
|
74
|
+
function from255(r, g, b, alpha) {
|
|
75
|
+
return this.g2k(r / 255.0, g / 255.0, b / 255.0, alpha / 255.0);
|
|
76
|
+
}
|
|
77
|
+
function from255$default(r, g, b, alpha, $super) {
|
|
78
|
+
alpha = alpha === VOID ? 255 : alpha;
|
|
79
|
+
return $super === VOID ? this.m2l(r, g, b, alpha) : from255(r, g, b, alpha);
|
|
80
|
+
}
|
|
81
|
+
function invoke_0(hex) {
|
|
82
|
+
var tmp = parseHex(validateHex(hex), 0);
|
|
83
|
+
var tmp_0 = parseHex(hex, 1);
|
|
84
|
+
var tmp_1 = parseHex(hex, 2);
|
|
85
|
+
var tmp_2;
|
|
86
|
+
// Inline function 'kotlin.let' call
|
|
87
|
+
// Inline function 'com.github.ajalt.colormath.model.RGBColorSpace.invoke.<anonymous>' call
|
|
88
|
+
var it = get_hexLength(hex);
|
|
89
|
+
if (it === 4 || it === 8) {
|
|
90
|
+
tmp_2 = parseHex(hex, 3);
|
|
91
|
+
} else {
|
|
92
|
+
tmp_2 = 255;
|
|
93
|
+
}
|
|
94
|
+
return this.m2l(tmp, tmp_0, tmp_1, tmp_2);
|
|
95
|
+
}
|
|
96
|
+
initMetadataForInterface(RGBColorSpace, 'RGBColorSpace');
|
|
97
|
+
initMetadataForCompanion(Companion_2, VOID, [RGBColorSpace]);
|
|
98
|
+
initMetadataForClass(RGB, 'RGB', VOID, VOID, [Color]);
|
|
99
|
+
initMetadataForObject(RGBColorSpaces, 'RGBColorSpaces');
|
|
100
|
+
initMetadataForObject(SRGB, 'SRGB', VOID, VOID, [RGBColorSpace]);
|
|
101
|
+
initMetadataForClass(RGBColorSpaceImpl, 'RGBColorSpaceImpl', VOID, VOID, [RGBColorSpace]);
|
|
102
|
+
initMetadataForObject(SRGBTransferFunctions, 'SRGBTransferFunctions');
|
|
103
|
+
initMetadataForObject(ACESccTransferFunctions, 'ACESccTransferFunctions');
|
|
104
|
+
initMetadataForObject(ACEScctTransferFunctions, 'ACEScctTransferFunctions');
|
|
105
|
+
initMetadataForObject(BT2020TransferFunctions, 'BT2020TransferFunctions');
|
|
106
|
+
initMetadataForObject(BT709TransferFunctions, 'BT709TransferFunctions');
|
|
107
|
+
initMetadataForObject(ROMMTransferFunctions, 'ROMMTransferFunctions');
|
|
108
|
+
initMetadataForInterface(XYZColorSpace, 'XYZColorSpace');
|
|
109
|
+
initMetadataForCompanion(Companion_3, VOID, [XYZColorSpace]);
|
|
110
|
+
initMetadataForClass(XYZ, 'XYZ', VOID, VOID, [Color]);
|
|
111
|
+
initMetadataForObject(XYZColorSpaces, 'XYZColorSpaces');
|
|
112
|
+
initMetadataForClass(XYZColorSpaceImpl, 'XYZColorSpaceImpl', VOID, VOID, [XYZColorSpace]);
|
|
113
|
+
initMetadataForClass(xyY, 'xyY');
|
|
114
|
+
//endregion
|
|
115
|
+
function Color() {
|
|
116
|
+
}
|
|
117
|
+
function ColorComponentInfo(name, isPolar, min, max) {
|
|
118
|
+
this.c2j_1 = name;
|
|
119
|
+
this.d2j_1 = isPolar;
|
|
120
|
+
this.e2j_1 = min;
|
|
121
|
+
this.f2j_1 = max;
|
|
122
|
+
// Inline function 'kotlin.require' call
|
|
123
|
+
if (!(this.e2j_1 <= this.f2j_1)) {
|
|
124
|
+
// Inline function 'com.github.ajalt.colormath.ColorComponentInfo.<anonymous>' call
|
|
125
|
+
var message = 'min must be less than or equal to max';
|
|
126
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function WhitePoint(name, chromaticity) {
|
|
130
|
+
this.g2j_1 = name;
|
|
131
|
+
this.h2j_1 = chromaticity;
|
|
132
|
+
}
|
|
133
|
+
protoOf(WhitePoint).toString = function () {
|
|
134
|
+
return this.g2j_1;
|
|
135
|
+
};
|
|
136
|
+
protoOf(WhitePoint).hashCode = function () {
|
|
137
|
+
var result = getStringHashCode(this.g2j_1);
|
|
138
|
+
result = imul(result, 31) + this.h2j_1.hashCode() | 0;
|
|
139
|
+
return result;
|
|
140
|
+
};
|
|
141
|
+
protoOf(WhitePoint).equals = function (other) {
|
|
142
|
+
if (this === other)
|
|
143
|
+
return true;
|
|
144
|
+
if (!(other instanceof WhitePoint))
|
|
145
|
+
return false;
|
|
146
|
+
var tmp0_other_with_cast = other instanceof WhitePoint ? other : THROW_CCE();
|
|
147
|
+
if (!(this.g2j_1 === tmp0_other_with_cast.g2j_1))
|
|
148
|
+
return false;
|
|
149
|
+
if (!this.h2j_1.equals(tmp0_other_with_cast.h2j_1))
|
|
150
|
+
return false;
|
|
151
|
+
return true;
|
|
152
|
+
};
|
|
153
|
+
function Illuminant() {
|
|
154
|
+
Illuminant_instance = this;
|
|
155
|
+
this.i2j_1 = new WhitePoint('A', xyY_init_$Create$(0.44758, 0.40745));
|
|
156
|
+
this.j2j_1 = new WhitePoint('B', xyY_init_$Create$(0.34842, 0.35161));
|
|
157
|
+
this.k2j_1 = new WhitePoint('C', xyY_init_$Create$(0.31006, 0.31616));
|
|
158
|
+
this.l2j_1 = new WhitePoint('D50', xyY_init_$Create$(0.3457, 0.3585));
|
|
159
|
+
this.m2j_1 = new WhitePoint('D55', xyY_init_$Create$(0.33243, 0.34744));
|
|
160
|
+
this.n2j_1 = new WhitePoint('D65', xyY_init_$Create$(0.3127, 0.329));
|
|
161
|
+
this.o2j_1 = new WhitePoint('D75', xyY_init_$Create$(0.29903, 0.31488));
|
|
162
|
+
this.p2j_1 = new WhitePoint('E', xyY_init_$Create$(1.0 / 3.0, 1.0 / 3.0));
|
|
163
|
+
}
|
|
164
|
+
var Illuminant_instance;
|
|
165
|
+
function Illuminant_getInstance() {
|
|
166
|
+
if (Illuminant_instance == null)
|
|
167
|
+
new Illuminant();
|
|
168
|
+
return Illuminant_instance;
|
|
169
|
+
}
|
|
170
|
+
function get_alphaInfo() {
|
|
171
|
+
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
172
|
+
return alphaInfo;
|
|
173
|
+
}
|
|
174
|
+
var alphaInfo;
|
|
175
|
+
function zeroOneComponentInfo(name) {
|
|
176
|
+
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
177
|
+
// Inline function 'kotlin.collections.buildList' call
|
|
178
|
+
// Inline function 'kotlin.collections.buildListInternal' call
|
|
179
|
+
// Inline function 'kotlin.apply' call
|
|
180
|
+
var this_0 = ArrayList_init_$Create$();
|
|
181
|
+
// Inline function 'com.github.ajalt.colormath.internal.zeroOneComponentInfo.<anonymous>' call
|
|
182
|
+
// Inline function 'kotlin.text.mapTo' call
|
|
183
|
+
var inductionVariable = 0;
|
|
184
|
+
while (inductionVariable < charSequenceLength(name)) {
|
|
185
|
+
var item = charSequenceGet(name, inductionVariable);
|
|
186
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
187
|
+
// Inline function 'com.github.ajalt.colormath.internal.zeroOneComponentInfo.<anonymous>.<anonymous>' call
|
|
188
|
+
var tmp$ret$0 = new ColorComponentInfo(toString_0(item), false, 0.0, 1.0);
|
|
189
|
+
this_0.e(tmp$ret$0);
|
|
190
|
+
}
|
|
191
|
+
this_0.e(get_alphaInfo());
|
|
192
|
+
return this_0.o5();
|
|
193
|
+
}
|
|
194
|
+
function polarComponentInfo(name, l, r) {
|
|
195
|
+
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
196
|
+
// Inline function 'kotlin.collections.buildList' call
|
|
197
|
+
// Inline function 'kotlin.collections.buildListInternal' call
|
|
198
|
+
// Inline function 'kotlin.apply' call
|
|
199
|
+
var this_0 = ArrayList_init_$Create$();
|
|
200
|
+
// Inline function 'com.github.ajalt.colormath.internal.polarComponentInfo.<anonymous>' call
|
|
201
|
+
// Inline function 'kotlin.text.mapTo' call
|
|
202
|
+
var inductionVariable = 0;
|
|
203
|
+
while (inductionVariable < charSequenceLength(name)) {
|
|
204
|
+
var item = charSequenceGet(name, inductionVariable);
|
|
205
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
206
|
+
// Inline function 'com.github.ajalt.colormath.internal.polarComponentInfo.<anonymous>.<anonymous>' call
|
|
207
|
+
var tmp$ret$0 = new ColorComponentInfo(toString_0(item), item === _Char___init__impl__6a9atx(72), item === _Char___init__impl__6a9atx(72) ? 0.0 : l, item === _Char___init__impl__6a9atx(72) ? 360.0 : r);
|
|
208
|
+
this_0.e(tmp$ret$0);
|
|
209
|
+
}
|
|
210
|
+
this_0.e(get_alphaInfo());
|
|
211
|
+
return this_0.o5();
|
|
212
|
+
}
|
|
213
|
+
function componentInfoList(c) {
|
|
214
|
+
_init_properties_ColorSpaceUtils_kt__cnwylg();
|
|
215
|
+
return listOf(arrayConcat([c, [get_alphaInfo()]]));
|
|
216
|
+
}
|
|
217
|
+
var properties_initialized_ColorSpaceUtils_kt_kskdoe;
|
|
218
|
+
function _init_properties_ColorSpaceUtils_kt__cnwylg() {
|
|
219
|
+
if (!properties_initialized_ColorSpaceUtils_kt_kskdoe) {
|
|
220
|
+
properties_initialized_ColorSpaceUtils_kt_kskdoe = true;
|
|
221
|
+
alphaInfo = new ColorComponentInfo('alpha', false, 0.0, 1.0);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function get_CAT02_XYZ_TO_LMS() {
|
|
225
|
+
_init_properties_Constants_kt__atb1ur();
|
|
226
|
+
return CAT02_XYZ_TO_LMS;
|
|
227
|
+
}
|
|
228
|
+
var CAT02_XYZ_TO_LMS;
|
|
229
|
+
function get_CAT02_LMS_TO_XYZ() {
|
|
230
|
+
_init_properties_Constants_kt__atb1ur();
|
|
231
|
+
return CAT02_LMS_TO_XYZ;
|
|
232
|
+
}
|
|
233
|
+
var CAT02_LMS_TO_XYZ;
|
|
234
|
+
var properties_initialized_Constants_kt_w4w61t;
|
|
235
|
+
function _init_properties_Constants_kt__atb1ur() {
|
|
236
|
+
if (!properties_initialized_Constants_kt_w4w61t) {
|
|
237
|
+
properties_initialized_Constants_kt_w4w61t = true;
|
|
238
|
+
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);
|
|
239
|
+
CAT02_LMS_TO_XYZ = inverse(get_CAT02_XYZ_TO_LMS());
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function spow(_this__u8e3s4, p) {
|
|
243
|
+
return spow_0(_this__u8e3s4, p);
|
|
244
|
+
}
|
|
245
|
+
function normalizeDeg(_this__u8e3s4) {
|
|
246
|
+
return (_this__u8e3s4 % 360.0 + 360.0) % 360.0;
|
|
247
|
+
}
|
|
248
|
+
function spow_0(_this__u8e3s4, p) {
|
|
249
|
+
// Inline function 'kotlin.math.absoluteValue' call
|
|
250
|
+
// Inline function 'kotlin.math.pow' call
|
|
251
|
+
var this_0 = Math.abs(_this__u8e3s4);
|
|
252
|
+
var tmp$ret$1 = Math.pow(this_0, p);
|
|
253
|
+
return withSign(tmp$ret$1, _this__u8e3s4);
|
|
254
|
+
}
|
|
255
|
+
function normalizeDeg_0(_this__u8e3s4) {
|
|
256
|
+
return (_this__u8e3s4 % 360.0 + 360.0) % 360.0;
|
|
257
|
+
}
|
|
258
|
+
function _Matrix___init__impl__q3kp4w(rowMajor) {
|
|
259
|
+
return rowMajor;
|
|
260
|
+
}
|
|
261
|
+
function _Matrix___get_rowMajor__impl__vmgxkq($this) {
|
|
262
|
+
return $this;
|
|
263
|
+
}
|
|
264
|
+
function _Matrix___init__impl__q3kp4w_0(v00, v10, v20, v01, v11, v21, v02, v12, v22) {
|
|
265
|
+
// Inline function 'kotlin.floatArrayOf' call
|
|
266
|
+
var tmp$ret$0 = new Float32Array([v00, v10, v20, v01, v11, v21, v02, v12, v22]);
|
|
267
|
+
return _Matrix___init__impl__q3kp4w(tmp$ret$0);
|
|
268
|
+
}
|
|
269
|
+
function Matrix__copy_impl_kmkvzd($this) {
|
|
270
|
+
// Inline function 'kotlin.collections.copyOf' call
|
|
271
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
272
|
+
var tmp$ret$1 = _Matrix___get_rowMajor__impl__vmgxkq($this).slice();
|
|
273
|
+
return _Matrix___init__impl__q3kp4w(tmp$ret$1);
|
|
274
|
+
}
|
|
275
|
+
function Matrix__get_impl_xogbpk($this, x, y) {
|
|
276
|
+
return _Matrix___get_rowMajor__impl__vmgxkq($this)[imul(y, 3) + x | 0];
|
|
277
|
+
}
|
|
278
|
+
function Matrix__set_impl_s2l54c($this, x, y, value) {
|
|
279
|
+
_Matrix___get_rowMajor__impl__vmgxkq($this)[imul(y, 3) + x | 0] = value;
|
|
280
|
+
}
|
|
281
|
+
function Matrix__set_impl_s2l54c_0($this, x, y, value) {
|
|
282
|
+
return Matrix__set_impl_s2l54c($this, x, y, value);
|
|
283
|
+
}
|
|
284
|
+
function Matrix__toString_impl_l0abk0($this) {
|
|
285
|
+
return trimMargin('Mat3(\n | ' + Matrix__get_impl_xogbpk($this, 0, 0) + ', ' + Matrix__get_impl_xogbpk($this, 1, 0) + ', ' + Matrix__get_impl_xogbpk($this, 2, 0) + ', \n | ' + Matrix__get_impl_xogbpk($this, 0, 1) + ', ' + Matrix__get_impl_xogbpk($this, 1, 1) + ', ' + Matrix__get_impl_xogbpk($this, 2, 1) + ', \n | ' + Matrix__get_impl_xogbpk($this, 0, 2) + ', ' + Matrix__get_impl_xogbpk($this, 1, 2) + ', ' + Matrix__get_impl_xogbpk($this, 2, 2) + ', \n |)\n ');
|
|
286
|
+
}
|
|
287
|
+
function Matrix__hashCode_impl_s9ntm9($this) {
|
|
288
|
+
return hashCode($this);
|
|
289
|
+
}
|
|
290
|
+
function Matrix__equals_impl_g5p8p9($this, other) {
|
|
291
|
+
if (!(other instanceof Matrix))
|
|
292
|
+
return false;
|
|
293
|
+
var tmp0_other_with_cast = other instanceof Matrix ? other.q2j_1 : THROW_CCE();
|
|
294
|
+
if (!equals($this, tmp0_other_with_cast))
|
|
295
|
+
return false;
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
function Matrix(rowMajor) {
|
|
299
|
+
this.q2j_1 = rowMajor;
|
|
300
|
+
}
|
|
301
|
+
protoOf(Matrix).toString = function () {
|
|
302
|
+
return Matrix__toString_impl_l0abk0(this.q2j_1);
|
|
303
|
+
};
|
|
304
|
+
protoOf(Matrix).hashCode = function () {
|
|
305
|
+
return Matrix__hashCode_impl_s9ntm9(this.q2j_1);
|
|
306
|
+
};
|
|
307
|
+
protoOf(Matrix).equals = function (other) {
|
|
308
|
+
return Matrix__equals_impl_g5p8p9(this.q2j_1, other);
|
|
309
|
+
};
|
|
310
|
+
function inverse(_this__u8e3s4, inPlace) {
|
|
311
|
+
inPlace = inPlace === VOID ? false : inPlace;
|
|
312
|
+
var a = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 0);
|
|
313
|
+
var b = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 0);
|
|
314
|
+
var c = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 0);
|
|
315
|
+
var d = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 1);
|
|
316
|
+
var e = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 1);
|
|
317
|
+
var f = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 1);
|
|
318
|
+
var g = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 2);
|
|
319
|
+
var h = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 2);
|
|
320
|
+
var i = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 2);
|
|
321
|
+
var A = e * i - h * f;
|
|
322
|
+
var B = h * c - b * i;
|
|
323
|
+
var C = b * f - e * c;
|
|
324
|
+
var det = a * A + d * B + g * C;
|
|
325
|
+
var out = inPlace ? _this__u8e3s4 : Matrix__copy_impl_kmkvzd(_this__u8e3s4);
|
|
326
|
+
Matrix__set_impl_s2l54c_0(out, 0, 0, A / det);
|
|
327
|
+
Matrix__set_impl_s2l54c_0(out, 0, 1, (g * f - d * i) / det);
|
|
328
|
+
Matrix__set_impl_s2l54c_0(out, 0, 2, (d * h - g * e) / det);
|
|
329
|
+
Matrix__set_impl_s2l54c_0(out, 1, 0, B / det);
|
|
330
|
+
Matrix__set_impl_s2l54c_0(out, 1, 1, (a * i - g * c) / det);
|
|
331
|
+
Matrix__set_impl_s2l54c_0(out, 1, 2, (g * b - a * h) / det);
|
|
332
|
+
Matrix__set_impl_s2l54c_0(out, 2, 0, C / det);
|
|
333
|
+
Matrix__set_impl_s2l54c_0(out, 2, 1, (d * c - a * f) / det);
|
|
334
|
+
Matrix__set_impl_s2l54c_0(out, 2, 2, (a * e - d * b) / det);
|
|
335
|
+
return out;
|
|
336
|
+
}
|
|
337
|
+
function scalarDiv(_this__u8e3s4, x, inPlace) {
|
|
338
|
+
inPlace = inPlace === VOID ? false : inPlace;
|
|
339
|
+
var out = _Matrix___get_rowMajor__impl__vmgxkq(inPlace ? _this__u8e3s4 : Matrix__copy_impl_kmkvzd(_this__u8e3s4));
|
|
340
|
+
var inductionVariable = 0;
|
|
341
|
+
var last = out.length - 1 | 0;
|
|
342
|
+
if (inductionVariable <= last)
|
|
343
|
+
do {
|
|
344
|
+
var i = inductionVariable;
|
|
345
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
346
|
+
out[i] = out[i] / x;
|
|
347
|
+
}
|
|
348
|
+
while (inductionVariable <= last);
|
|
349
|
+
return _Matrix___init__impl__q3kp4w(out);
|
|
350
|
+
}
|
|
351
|
+
function dot(_this__u8e3s4, other) {
|
|
352
|
+
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));
|
|
353
|
+
}
|
|
354
|
+
function dotDiagonal(_this__u8e3s4, v0, v1, v2) {
|
|
355
|
+
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);
|
|
356
|
+
}
|
|
357
|
+
function _Vector___init__impl__y7x4qq(values) {
|
|
358
|
+
return values;
|
|
359
|
+
}
|
|
360
|
+
function _Vector___get_values__impl__3gdbp5($this) {
|
|
361
|
+
return $this;
|
|
362
|
+
}
|
|
363
|
+
function _Vector___init__impl__y7x4qq_0(v0, v1, v2) {
|
|
364
|
+
// Inline function 'kotlin.floatArrayOf' call
|
|
365
|
+
var tmp$ret$0 = new Float32Array([v0, v1, v2]);
|
|
366
|
+
return _Vector___init__impl__y7x4qq(tmp$ret$0);
|
|
367
|
+
}
|
|
368
|
+
function _Vector___get_l__impl__envr1l($this) {
|
|
369
|
+
return _Vector___get_values__impl__3gdbp5($this)[0];
|
|
370
|
+
}
|
|
371
|
+
function _Vector___get_m__impl__e5qq0m($this) {
|
|
372
|
+
return _Vector___get_values__impl__3gdbp5($this)[1];
|
|
373
|
+
}
|
|
374
|
+
function _Vector___get_s__impl__pzuljk($this) {
|
|
375
|
+
return _Vector___get_values__impl__3gdbp5($this)[2];
|
|
376
|
+
}
|
|
377
|
+
function dot_0(_this__u8e3s4, v0, v1, v2) {
|
|
378
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
379
|
+
var tmp4 = 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;
|
|
380
|
+
var tmp5 = 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;
|
|
381
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot.stub_for_inlining' call
|
|
382
|
+
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(tmp4, tmp5, p2);
|
|
384
|
+
}
|
|
385
|
+
function dot$f($this_dot, $other, x, y) {
|
|
386
|
+
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
|
+
}
|
|
388
|
+
function Companion() {
|
|
389
|
+
Companion_instance = this;
|
|
390
|
+
this.r2j_1 = componentInfoList([new ColorComponentInfo('code', false, 30.0, 107.0)]);
|
|
391
|
+
}
|
|
392
|
+
protoOf(Companion).s2j = function () {
|
|
393
|
+
return this.r2j_1;
|
|
394
|
+
};
|
|
395
|
+
var Companion_instance;
|
|
396
|
+
function Companion_getInstance() {
|
|
397
|
+
if (Companion_instance == null)
|
|
398
|
+
new Companion();
|
|
399
|
+
return Companion_instance;
|
|
400
|
+
}
|
|
401
|
+
function Ansi16(code) {
|
|
402
|
+
Companion_getInstance();
|
|
403
|
+
this.t2j_1 = code;
|
|
404
|
+
}
|
|
405
|
+
protoOf(Ansi16).u2i = function () {
|
|
406
|
+
return Companion_getInstance();
|
|
407
|
+
};
|
|
408
|
+
protoOf(Ansi16).v2i = function () {
|
|
409
|
+
switch (this.t2j_1) {
|
|
410
|
+
case 30:
|
|
411
|
+
case 40:
|
|
412
|
+
return Companion_getInstance_2().u2j(0.0, 0.0, 0.0);
|
|
413
|
+
case 90:
|
|
414
|
+
case 100:
|
|
415
|
+
return Companion_getInstance_2().v2j(128, 128, 128);
|
|
416
|
+
case 37:
|
|
417
|
+
case 47:
|
|
418
|
+
return Companion_getInstance_2().v2j(192, 192, 192);
|
|
419
|
+
case 97:
|
|
420
|
+
case 107:
|
|
421
|
+
return Companion_getInstance_2().u2j(1.0, 1.0, 1.0);
|
|
422
|
+
}
|
|
423
|
+
var color = this.t2j_1 % 10 | 0;
|
|
424
|
+
var mul = this.t2j_1 > 50 ? 1.0 : 0.5;
|
|
425
|
+
var r = (color % 2 | 0) * mul;
|
|
426
|
+
var g = ((color / 2 | 0) % 2 | 0) * mul;
|
|
427
|
+
var b = ((color / 4 | 0) % 2 | 0) * mul;
|
|
428
|
+
return Companion_getInstance_2().u2j(r, g, b);
|
|
429
|
+
};
|
|
430
|
+
protoOf(Ansi16).toString = function () {
|
|
431
|
+
return 'Ansi16(code=' + this.t2j_1 + ')';
|
|
432
|
+
};
|
|
433
|
+
protoOf(Ansi16).hashCode = function () {
|
|
434
|
+
return this.t2j_1;
|
|
435
|
+
};
|
|
436
|
+
protoOf(Ansi16).equals = function (other) {
|
|
437
|
+
if (this === other)
|
|
438
|
+
return true;
|
|
439
|
+
if (!(other instanceof Ansi16))
|
|
440
|
+
return false;
|
|
441
|
+
var tmp0_other_with_cast = other instanceof Ansi16 ? other : THROW_CCE();
|
|
442
|
+
if (!(this.t2j_1 === tmp0_other_with_cast.t2j_1))
|
|
443
|
+
return false;
|
|
444
|
+
return true;
|
|
445
|
+
};
|
|
446
|
+
function Companion_0() {
|
|
447
|
+
Companion_instance_0 = this;
|
|
448
|
+
this.w2j_1 = componentInfoList([new ColorComponentInfo('code', false, 0.0, 255.0)]);
|
|
449
|
+
}
|
|
450
|
+
protoOf(Companion_0).s2j = function () {
|
|
451
|
+
return this.w2j_1;
|
|
452
|
+
};
|
|
453
|
+
var Companion_instance_0;
|
|
454
|
+
function Companion_getInstance_0() {
|
|
455
|
+
if (Companion_instance_0 == null)
|
|
456
|
+
new Companion_0();
|
|
457
|
+
return Companion_instance_0;
|
|
458
|
+
}
|
|
459
|
+
function Ansi256(code) {
|
|
460
|
+
Companion_getInstance_0();
|
|
461
|
+
this.x2j_1 = code;
|
|
462
|
+
}
|
|
463
|
+
protoOf(Ansi256).u2i = function () {
|
|
464
|
+
return Companion_getInstance_0();
|
|
465
|
+
};
|
|
466
|
+
protoOf(Ansi256).v2i = function () {
|
|
467
|
+
if (this.x2j_1 < 16)
|
|
468
|
+
return this.y2j().v2i();
|
|
469
|
+
if (this.x2j_1 >= 232) {
|
|
470
|
+
var c = imul(this.x2j_1 - 232 | 0, 10) + 8 | 0;
|
|
471
|
+
return Companion_getInstance_2().v2j(c, c, c);
|
|
472
|
+
}
|
|
473
|
+
var c_0 = this.x2j_1 - 16 | 0;
|
|
474
|
+
var rem = c_0 % 36 | 0;
|
|
475
|
+
// Inline function 'kotlin.math.floor' call
|
|
476
|
+
var x = c_0 / 36.0;
|
|
477
|
+
var r = Math.floor(x) / 5.0;
|
|
478
|
+
// Inline function 'kotlin.math.floor' call
|
|
479
|
+
var x_0 = rem / 6.0;
|
|
480
|
+
var g = Math.floor(x_0) / 5.0;
|
|
481
|
+
var b = (rem % 6 | 0) / 5.0;
|
|
482
|
+
return Companion_getInstance_2().z2j(r, g, b);
|
|
483
|
+
};
|
|
484
|
+
protoOf(Ansi256).y2j = function () {
|
|
485
|
+
return this.x2j_1 < 8 ? new Ansi16(this.x2j_1 + 30 | 0) : this.x2j_1 < 16 ? new Ansi16((this.x2j_1 - 8 | 0) + 90 | 0) : this.v2i().y2j();
|
|
486
|
+
};
|
|
487
|
+
protoOf(Ansi256).toString = function () {
|
|
488
|
+
return 'Ansi256(code=' + this.x2j_1 + ')';
|
|
489
|
+
};
|
|
490
|
+
protoOf(Ansi256).hashCode = function () {
|
|
491
|
+
return this.x2j_1;
|
|
492
|
+
};
|
|
493
|
+
protoOf(Ansi256).equals = function (other) {
|
|
494
|
+
if (this === other)
|
|
495
|
+
return true;
|
|
496
|
+
if (!(other instanceof Ansi256))
|
|
497
|
+
return false;
|
|
498
|
+
var tmp0_other_with_cast = other instanceof Ansi256 ? other : THROW_CCE();
|
|
499
|
+
if (!(this.x2j_1 === tmp0_other_with_cast.x2j_1))
|
|
500
|
+
return false;
|
|
501
|
+
return true;
|
|
502
|
+
};
|
|
503
|
+
function Companion_1() {
|
|
504
|
+
Companion_instance_1 = this;
|
|
505
|
+
this.a2k_1 = polarComponentInfo('HSV', 0.0, 1.0);
|
|
506
|
+
}
|
|
507
|
+
protoOf(Companion_1).s2j = function () {
|
|
508
|
+
return this.a2k_1;
|
|
509
|
+
};
|
|
510
|
+
var Companion_instance_1;
|
|
511
|
+
function Companion_getInstance_1() {
|
|
512
|
+
if (Companion_instance_1 == null)
|
|
513
|
+
new Companion_1();
|
|
514
|
+
return Companion_instance_1;
|
|
515
|
+
}
|
|
516
|
+
function toSRGB$f(h, v, s, n) {
|
|
517
|
+
var k = (n + h) % 6;
|
|
518
|
+
var tmp = v * s;
|
|
519
|
+
// Inline function 'kotlin.comparisons.minOf' call
|
|
520
|
+
var b = 4 - k;
|
|
521
|
+
var tmp$ret$0 = Math.min(k, b, 1.0);
|
|
522
|
+
return v - tmp * coerceAtLeast(tmp$ret$0, 0.0);
|
|
523
|
+
}
|
|
524
|
+
function HSV(h, s, v, alpha) {
|
|
525
|
+
Companion_getInstance_1();
|
|
526
|
+
alpha = alpha === VOID ? 1.0 : alpha;
|
|
527
|
+
this.b2k_1 = h;
|
|
528
|
+
this.c2k_1 = s;
|
|
529
|
+
this.d2k_1 = v;
|
|
530
|
+
this.e2k_1 = alpha;
|
|
531
|
+
}
|
|
532
|
+
protoOf(HSV).u2i = function () {
|
|
533
|
+
return Companion_getInstance_1();
|
|
534
|
+
};
|
|
535
|
+
protoOf(HSV).v2i = function () {
|
|
536
|
+
if (this.c2k_1 < 1.0E-7)
|
|
537
|
+
return Companion_getInstance_2().g2k(this.d2k_1, this.d2k_1, this.d2k_1, this.e2k_1);
|
|
538
|
+
var v = this.d2k_1;
|
|
539
|
+
var h = normalizeDeg_0(this.b2k_1) / 60.0;
|
|
540
|
+
var s = this.c2k_1;
|
|
541
|
+
return SRGB_getInstance().g2k(toSRGB$f(h, v, s, 5), toSRGB$f(h, v, s, 3), toSRGB$f(h, v, s, 1), this.e2k_1);
|
|
542
|
+
};
|
|
543
|
+
protoOf(HSV).toString = function () {
|
|
544
|
+
return 'HSV(h=' + this.b2k_1 + ', s=' + this.c2k_1 + ', v=' + this.d2k_1 + ', alpha=' + this.e2k_1 + ')';
|
|
545
|
+
};
|
|
546
|
+
protoOf(HSV).hashCode = function () {
|
|
547
|
+
var result = getNumberHashCode(this.b2k_1);
|
|
548
|
+
result = imul(result, 31) + getNumberHashCode(this.c2k_1) | 0;
|
|
549
|
+
result = imul(result, 31) + getNumberHashCode(this.d2k_1) | 0;
|
|
550
|
+
result = imul(result, 31) + getNumberHashCode(this.e2k_1) | 0;
|
|
551
|
+
return result;
|
|
552
|
+
};
|
|
553
|
+
protoOf(HSV).equals = function (other) {
|
|
554
|
+
if (this === other)
|
|
555
|
+
return true;
|
|
556
|
+
if (!(other instanceof HSV))
|
|
557
|
+
return false;
|
|
558
|
+
var tmp0_other_with_cast = other instanceof HSV ? other : THROW_CCE();
|
|
559
|
+
if (!equals(this.b2k_1, tmp0_other_with_cast.b2k_1))
|
|
560
|
+
return false;
|
|
561
|
+
if (!equals(this.c2k_1, tmp0_other_with_cast.c2k_1))
|
|
562
|
+
return false;
|
|
563
|
+
if (!equals(this.d2k_1, tmp0_other_with_cast.d2k_1))
|
|
564
|
+
return false;
|
|
565
|
+
if (!equals(this.e2k_1, tmp0_other_with_cast.e2k_1))
|
|
566
|
+
return false;
|
|
567
|
+
return true;
|
|
568
|
+
};
|
|
569
|
+
function get_ICTCP_RGB_TO_LMS() {
|
|
570
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
571
|
+
return ICTCP_RGB_TO_LMS;
|
|
572
|
+
}
|
|
573
|
+
var ICTCP_RGB_TO_LMS;
|
|
574
|
+
function get_ICTCP_LMS_TO_ICTCP() {
|
|
575
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
576
|
+
return ICTCP_LMS_TO_ICTCP;
|
|
577
|
+
}
|
|
578
|
+
var ICTCP_LMS_TO_ICTCP;
|
|
579
|
+
function get_ICTCP_LMS_to_RGB() {
|
|
580
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
581
|
+
return ICTCP_LMS_to_RGB;
|
|
582
|
+
}
|
|
583
|
+
var ICTCP_LMS_to_RGB;
|
|
584
|
+
function get_ICTCP_ICTCP_to_LMS() {
|
|
585
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
586
|
+
return ICTCP_ICTCP_to_LMS;
|
|
587
|
+
}
|
|
588
|
+
var ICTCP_ICTCP_to_LMS;
|
|
589
|
+
function get_ICTCP_CROSSTALK() {
|
|
590
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
591
|
+
return ICTCP_CROSSTALK;
|
|
592
|
+
}
|
|
593
|
+
var ICTCP_CROSSTALK;
|
|
594
|
+
function get_HPE_XYZ_TO_LMS() {
|
|
595
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
596
|
+
return HPE_XYZ_TO_LMS;
|
|
597
|
+
}
|
|
598
|
+
var HPE_XYZ_TO_LMS;
|
|
599
|
+
function get_ICTCP_XYZ_TO_LMS() {
|
|
600
|
+
_init_properties_ICtCp_kt__7vx7or();
|
|
601
|
+
return ICTCP_XYZ_TO_LMS;
|
|
602
|
+
}
|
|
603
|
+
var ICTCP_XYZ_TO_LMS;
|
|
604
|
+
var ICTCP_LMS_TO_XYZ;
|
|
605
|
+
function ICtCp() {
|
|
606
|
+
}
|
|
607
|
+
protoOf(ICtCp).m2k = function () {
|
|
608
|
+
var fo = RGBColorSpaces_getInstance().u2k_1.z2k();
|
|
609
|
+
var tmp0 = get_ICTCP_ICTCP_to_LMS();
|
|
610
|
+
var tmp1 = this.i2k_1;
|
|
611
|
+
var tmp2 = this.j2k_1;
|
|
612
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
613
|
+
var v2 = this.k2k_1;
|
|
614
|
+
var tmp4 = Matrix__get_impl_xogbpk(tmp0, 0, 0) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 0) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 0) * v2;
|
|
615
|
+
var tmp5 = Matrix__get_impl_xogbpk(tmp0, 0, 1) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 1) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 1) * v2;
|
|
616
|
+
// Inline function 'com.github.ajalt.colormath.model.ICtCp.toBT2020.<anonymous>' call
|
|
617
|
+
var s = Matrix__get_impl_xogbpk(tmp0, 0, 2) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 2) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 2) * v2;
|
|
618
|
+
var tmp0_0 = get_ICTCP_LMS_to_RGB();
|
|
619
|
+
var tmp1_0 = PqNonlinearity_instance.i2l(tmp4);
|
|
620
|
+
var tmp2_0 = PqNonlinearity_instance.i2l(tmp5);
|
|
621
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
622
|
+
var v2_0 = PqNonlinearity_instance.i2l(s);
|
|
623
|
+
var tmp4_0 = Matrix__get_impl_xogbpk(tmp0_0, 0, 0) * tmp1_0 + Matrix__get_impl_xogbpk(tmp0_0, 1, 0) * tmp2_0 + Matrix__get_impl_xogbpk(tmp0_0, 2, 0) * v2_0;
|
|
624
|
+
var tmp5_0 = Matrix__get_impl_xogbpk(tmp0_0, 0, 1) * tmp1_0 + Matrix__get_impl_xogbpk(tmp0_0, 1, 1) * tmp2_0 + Matrix__get_impl_xogbpk(tmp0_0, 2, 1) * v2_0;
|
|
625
|
+
// Inline function 'com.github.ajalt.colormath.model.ICtCp.toBT2020.<anonymous>.<anonymous>' call
|
|
626
|
+
var b = Matrix__get_impl_xogbpk(tmp0_0, 0, 2) * tmp1_0 + Matrix__get_impl_xogbpk(tmp0_0, 1, 2) * tmp2_0 + Matrix__get_impl_xogbpk(tmp0_0, 2, 2) * v2_0;
|
|
627
|
+
return RGBColorSpaces_getInstance().u2k_1.g2k(fo.j2l(tmp4_0), fo.j2l(tmp5_0), fo.j2l(b), this.l2k_1);
|
|
628
|
+
};
|
|
629
|
+
function PqNonlinearity() {
|
|
630
|
+
this.a2l_1 = 0.1593017578125;
|
|
631
|
+
this.b2l_1 = 78.84375;
|
|
632
|
+
this.c2l_1 = 0.8359375;
|
|
633
|
+
this.d2l_1 = 18.8515625;
|
|
634
|
+
this.e2l_1 = 18.6875;
|
|
635
|
+
this.f2l_1 = 10000.0;
|
|
636
|
+
this.g2l_1 = 6.277394636015326;
|
|
637
|
+
this.h2l_1 = 0.012683313515655966;
|
|
638
|
+
}
|
|
639
|
+
protoOf(PqNonlinearity).i2l = function (x) {
|
|
640
|
+
var vp = spow(x, 0.012683313515655966);
|
|
641
|
+
var n = coerceAtLeast(vp - 0.8359375, 0.0);
|
|
642
|
+
var tmp = n / (18.8515625 - 18.6875 * vp);
|
|
643
|
+
var l = spow_0(tmp, 6.277394636015326);
|
|
644
|
+
return 10000.0 * l;
|
|
645
|
+
};
|
|
646
|
+
protoOf(PqNonlinearity).j2l = function (x) {
|
|
647
|
+
var tmp = x / 10000.0;
|
|
648
|
+
var yp = spow_0(tmp, 0.1593017578125);
|
|
649
|
+
var tmp_0 = 0.8359375 + 18.8515625 * yp;
|
|
650
|
+
var tmp_1 = tmp_0 / (1.0 + 18.6875 * yp);
|
|
651
|
+
return spow_0(tmp_1, 78.84375);
|
|
652
|
+
};
|
|
653
|
+
var PqNonlinearity_instance;
|
|
654
|
+
function PqNonlinearity_getInstance() {
|
|
655
|
+
return PqNonlinearity_instance;
|
|
656
|
+
}
|
|
657
|
+
var properties_initialized_ICtCp_kt_w6y8uv;
|
|
658
|
+
function _init_properties_ICtCp_kt__7vx7or() {
|
|
659
|
+
if (!properties_initialized_ICtCp_kt_w6y8uv) {
|
|
660
|
+
properties_initialized_ICtCp_kt_w6y8uv = true;
|
|
661
|
+
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);
|
|
662
|
+
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);
|
|
663
|
+
ICTCP_LMS_to_RGB = inverse(get_ICTCP_RGB_TO_LMS());
|
|
664
|
+
ICTCP_ICTCP_to_LMS = inverse(get_ICTCP_LMS_TO_ICTCP());
|
|
665
|
+
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);
|
|
666
|
+
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);
|
|
667
|
+
ICTCP_XYZ_TO_LMS = dot(get_ICTCP_CROSSTALK(), get_HPE_XYZ_TO_LMS());
|
|
668
|
+
ICTCP_LMS_TO_XYZ = inverse(get_ICTCP_XYZ_TO_LMS());
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
function GammaTransferFunctions(gamma) {
|
|
672
|
+
this.k2l_1 = gamma;
|
|
673
|
+
}
|
|
674
|
+
protoOf(GammaTransferFunctions).i2l = function (x) {
|
|
675
|
+
return spow(x, this.k2l_1);
|
|
676
|
+
};
|
|
677
|
+
protoOf(GammaTransferFunctions).j2l = function (x) {
|
|
678
|
+
return spow(x, 1.0 / this.k2l_1);
|
|
679
|
+
};
|
|
680
|
+
protoOf(GammaTransferFunctions).toString = function () {
|
|
681
|
+
return 'GammaTransferFunctions(gamma=' + this.k2l_1 + ')';
|
|
682
|
+
};
|
|
683
|
+
protoOf(GammaTransferFunctions).hashCode = function () {
|
|
684
|
+
return getNumberHashCode(this.k2l_1);
|
|
685
|
+
};
|
|
686
|
+
protoOf(GammaTransferFunctions).equals = function (other) {
|
|
687
|
+
if (this === other)
|
|
688
|
+
return true;
|
|
689
|
+
if (!(other instanceof GammaTransferFunctions))
|
|
690
|
+
return false;
|
|
691
|
+
var tmp0_other_with_cast = other instanceof GammaTransferFunctions ? other : THROW_CCE();
|
|
692
|
+
if (!equals(this.k2l_1, tmp0_other_with_cast.k2l_1))
|
|
693
|
+
return false;
|
|
694
|
+
return true;
|
|
695
|
+
};
|
|
696
|
+
function LinearTransferFunctions() {
|
|
697
|
+
}
|
|
698
|
+
protoOf(LinearTransferFunctions).i2l = function (x) {
|
|
699
|
+
return x;
|
|
700
|
+
};
|
|
701
|
+
protoOf(LinearTransferFunctions).j2l = function (x) {
|
|
702
|
+
return x;
|
|
703
|
+
};
|
|
704
|
+
var LinearTransferFunctions_instance;
|
|
705
|
+
function LinearTransferFunctions_getInstance() {
|
|
706
|
+
return LinearTransferFunctions_instance;
|
|
707
|
+
}
|
|
708
|
+
function RGBColorSpace() {
|
|
709
|
+
}
|
|
710
|
+
function Companion_2() {
|
|
711
|
+
Companion_instance_2 = this;
|
|
712
|
+
this.f2k_1 = RGBColorSpaces_getInstance().n2k_1;
|
|
713
|
+
}
|
|
714
|
+
protoOf(Companion_2).s2j = function () {
|
|
715
|
+
return this.f2k_1.s2j();
|
|
716
|
+
};
|
|
717
|
+
protoOf(Companion_2).p2l = function () {
|
|
718
|
+
return this.f2k_1.p2l();
|
|
719
|
+
};
|
|
720
|
+
protoOf(Companion_2).o2l = function () {
|
|
721
|
+
return this.f2k_1.o2l();
|
|
722
|
+
};
|
|
723
|
+
protoOf(Companion_2).q2 = function () {
|
|
724
|
+
return this.f2k_1.q2();
|
|
725
|
+
};
|
|
726
|
+
protoOf(Companion_2).z2k = function () {
|
|
727
|
+
return this.f2k_1.z2k();
|
|
728
|
+
};
|
|
729
|
+
protoOf(Companion_2).q2l = function () {
|
|
730
|
+
return this.f2k_1.q2l();
|
|
731
|
+
};
|
|
732
|
+
protoOf(Companion_2).m2l = function (r, g, b, alpha) {
|
|
733
|
+
return this.f2k_1.m2l(r, g, b, alpha);
|
|
734
|
+
};
|
|
735
|
+
protoOf(Companion_2).g2k = function (r, g, b, alpha) {
|
|
736
|
+
return this.f2k_1.g2k(r, g, b, alpha);
|
|
737
|
+
};
|
|
738
|
+
protoOf(Companion_2).l2l = function (r, g, b, alpha) {
|
|
739
|
+
return this.f2k_1.l2l(r, g, b, alpha);
|
|
740
|
+
};
|
|
741
|
+
protoOf(Companion_2).n2l = function (hex) {
|
|
742
|
+
return this.f2k_1.n2l(hex);
|
|
743
|
+
};
|
|
744
|
+
protoOf(Companion_2).equals = function (other) {
|
|
745
|
+
return equals(RGBColorSpaces_getInstance().n2k_1, other);
|
|
746
|
+
};
|
|
747
|
+
protoOf(Companion_2).hashCode = function () {
|
|
748
|
+
return hashCode(RGBColorSpaces_getInstance().n2k_1);
|
|
749
|
+
};
|
|
750
|
+
var Companion_instance_2;
|
|
751
|
+
function Companion_getInstance_2() {
|
|
752
|
+
if (Companion_instance_2 == null)
|
|
753
|
+
new Companion_2();
|
|
754
|
+
return Companion_instance_2;
|
|
755
|
+
}
|
|
756
|
+
function clamp$copy(receiver, p0, p1, p2, p3) {
|
|
757
|
+
return receiver.r2l(p0, p1, p2, p3);
|
|
758
|
+
}
|
|
759
|
+
function RGB(r, g, b, alpha, space) {
|
|
760
|
+
Companion_getInstance_2();
|
|
761
|
+
this.x2i_1 = r;
|
|
762
|
+
this.y2i_1 = g;
|
|
763
|
+
this.z2i_1 = b;
|
|
764
|
+
this.a2j_1 = alpha;
|
|
765
|
+
this.b2j_1 = space;
|
|
766
|
+
}
|
|
767
|
+
protoOf(RGB).u2i = function () {
|
|
768
|
+
return this.b2j_1;
|
|
769
|
+
};
|
|
770
|
+
protoOf(RGB).s2l = function () {
|
|
771
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
772
|
+
var this_0 = this.x2i_1 * 255;
|
|
773
|
+
return roundToInt(this_0);
|
|
774
|
+
};
|
|
775
|
+
protoOf(RGB).t2l = function () {
|
|
776
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
777
|
+
var this_0 = this.y2i_1 * 255;
|
|
778
|
+
return roundToInt(this_0);
|
|
779
|
+
};
|
|
780
|
+
protoOf(RGB).u2l = function () {
|
|
781
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
782
|
+
var this_0 = this.z2i_1 * 255;
|
|
783
|
+
return roundToInt(this_0);
|
|
784
|
+
};
|
|
785
|
+
protoOf(RGB).v2l = function (space) {
|
|
786
|
+
var f = SRGB_getInstance().z2k();
|
|
787
|
+
return equals(this.b2j_1, space) ? this : equals(this.b2j_1, SRGB_getInstance()) && equals(space, RGBColorSpaces_getInstance().o2k_1) ? space.g2k(f.i2l(this.x2i_1), f.i2l(this.y2i_1), f.i2l(this.z2i_1), this.a2j_1) : equals(this.b2j_1, RGBColorSpaces_getInstance().o2k_1) && equals(space, SRGB_getInstance()) ? space.g2k(f.j2l(this.x2i_1), f.j2l(this.y2i_1), f.j2l(this.z2i_1), this.a2j_1) : this.w2i().b2m(space);
|
|
788
|
+
};
|
|
789
|
+
protoOf(RGB).c2m = function () {
|
|
790
|
+
var tmp$ret$3;
|
|
791
|
+
$l$block: {
|
|
792
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.srgbHueMinMaxChroma' call
|
|
793
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
794
|
+
var $this$toSRGB = this.v2l(SRGB_getInstance());
|
|
795
|
+
var r = $this$toSRGB.x2i_1;
|
|
796
|
+
var g = $this$toSRGB.y2i_1;
|
|
797
|
+
var b = $this$toSRGB.z2i_1;
|
|
798
|
+
// Inline function 'kotlin.comparisons.minOf' call
|
|
799
|
+
var min = Math.min(r, g, b);
|
|
800
|
+
// Inline function 'kotlin.comparisons.maxOf' call
|
|
801
|
+
var max = Math.max(r, g, b);
|
|
802
|
+
var chroma = max - min;
|
|
803
|
+
var tmp;
|
|
804
|
+
if (chroma < 1.0E-7) {
|
|
805
|
+
tmp = NaN;
|
|
806
|
+
} else if (r === max) {
|
|
807
|
+
tmp = (g - b) / chroma;
|
|
808
|
+
} else if (g === max) {
|
|
809
|
+
tmp = 2 + (b - r) / chroma;
|
|
810
|
+
} else if (b === max) {
|
|
811
|
+
tmp = 4 + (r - g) / chroma;
|
|
812
|
+
} else {
|
|
813
|
+
tmp = 0.0;
|
|
814
|
+
}
|
|
815
|
+
var h = tmp * 60;
|
|
816
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.toHSV.<anonymous>' call
|
|
817
|
+
var h_0 = normalizeDeg(h);
|
|
818
|
+
var s = max === 0.0 ? 0.0 : chroma / max;
|
|
819
|
+
tmp$ret$3 = new HSV(h_0, s, max, this.a2j_1);
|
|
820
|
+
break $l$block;
|
|
821
|
+
}
|
|
822
|
+
return tmp$ret$3;
|
|
823
|
+
};
|
|
824
|
+
protoOf(RGB).w2i = function () {
|
|
825
|
+
var f = this.b2j_1.z2k();
|
|
826
|
+
var tmp0 = _Matrix___init__impl__q3kp4w(this.b2j_1.o2l());
|
|
827
|
+
var tmp1 = f.i2l(this.x2i_1);
|
|
828
|
+
var tmp2 = f.i2l(this.y2i_1);
|
|
829
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
830
|
+
var v2 = f.i2l(this.z2i_1);
|
|
831
|
+
var tmp4 = Matrix__get_impl_xogbpk(tmp0, 0, 0) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 0) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 0) * v2;
|
|
832
|
+
var tmp5 = Matrix__get_impl_xogbpk(tmp0, 0, 1) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 1) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 1) * v2;
|
|
833
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.toXYZ.<anonymous>' call
|
|
834
|
+
var z = Matrix__get_impl_xogbpk(tmp0, 0, 2) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 2) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 2) * v2;
|
|
835
|
+
return XYZColorSpace_0(this.b2j_1.q2l()).g2k(tmp4, tmp5, z, this.a2j_1);
|
|
836
|
+
};
|
|
837
|
+
protoOf(RGB).y2j = function () {
|
|
838
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
839
|
+
var $this$toSRGB = this.v2l(SRGB_getInstance());
|
|
840
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
841
|
+
var this_0 = $this$toSRGB.c2m().d2k_1 * 100;
|
|
842
|
+
var value = roundToInt(this_0);
|
|
843
|
+
if (value === 30)
|
|
844
|
+
return new Ansi16(30);
|
|
845
|
+
var v = value / 50 | 0;
|
|
846
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
847
|
+
var this_1 = $this$toSRGB.z2i_1;
|
|
848
|
+
var tmp$ret$1 = roundToInt(this_1);
|
|
849
|
+
var tmp = imul(tmp$ret$1, 4);
|
|
850
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
851
|
+
var this_2 = $this$toSRGB.y2i_1;
|
|
852
|
+
var tmp$ret$2 = roundToInt(this_2);
|
|
853
|
+
var tmp_0 = tmp | imul(tmp$ret$2, 2);
|
|
854
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
855
|
+
var this_3 = $this$toSRGB.x2i_1;
|
|
856
|
+
var ansi = 30 + (tmp_0 | roundToInt(this_3)) | 0;
|
|
857
|
+
return new Ansi16(v === 2 ? ansi + 60 | 0 : ansi);
|
|
858
|
+
};
|
|
859
|
+
protoOf(RGB).d2m = function () {
|
|
860
|
+
// Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
|
|
861
|
+
var $this$toSRGB = this.v2l(SRGB_getInstance());
|
|
862
|
+
var ri = $this$toSRGB.s2l();
|
|
863
|
+
var gi = $this$toSRGB.t2l();
|
|
864
|
+
var bi = $this$toSRGB.u2l();
|
|
865
|
+
var tmp;
|
|
866
|
+
if (ri === gi && gi === bi) {
|
|
867
|
+
tmp = ri < 8 ? 16 : ri > 248 ? 231 : roundToInt((ri - 8 | 0) / 247.0 * 24.0) + 232 | 0;
|
|
868
|
+
} else {
|
|
869
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
870
|
+
var this_0 = $this$toSRGB.x2i_1 * 5;
|
|
871
|
+
var tmp$ret$0 = roundToInt(this_0);
|
|
872
|
+
var tmp_0 = 16 + imul(36, tmp$ret$0) | 0;
|
|
873
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
874
|
+
var this_1 = $this$toSRGB.y2i_1 * 5;
|
|
875
|
+
var tmp$ret$1 = roundToInt(this_1);
|
|
876
|
+
var tmp_1 = tmp_0 + imul(6, tmp$ret$1) | 0;
|
|
877
|
+
// Inline function 'kotlin.math.roundToInt' call
|
|
878
|
+
var this_2 = $this$toSRGB.z2i_1 * 5;
|
|
879
|
+
tmp = tmp_1 + roundToInt(this_2) | 0;
|
|
880
|
+
}
|
|
881
|
+
var code = tmp;
|
|
882
|
+
return new Ansi256(code);
|
|
883
|
+
};
|
|
884
|
+
protoOf(RGB).v2i = function () {
|
|
885
|
+
return this.v2l(RGBColorSpaces_getInstance().n2k_1);
|
|
886
|
+
};
|
|
887
|
+
protoOf(RGB).e2m = function () {
|
|
888
|
+
var tmp1 = this.x2i_1;
|
|
889
|
+
var tmp2 = this.y2i_1;
|
|
890
|
+
var tmp3 = this.z2i_1;
|
|
891
|
+
// Inline function 'com.github.ajalt.colormath.internal.clamp3' call
|
|
892
|
+
var alpha = this.a2j_1;
|
|
893
|
+
var tmp0_container = this.u2i().s2j();
|
|
894
|
+
// Inline function 'kotlin.collections.component1' call
|
|
895
|
+
var c1 = tmp0_container.k(0);
|
|
896
|
+
// Inline function 'kotlin.collections.component2' call
|
|
897
|
+
var c2 = tmp0_container.k(1);
|
|
898
|
+
// Inline function 'kotlin.collections.component3' call
|
|
899
|
+
var c3 = tmp0_container.k(2);
|
|
900
|
+
var tmp;
|
|
901
|
+
var tmp_0;
|
|
902
|
+
var tmp_1;
|
|
903
|
+
var tmp_2;
|
|
904
|
+
var containsLower = c1.e2j_1;
|
|
905
|
+
if (tmp1 <= c1.f2j_1 ? containsLower <= tmp1 : false) {
|
|
906
|
+
var containsLower_0 = c2.e2j_1;
|
|
907
|
+
tmp_2 = tmp2 <= c2.f2j_1 ? containsLower_0 <= tmp2 : false;
|
|
908
|
+
} else {
|
|
909
|
+
tmp_2 = false;
|
|
910
|
+
}
|
|
911
|
+
if (tmp_2) {
|
|
912
|
+
var containsLower_1 = c3.e2j_1;
|
|
913
|
+
tmp_1 = tmp3 <= c3.f2j_1 ? containsLower_1 <= tmp3 : false;
|
|
914
|
+
} else {
|
|
915
|
+
tmp_1 = false;
|
|
916
|
+
}
|
|
917
|
+
if (tmp_1) {
|
|
918
|
+
tmp_0 = 0.0 <= alpha ? alpha <= 1.0 : false;
|
|
919
|
+
} else {
|
|
920
|
+
tmp_0 = false;
|
|
921
|
+
}
|
|
922
|
+
if (tmp_0) {
|
|
923
|
+
tmp = this;
|
|
924
|
+
} else {
|
|
925
|
+
tmp = clamp$copy(this, coerceIn(tmp1, c1.e2j_1, c1.f2j_1), coerceIn(tmp2, c2.e2j_1, c2.f2j_1), coerceIn(tmp3, c3.e2j_1, c3.f2j_1), coerceIn(alpha, 0.0, 1.0));
|
|
926
|
+
}
|
|
927
|
+
return tmp;
|
|
928
|
+
};
|
|
929
|
+
protoOf(RGB).f2m = function (r, g, b, alpha, space) {
|
|
930
|
+
return new RGB(r, g, b, alpha, space);
|
|
931
|
+
};
|
|
932
|
+
protoOf(RGB).r2l = function (r, g, b, alpha, space, $super) {
|
|
933
|
+
r = r === VOID ? this.x2i_1 : r;
|
|
934
|
+
g = g === VOID ? this.y2i_1 : g;
|
|
935
|
+
b = b === VOID ? this.z2i_1 : b;
|
|
936
|
+
alpha = alpha === VOID ? this.a2j_1 : alpha;
|
|
937
|
+
space = space === VOID ? this.b2j_1 : space;
|
|
938
|
+
return $super === VOID ? this.f2m(r, g, b, alpha, space) : $super.f2m.call(this, r, g, b, alpha, space);
|
|
939
|
+
};
|
|
940
|
+
protoOf(RGB).toString = function () {
|
|
941
|
+
return 'RGB(r=' + this.x2i_1 + ', g=' + this.y2i_1 + ', b=' + this.z2i_1 + ', alpha=' + this.a2j_1 + ', space=' + toString(this.b2j_1) + ')';
|
|
942
|
+
};
|
|
943
|
+
protoOf(RGB).hashCode = function () {
|
|
944
|
+
var result = getNumberHashCode(this.x2i_1);
|
|
945
|
+
result = imul(result, 31) + getNumberHashCode(this.y2i_1) | 0;
|
|
946
|
+
result = imul(result, 31) + getNumberHashCode(this.z2i_1) | 0;
|
|
947
|
+
result = imul(result, 31) + getNumberHashCode(this.a2j_1) | 0;
|
|
948
|
+
result = imul(result, 31) + hashCode(this.b2j_1) | 0;
|
|
949
|
+
return result;
|
|
950
|
+
};
|
|
951
|
+
protoOf(RGB).equals = function (other) {
|
|
952
|
+
if (this === other)
|
|
953
|
+
return true;
|
|
954
|
+
if (!(other instanceof RGB))
|
|
955
|
+
return false;
|
|
956
|
+
var tmp0_other_with_cast = other instanceof RGB ? other : THROW_CCE();
|
|
957
|
+
if (!equals(this.x2i_1, tmp0_other_with_cast.x2i_1))
|
|
958
|
+
return false;
|
|
959
|
+
if (!equals(this.y2i_1, tmp0_other_with_cast.y2i_1))
|
|
960
|
+
return false;
|
|
961
|
+
if (!equals(this.z2i_1, tmp0_other_with_cast.z2i_1))
|
|
962
|
+
return false;
|
|
963
|
+
if (!equals(this.a2j_1, tmp0_other_with_cast.a2j_1))
|
|
964
|
+
return false;
|
|
965
|
+
if (!equals(this.b2j_1, tmp0_other_with_cast.b2j_1))
|
|
966
|
+
return false;
|
|
967
|
+
return true;
|
|
968
|
+
};
|
|
969
|
+
function parseHex(_this__u8e3s4, startIndex) {
|
|
970
|
+
var tmp;
|
|
971
|
+
if (get_hexLength(_this__u8e3s4) > 4) {
|
|
972
|
+
var i = charSequenceGet(_this__u8e3s4, 0) === _Char___init__impl__6a9atx(35) ? imul(startIndex, 2) + 1 | 0 : imul(startIndex, 2);
|
|
973
|
+
tmp = toInt(slice(_this__u8e3s4, numberRangeToNumber(i, i + 1 | 0)), 16);
|
|
974
|
+
} else {
|
|
975
|
+
var i_0 = charSequenceGet(_this__u8e3s4, 0) === _Char___init__impl__6a9atx(35) ? startIndex + 1 | 0 : startIndex;
|
|
976
|
+
// Inline function 'kotlin.let' call
|
|
977
|
+
// Inline function 'com.github.ajalt.colormath.model.parseHex.<anonymous>' call
|
|
978
|
+
var it = charSequenceGet(_this__u8e3s4, i_0);
|
|
979
|
+
var tmp$ret$1 = toString_0(it) + toString_0(it);
|
|
980
|
+
tmp = toInt(tmp$ret$1, 16);
|
|
981
|
+
}
|
|
982
|
+
return tmp;
|
|
983
|
+
}
|
|
984
|
+
function validateHex(_this__u8e3s4) {
|
|
985
|
+
// Inline function 'kotlin.apply' call
|
|
986
|
+
// Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>' call
|
|
987
|
+
// Inline function 'kotlin.let' call
|
|
988
|
+
// Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>.<anonymous>' call
|
|
989
|
+
var it = get_hexLength(_this__u8e3s4);
|
|
990
|
+
// Inline function 'kotlin.require' call
|
|
991
|
+
if (!(it === 3 || it === 4 || it === 6 || it === 8)) {
|
|
992
|
+
// Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>.<anonymous>' call
|
|
993
|
+
var message = 'Hex string must be in the format "#ffffff" or "ffffff"';
|
|
994
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
995
|
+
}
|
|
996
|
+
return _this__u8e3s4;
|
|
997
|
+
}
|
|
998
|
+
function get_hexLength(_this__u8e3s4) {
|
|
999
|
+
return startsWith(_this__u8e3s4, '#') ? _this__u8e3s4.length - 1 | 0 : _this__u8e3s4.length;
|
|
1000
|
+
}
|
|
1001
|
+
function get_SRGB_R() {
|
|
1002
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1003
|
+
return SRGB_R;
|
|
1004
|
+
}
|
|
1005
|
+
var SRGB_R;
|
|
1006
|
+
function get_SRGB_G() {
|
|
1007
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1008
|
+
return SRGB_G;
|
|
1009
|
+
}
|
|
1010
|
+
var SRGB_G;
|
|
1011
|
+
function get_SRGB_B() {
|
|
1012
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1013
|
+
return SRGB_B;
|
|
1014
|
+
}
|
|
1015
|
+
var SRGB_B;
|
|
1016
|
+
function get_ACES_WHITE_POINT() {
|
|
1017
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1018
|
+
return ACES_WHITE_POINT;
|
|
1019
|
+
}
|
|
1020
|
+
var ACES_WHITE_POINT;
|
|
1021
|
+
function get_ACES_AP0_R() {
|
|
1022
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1023
|
+
return ACES_AP0_R;
|
|
1024
|
+
}
|
|
1025
|
+
var ACES_AP0_R;
|
|
1026
|
+
function get_ACES_AP0_G() {
|
|
1027
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1028
|
+
return ACES_AP0_G;
|
|
1029
|
+
}
|
|
1030
|
+
var ACES_AP0_G;
|
|
1031
|
+
function get_ACES_AP0_B() {
|
|
1032
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1033
|
+
return ACES_AP0_B;
|
|
1034
|
+
}
|
|
1035
|
+
var ACES_AP0_B;
|
|
1036
|
+
function get_ACES_AP1_R() {
|
|
1037
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1038
|
+
return ACES_AP1_R;
|
|
1039
|
+
}
|
|
1040
|
+
var ACES_AP1_R;
|
|
1041
|
+
function get_ACES_AP1_G() {
|
|
1042
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1043
|
+
return ACES_AP1_G;
|
|
1044
|
+
}
|
|
1045
|
+
var ACES_AP1_G;
|
|
1046
|
+
function get_ACES_AP1_B() {
|
|
1047
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1048
|
+
return ACES_AP1_B;
|
|
1049
|
+
}
|
|
1050
|
+
var ACES_AP1_B;
|
|
1051
|
+
function RGBColorSpaces$SRGB$lambda($this$$receiver, it) {
|
|
1052
|
+
return it.v2i();
|
|
1053
|
+
}
|
|
1054
|
+
function RGBColorSpaces$BT2020$lambda($this$$receiver, color) {
|
|
1055
|
+
var tmp;
|
|
1056
|
+
if (color instanceof RGB) {
|
|
1057
|
+
tmp = color.v2l($this$$receiver);
|
|
1058
|
+
} else {
|
|
1059
|
+
if (color instanceof ICtCp) {
|
|
1060
|
+
tmp = color.m2k();
|
|
1061
|
+
} else {
|
|
1062
|
+
tmp = color.w2i().b2m($this$$receiver);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
return tmp;
|
|
1066
|
+
}
|
|
1067
|
+
function RGBColorSpaces() {
|
|
1068
|
+
RGBColorSpaces_instance = this;
|
|
1069
|
+
var tmp = this;
|
|
1070
|
+
var tmp_0 = Illuminant_getInstance().n2j_1;
|
|
1071
|
+
var tmp_1 = SRGBTransferFunctions_instance;
|
|
1072
|
+
var tmp_2 = get_SRGB_R();
|
|
1073
|
+
var tmp_3 = get_SRGB_G();
|
|
1074
|
+
var tmp_4 = get_SRGB_B();
|
|
1075
|
+
tmp.n2k_1 = new RGBColorSpaceImpl('sRGB', tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, RGBColorSpaces$SRGB$lambda);
|
|
1076
|
+
this.o2k_1 = RGBColorSpace_0('Linear sRGB', Illuminant_getInstance().n2j_1, LinearTransferFunctions_instance, get_SRGB_R(), get_SRGB_G(), get_SRGB_B());
|
|
1077
|
+
this.p2k_1 = RGBColorSpace_0('ACES2065-1', get_ACES_WHITE_POINT(), LinearTransferFunctions_instance, get_ACES_AP0_R(), get_ACES_AP0_G(), get_ACES_AP0_B());
|
|
1078
|
+
this.q2k_1 = RGBColorSpace_0('ACEScc', get_ACES_WHITE_POINT(), ACESccTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1079
|
+
this.r2k_1 = RGBColorSpace_0('ACEScct', get_ACES_WHITE_POINT(), ACEScctTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1080
|
+
this.s2k_1 = RGBColorSpace_0('ACEScg', get_ACES_WHITE_POINT(), LinearTransferFunctions_instance, get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
|
|
1081
|
+
this.t2k_1 = RGBColorSpace_0('Adobe RGB', Illuminant_getInstance().n2j_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
|
+
var tmp_5 = this;
|
|
1083
|
+
var tmp_6 = Illuminant_getInstance().n2j_1;
|
|
1084
|
+
var tmp_7 = BT2020TransferFunctions_getInstance();
|
|
1085
|
+
var tmp_8 = xyY_init_$Create$(0.708, 0.292);
|
|
1086
|
+
var tmp_9 = xyY_init_$Create$(0.17, 0.797);
|
|
1087
|
+
var tmp_10 = xyY_init_$Create$(0.131, 0.046);
|
|
1088
|
+
tmp_5.u2k_1 = new RGBColorSpaceImpl('BT.2020', tmp_6, tmp_7, tmp_8, tmp_9, tmp_10, RGBColorSpaces$BT2020$lambda);
|
|
1089
|
+
this.v2k_1 = RGBColorSpace_0('BT.709', Illuminant_getInstance().n2j_1, BT709TransferFunctions_getInstance(), xyY_init_$Create$(0.64, 0.33), xyY_init_$Create$(0.3, 0.6), xyY_init_$Create$(0.15, 0.06));
|
|
1090
|
+
this.w2k_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));
|
|
1091
|
+
this.x2k_1 = RGBColorSpace_0('Display P3', Illuminant_getInstance().n2j_1, SRGBTransferFunctions_instance, xyY_init_$Create$(0.68, 0.32), xyY_init_$Create$(0.265, 0.69), xyY_init_$Create$(0.15, 0.06));
|
|
1092
|
+
this.y2k_1 = RGBColorSpace_0('ROMM RGB', Illuminant_getInstance().l2j_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
|
+
}
|
|
1094
|
+
var RGBColorSpaces_instance;
|
|
1095
|
+
function RGBColorSpaces_getInstance() {
|
|
1096
|
+
if (RGBColorSpaces_instance == null)
|
|
1097
|
+
new RGBColorSpaces();
|
|
1098
|
+
return RGBColorSpaces_instance;
|
|
1099
|
+
}
|
|
1100
|
+
function SRGB() {
|
|
1101
|
+
SRGB_instance = this;
|
|
1102
|
+
this.h2k_1 = RGBColorSpaces_getInstance().n2k_1;
|
|
1103
|
+
}
|
|
1104
|
+
protoOf(SRGB).s2j = function () {
|
|
1105
|
+
return this.h2k_1.s2j();
|
|
1106
|
+
};
|
|
1107
|
+
protoOf(SRGB).p2l = function () {
|
|
1108
|
+
return this.h2k_1.p2l();
|
|
1109
|
+
};
|
|
1110
|
+
protoOf(SRGB).o2l = function () {
|
|
1111
|
+
return this.h2k_1.o2l();
|
|
1112
|
+
};
|
|
1113
|
+
protoOf(SRGB).q2 = function () {
|
|
1114
|
+
return this.h2k_1.q2();
|
|
1115
|
+
};
|
|
1116
|
+
protoOf(SRGB).z2k = function () {
|
|
1117
|
+
return this.h2k_1.z2k();
|
|
1118
|
+
};
|
|
1119
|
+
protoOf(SRGB).q2l = function () {
|
|
1120
|
+
return this.h2k_1.q2l();
|
|
1121
|
+
};
|
|
1122
|
+
protoOf(SRGB).m2l = function (r, g, b, alpha) {
|
|
1123
|
+
return this.h2k_1.m2l(r, g, b, alpha);
|
|
1124
|
+
};
|
|
1125
|
+
protoOf(SRGB).g2k = function (r, g, b, alpha) {
|
|
1126
|
+
return this.h2k_1.g2k(r, g, b, alpha);
|
|
1127
|
+
};
|
|
1128
|
+
protoOf(SRGB).l2l = function (r, g, b, alpha) {
|
|
1129
|
+
return this.h2k_1.l2l(r, g, b, alpha);
|
|
1130
|
+
};
|
|
1131
|
+
protoOf(SRGB).n2l = function (hex) {
|
|
1132
|
+
return this.h2k_1.n2l(hex);
|
|
1133
|
+
};
|
|
1134
|
+
protoOf(SRGB).equals = function (other) {
|
|
1135
|
+
return equals(RGBColorSpaces_getInstance().n2k_1, other);
|
|
1136
|
+
};
|
|
1137
|
+
protoOf(SRGB).hashCode = function () {
|
|
1138
|
+
return hashCode(RGBColorSpaces_getInstance().n2k_1);
|
|
1139
|
+
};
|
|
1140
|
+
protoOf(SRGB).toString = function () {
|
|
1141
|
+
return 'sRGB';
|
|
1142
|
+
};
|
|
1143
|
+
var SRGB_instance;
|
|
1144
|
+
function SRGB_getInstance() {
|
|
1145
|
+
if (SRGB_instance == null)
|
|
1146
|
+
new SRGB();
|
|
1147
|
+
return SRGB_instance;
|
|
1148
|
+
}
|
|
1149
|
+
function RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b, convertImpl) {
|
|
1150
|
+
this.g2m_1 = name;
|
|
1151
|
+
this.h2m_1 = whitePoint;
|
|
1152
|
+
this.i2m_1 = transferFunctions;
|
|
1153
|
+
this.j2m_1 = r;
|
|
1154
|
+
this.k2m_1 = g;
|
|
1155
|
+
this.l2m_1 = b;
|
|
1156
|
+
this.m2m_1 = convertImpl;
|
|
1157
|
+
this.n2m_1 = zeroOneComponentInfo('RGB');
|
|
1158
|
+
this.o2m_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.h2m_1, this.j2m_1, this.k2m_1, this.l2m_1));
|
|
1159
|
+
this.p2m_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.o2m_1)));
|
|
1160
|
+
}
|
|
1161
|
+
protoOf(RGBColorSpaceImpl).q2 = function () {
|
|
1162
|
+
return this.g2m_1;
|
|
1163
|
+
};
|
|
1164
|
+
protoOf(RGBColorSpaceImpl).q2l = function () {
|
|
1165
|
+
return this.h2m_1;
|
|
1166
|
+
};
|
|
1167
|
+
protoOf(RGBColorSpaceImpl).z2k = function () {
|
|
1168
|
+
return this.i2m_1;
|
|
1169
|
+
};
|
|
1170
|
+
protoOf(RGBColorSpaceImpl).s2j = function () {
|
|
1171
|
+
return this.n2m_1;
|
|
1172
|
+
};
|
|
1173
|
+
protoOf(RGBColorSpaceImpl).o2l = function () {
|
|
1174
|
+
return this.o2m_1;
|
|
1175
|
+
};
|
|
1176
|
+
protoOf(RGBColorSpaceImpl).p2l = function () {
|
|
1177
|
+
return this.p2m_1;
|
|
1178
|
+
};
|
|
1179
|
+
protoOf(RGBColorSpaceImpl).toString = function () {
|
|
1180
|
+
return this.g2m_1;
|
|
1181
|
+
};
|
|
1182
|
+
protoOf(RGBColorSpaceImpl).g2k = function (r, g, b, alpha) {
|
|
1183
|
+
return new RGB(r, g, b, alpha, this);
|
|
1184
|
+
};
|
|
1185
|
+
protoOf(RGBColorSpaceImpl).equals = function (other) {
|
|
1186
|
+
if (this === other)
|
|
1187
|
+
return true;
|
|
1188
|
+
if (!(!(other == null) ? isInterface(other, RGBColorSpace) : false))
|
|
1189
|
+
return false;
|
|
1190
|
+
if (!(this.g2m_1 === other.q2()))
|
|
1191
|
+
return false;
|
|
1192
|
+
if (!this.h2m_1.equals(other.q2l()))
|
|
1193
|
+
return false;
|
|
1194
|
+
if (!equals(this.i2m_1, other.z2k()))
|
|
1195
|
+
return false;
|
|
1196
|
+
if (other instanceof RGBColorSpaceImpl) {
|
|
1197
|
+
if (!this.j2m_1.equals(other.j2m_1))
|
|
1198
|
+
return false;
|
|
1199
|
+
if (!this.k2m_1.equals(other.k2m_1))
|
|
1200
|
+
return false;
|
|
1201
|
+
if (!this.l2m_1.equals(other.l2m_1))
|
|
1202
|
+
return false;
|
|
1203
|
+
} else {
|
|
1204
|
+
if (!contentEquals(this.o2m_1, other.o2l()))
|
|
1205
|
+
return false;
|
|
1206
|
+
if (!contentEquals(this.p2m_1, other.p2l()))
|
|
1207
|
+
return false;
|
|
1208
|
+
}
|
|
1209
|
+
return true;
|
|
1210
|
+
};
|
|
1211
|
+
protoOf(RGBColorSpaceImpl).hashCode = function () {
|
|
1212
|
+
var result = getStringHashCode(this.g2m_1);
|
|
1213
|
+
result = imul(31, result) + this.h2m_1.hashCode() | 0;
|
|
1214
|
+
result = imul(31, result) + hashCode(this.i2m_1) | 0;
|
|
1215
|
+
result = imul(31, result) + this.j2m_1.hashCode() | 0;
|
|
1216
|
+
result = imul(31, result) + this.k2m_1.hashCode() | 0;
|
|
1217
|
+
result = imul(31, result) + this.l2m_1.hashCode() | 0;
|
|
1218
|
+
return result;
|
|
1219
|
+
};
|
|
1220
|
+
function SRGBTransferFunctions() {
|
|
1221
|
+
}
|
|
1222
|
+
protoOf(SRGBTransferFunctions).j2l = function (x) {
|
|
1223
|
+
return x <= 0.0031308 ? x * 12.92 : 1.055 * spow(x, 1 / 2.4) - 0.055;
|
|
1224
|
+
};
|
|
1225
|
+
protoOf(SRGBTransferFunctions).i2l = function (x) {
|
|
1226
|
+
return x <= 0.04045 ? x / 12.92 : spow_0((x + 0.055) / 1.055, 2.4);
|
|
1227
|
+
};
|
|
1228
|
+
var SRGBTransferFunctions_instance;
|
|
1229
|
+
function SRGBTransferFunctions_getInstance() {
|
|
1230
|
+
return SRGBTransferFunctions_instance;
|
|
1231
|
+
}
|
|
1232
|
+
function RGBColorSpace_0(name, whitePoint, transferFunctions, r, g, b) {
|
|
1233
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1234
|
+
return new RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b, RGBColorSpace$lambda);
|
|
1235
|
+
}
|
|
1236
|
+
function ACESccTransferFunctions() {
|
|
1237
|
+
ACESccTransferFunctions_instance = this;
|
|
1238
|
+
this.q2m_1 = 3.0517578125E-5;
|
|
1239
|
+
this.r2m_1 = 1.52587890625E-5;
|
|
1240
|
+
this.s2m_1 = -0.3013698630136986;
|
|
1241
|
+
var tmp = this;
|
|
1242
|
+
// Inline function 'kotlin.math.log2' call
|
|
1243
|
+
tmp.t2m_1 = (log2(65504.0) + 9.72) / 17.52;
|
|
1244
|
+
}
|
|
1245
|
+
protoOf(ACESccTransferFunctions).i2l = function (x) {
|
|
1246
|
+
var tmp;
|
|
1247
|
+
var tmp_0 = x;
|
|
1248
|
+
ACESccTransferFunctions_getInstance();
|
|
1249
|
+
if (tmp_0 <= -0.3013698630136986) {
|
|
1250
|
+
var tmp_1 = spow_0(2.0, x * 17.52 - 9.72);
|
|
1251
|
+
ACESccTransferFunctions_getInstance();
|
|
1252
|
+
tmp = (tmp_1 - 1.52587890625E-5) * 2.0;
|
|
1253
|
+
} else {
|
|
1254
|
+
if (x < this.t2m_1) {
|
|
1255
|
+
// Inline function 'kotlin.math.pow' call
|
|
1256
|
+
var x_0 = x * 17.52 - 9.72;
|
|
1257
|
+
tmp = Math.pow(2.0, x_0);
|
|
1258
|
+
} else {
|
|
1259
|
+
tmp = 65504.0;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
return tmp;
|
|
1263
|
+
};
|
|
1264
|
+
protoOf(ACESccTransferFunctions).j2l = function (x) {
|
|
1265
|
+
var tmp;
|
|
1266
|
+
var tmp_0 = x;
|
|
1267
|
+
ACESccTransferFunctions_getInstance();
|
|
1268
|
+
if (tmp_0 < 3.0517578125E-5) {
|
|
1269
|
+
ACESccTransferFunctions_getInstance();
|
|
1270
|
+
// Inline function 'kotlin.math.log2' call
|
|
1271
|
+
var x_0 = 1.52587890625E-5 + coerceAtLeast_0(x, 0.0) / 2.0;
|
|
1272
|
+
tmp = (log2(x_0) + 9.72) / 17.52;
|
|
1273
|
+
} else {
|
|
1274
|
+
// Inline function 'kotlin.math.log2' call
|
|
1275
|
+
tmp = (log2(x) + 9.72) / 17.52;
|
|
1276
|
+
}
|
|
1277
|
+
return tmp;
|
|
1278
|
+
};
|
|
1279
|
+
var ACESccTransferFunctions_instance;
|
|
1280
|
+
function ACESccTransferFunctions_getInstance() {
|
|
1281
|
+
if (ACESccTransferFunctions_instance == null)
|
|
1282
|
+
new ACESccTransferFunctions();
|
|
1283
|
+
return ACESccTransferFunctions_instance;
|
|
1284
|
+
}
|
|
1285
|
+
function ACEScctTransferFunctions() {
|
|
1286
|
+
ACEScctTransferFunctions_instance = this;
|
|
1287
|
+
this.u2m_1 = 10.5402377416545;
|
|
1288
|
+
this.v2m_1 = 0.0729055341958355;
|
|
1289
|
+
var tmp = this;
|
|
1290
|
+
// Inline function 'kotlin.math.log2' call
|
|
1291
|
+
tmp.w2m_1 = (log2(65504.0) + 9.72) / 17.52;
|
|
1292
|
+
}
|
|
1293
|
+
protoOf(ACEScctTransferFunctions).i2l = function (x) {
|
|
1294
|
+
var tmp;
|
|
1295
|
+
if (x <= 0.155251141552511) {
|
|
1296
|
+
ACEScctTransferFunctions_getInstance();
|
|
1297
|
+
var tmp_0 = x - 0.0729055341958355;
|
|
1298
|
+
ACEScctTransferFunctions_getInstance();
|
|
1299
|
+
tmp = tmp_0 / 10.5402377416545;
|
|
1300
|
+
} else if (x < this.w2m_1) {
|
|
1301
|
+
// Inline function 'kotlin.math.pow' call
|
|
1302
|
+
var x_0 = x * 17.52 - 9.72;
|
|
1303
|
+
tmp = Math.pow(2.0, x_0);
|
|
1304
|
+
} else {
|
|
1305
|
+
tmp = 65504.0;
|
|
1306
|
+
}
|
|
1307
|
+
return tmp;
|
|
1308
|
+
};
|
|
1309
|
+
protoOf(ACEScctTransferFunctions).j2l = function (x) {
|
|
1310
|
+
var tmp;
|
|
1311
|
+
if (x < 0.0078125) {
|
|
1312
|
+
ACEScctTransferFunctions_getInstance();
|
|
1313
|
+
var tmp_0 = 10.5402377416545 * x;
|
|
1314
|
+
ACEScctTransferFunctions_getInstance();
|
|
1315
|
+
tmp = tmp_0 + 0.0729055341958355;
|
|
1316
|
+
} else {
|
|
1317
|
+
// Inline function 'kotlin.math.log2' call
|
|
1318
|
+
tmp = (log2(x) + 9.72) / 17.52;
|
|
1319
|
+
}
|
|
1320
|
+
return tmp;
|
|
1321
|
+
};
|
|
1322
|
+
var ACEScctTransferFunctions_instance;
|
|
1323
|
+
function ACEScctTransferFunctions_getInstance() {
|
|
1324
|
+
if (ACEScctTransferFunctions_instance == null)
|
|
1325
|
+
new ACEScctTransferFunctions();
|
|
1326
|
+
return ACEScctTransferFunctions_instance;
|
|
1327
|
+
}
|
|
1328
|
+
function BT2020TransferFunctions() {
|
|
1329
|
+
BT2020TransferFunctions_instance = this;
|
|
1330
|
+
this.x2m_1 = 1.0993;
|
|
1331
|
+
this.y2m_1 = 0.0181;
|
|
1332
|
+
var tmp = this;
|
|
1333
|
+
BT2020TransferFunctions_getInstance();
|
|
1334
|
+
BT2020TransferFunctions_getInstance();
|
|
1335
|
+
// Inline function 'kotlin.math.pow' call
|
|
1336
|
+
var tmp_0 = 1.0993 * Math.pow(0.0181, 0.45);
|
|
1337
|
+
BT2020TransferFunctions_getInstance();
|
|
1338
|
+
tmp.z2m_1 = tmp_0 - (1.0993 - 1);
|
|
1339
|
+
}
|
|
1340
|
+
protoOf(BT2020TransferFunctions).i2l = function (x) {
|
|
1341
|
+
var tmp;
|
|
1342
|
+
if (x < this.z2m_1) {
|
|
1343
|
+
tmp = x / 4.5;
|
|
1344
|
+
} else {
|
|
1345
|
+
BT2020TransferFunctions_getInstance();
|
|
1346
|
+
var tmp_0 = x + (1.0993 - 1);
|
|
1347
|
+
BT2020TransferFunctions_getInstance();
|
|
1348
|
+
tmp = spow_0(tmp_0 / 1.0993, 1 / 0.45);
|
|
1349
|
+
}
|
|
1350
|
+
return numberToDouble(tmp);
|
|
1351
|
+
};
|
|
1352
|
+
protoOf(BT2020TransferFunctions).j2l = function (x) {
|
|
1353
|
+
var tmp;
|
|
1354
|
+
var tmp_0 = x;
|
|
1355
|
+
BT2020TransferFunctions_getInstance();
|
|
1356
|
+
if (tmp_0 < 0.0181) {
|
|
1357
|
+
tmp = 4.5 * x;
|
|
1358
|
+
} else {
|
|
1359
|
+
BT2020TransferFunctions_getInstance();
|
|
1360
|
+
var tmp_1 = 1.0993 * spow(x, 0.45);
|
|
1361
|
+
BT2020TransferFunctions_getInstance();
|
|
1362
|
+
tmp = tmp_1 - (1.0993 - 1);
|
|
1363
|
+
}
|
|
1364
|
+
return tmp;
|
|
1365
|
+
};
|
|
1366
|
+
var BT2020TransferFunctions_instance;
|
|
1367
|
+
function BT2020TransferFunctions_getInstance() {
|
|
1368
|
+
if (BT2020TransferFunctions_instance == null)
|
|
1369
|
+
new BT2020TransferFunctions();
|
|
1370
|
+
return BT2020TransferFunctions_instance;
|
|
1371
|
+
}
|
|
1372
|
+
function BT709TransferFunctions() {
|
|
1373
|
+
BT709TransferFunctions_instance = this;
|
|
1374
|
+
this.a2n_1 = 1.099 * spow_0(0.018, 0.45) - 0.099;
|
|
1375
|
+
}
|
|
1376
|
+
protoOf(BT709TransferFunctions).i2l = function (x) {
|
|
1377
|
+
return numberToDouble(x < this.a2n_1 ? x / 4.5 : spow_0((x + 0.099) / 1.099, 1 / 0.45));
|
|
1378
|
+
};
|
|
1379
|
+
protoOf(BT709TransferFunctions).j2l = function (x) {
|
|
1380
|
+
return x < 0.018 ? 4.5 * x : 1.099 * spow(x, 0.45) - 0.099;
|
|
1381
|
+
};
|
|
1382
|
+
var BT709TransferFunctions_instance;
|
|
1383
|
+
function BT709TransferFunctions_getInstance() {
|
|
1384
|
+
if (BT709TransferFunctions_instance == null)
|
|
1385
|
+
new BT709TransferFunctions();
|
|
1386
|
+
return BT709TransferFunctions_instance;
|
|
1387
|
+
}
|
|
1388
|
+
function ROMMTransferFunctions() {
|
|
1389
|
+
this.b2n_1 = 0.001953;
|
|
1390
|
+
}
|
|
1391
|
+
protoOf(ROMMTransferFunctions).i2l = function (x) {
|
|
1392
|
+
var tmp;
|
|
1393
|
+
var tmp_0 = x;
|
|
1394
|
+
if (tmp_0 < 16 * 0.001953) {
|
|
1395
|
+
tmp = x / 16.0;
|
|
1396
|
+
} else {
|
|
1397
|
+
tmp = spow(x, 1.8);
|
|
1398
|
+
}
|
|
1399
|
+
return tmp;
|
|
1400
|
+
};
|
|
1401
|
+
protoOf(ROMMTransferFunctions).j2l = function (x) {
|
|
1402
|
+
var tmp;
|
|
1403
|
+
var tmp_0 = x;
|
|
1404
|
+
if (tmp_0 < 0.001953) {
|
|
1405
|
+
tmp = x * 16.0;
|
|
1406
|
+
} else {
|
|
1407
|
+
tmp = spow(x, 1.0 / 1.8);
|
|
1408
|
+
}
|
|
1409
|
+
return tmp;
|
|
1410
|
+
};
|
|
1411
|
+
var ROMMTransferFunctions_instance;
|
|
1412
|
+
function ROMMTransferFunctions_getInstance() {
|
|
1413
|
+
return ROMMTransferFunctions_instance;
|
|
1414
|
+
}
|
|
1415
|
+
function rgbToXyzMatrix(whitePoint, r, g, b) {
|
|
1416
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1417
|
+
var primaries = _Matrix___init__impl__q3kp4w_0(r.c2n_1, g.c2n_1, b.c2n_1, r.d2n_1, g.d2n_1, b.d2n_1, r.f2n(), g.f2n(), b.f2n());
|
|
1418
|
+
var wp = whitePoint.h2j_1;
|
|
1419
|
+
var tmp0 = inverse(primaries);
|
|
1420
|
+
var tmp1 = wp.g2n();
|
|
1421
|
+
var tmp2 = wp.e2n_1;
|
|
1422
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1423
|
+
var v2 = wp.h2n();
|
|
1424
|
+
var tmp4 = Matrix__get_impl_xogbpk(tmp0, 0, 0) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 0) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 0) * v2;
|
|
1425
|
+
var tmp5 = Matrix__get_impl_xogbpk(tmp0, 0, 1) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 1) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 1) * v2;
|
|
1426
|
+
// Inline function 'com.github.ajalt.colormath.model.rgbToXyzMatrix.<anonymous>' call
|
|
1427
|
+
var z = Matrix__get_impl_xogbpk(tmp0, 0, 2) * tmp1 + Matrix__get_impl_xogbpk(tmp0, 1, 2) * tmp2 + Matrix__get_impl_xogbpk(tmp0, 2, 2) * v2;
|
|
1428
|
+
return dotDiagonal(primaries, tmp4, tmp5, z);
|
|
1429
|
+
}
|
|
1430
|
+
function RGBColorSpace$lambda($this$$receiver, color) {
|
|
1431
|
+
_init_properties_RGBColorSpaces_kt__nc9fsz();
|
|
1432
|
+
var tmp;
|
|
1433
|
+
if (color instanceof RGB) {
|
|
1434
|
+
tmp = color.v2l($this$$receiver);
|
|
1435
|
+
} else {
|
|
1436
|
+
tmp = color.w2i().b2m($this$$receiver);
|
|
1437
|
+
}
|
|
1438
|
+
return tmp;
|
|
1439
|
+
}
|
|
1440
|
+
var properties_initialized_RGBColorSpaces_kt_fsnpad;
|
|
1441
|
+
function _init_properties_RGBColorSpaces_kt__nc9fsz() {
|
|
1442
|
+
if (!properties_initialized_RGBColorSpaces_kt_fsnpad) {
|
|
1443
|
+
properties_initialized_RGBColorSpaces_kt_fsnpad = true;
|
|
1444
|
+
SRGB_R = xyY_init_$Create$(0.64, 0.33);
|
|
1445
|
+
SRGB_G = xyY_init_$Create$(0.3, 0.6);
|
|
1446
|
+
SRGB_B = xyY_init_$Create$(0.15, 0.06);
|
|
1447
|
+
ACES_WHITE_POINT = new WhitePoint('ACES', xyY_init_$Create$(0.32168, 0.33767));
|
|
1448
|
+
ACES_AP0_R = xyY_init_$Create$(0.7347, 0.2653);
|
|
1449
|
+
ACES_AP0_G = xyY_init_$Create$(0.0, 1.0);
|
|
1450
|
+
ACES_AP0_B = xyY_init_$Create$(1.0E-4, -0.077);
|
|
1451
|
+
ACES_AP1_R = xyY_init_$Create$(0.713, 0.293);
|
|
1452
|
+
ACES_AP1_G = xyY_init_$Create$(0.165, 0.83);
|
|
1453
|
+
ACES_AP1_B = xyY_init_$Create$(0.128, 0.044);
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
function Companion_3() {
|
|
1457
|
+
Companion_instance_3 = this;
|
|
1458
|
+
this.i2n_1 = XYZColorSpaces_getInstance().j2n_1;
|
|
1459
|
+
}
|
|
1460
|
+
protoOf(Companion_3).s2j = function () {
|
|
1461
|
+
return this.i2n_1.s2j();
|
|
1462
|
+
};
|
|
1463
|
+
protoOf(Companion_3).q2l = function () {
|
|
1464
|
+
return this.i2n_1.q2l();
|
|
1465
|
+
};
|
|
1466
|
+
protoOf(Companion_3).g2k = function (x, y, z, alpha) {
|
|
1467
|
+
return this.i2n_1.g2k(x, y, z, alpha);
|
|
1468
|
+
};
|
|
1469
|
+
protoOf(Companion_3).hashCode = function () {
|
|
1470
|
+
return hashCode(XYZColorSpaces_getInstance().j2n_1);
|
|
1471
|
+
};
|
|
1472
|
+
protoOf(Companion_3).equals = function (other) {
|
|
1473
|
+
return equals(XYZColorSpaces_getInstance().j2n_1, other);
|
|
1474
|
+
};
|
|
1475
|
+
var Companion_instance_3;
|
|
1476
|
+
function Companion_getInstance_3() {
|
|
1477
|
+
if (Companion_instance_3 == null)
|
|
1478
|
+
new Companion_3();
|
|
1479
|
+
return Companion_instance_3;
|
|
1480
|
+
}
|
|
1481
|
+
function adaptToM($this, space, m, mi) {
|
|
1482
|
+
if (space.q2l().equals($this.a2m_1.q2l()))
|
|
1483
|
+
return $this;
|
|
1484
|
+
var transform = chromaticAdaptationMatrix(space, $this.a2m_1.q2l().h2j_1, m, mi);
|
|
1485
|
+
var tmp1 = $this.w2l_1;
|
|
1486
|
+
var tmp2 = $this.x2l_1;
|
|
1487
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1488
|
+
var v2 = $this.y2l_1;
|
|
1489
|
+
var tmp4 = Matrix__get_impl_xogbpk(transform, 0, 0) * tmp1 + Matrix__get_impl_xogbpk(transform, 1, 0) * tmp2 + Matrix__get_impl_xogbpk(transform, 2, 0) * v2;
|
|
1490
|
+
var tmp5 = Matrix__get_impl_xogbpk(transform, 0, 1) * tmp1 + Matrix__get_impl_xogbpk(transform, 1, 1) * tmp2 + Matrix__get_impl_xogbpk(transform, 2, 1) * v2;
|
|
1491
|
+
// Inline function 'com.github.ajalt.colormath.model.XYZ.adaptToM.<anonymous>' call
|
|
1492
|
+
var zz = Matrix__get_impl_xogbpk(transform, 0, 2) * tmp1 + Matrix__get_impl_xogbpk(transform, 1, 2) * tmp2 + Matrix__get_impl_xogbpk(transform, 2, 2) * v2;
|
|
1493
|
+
return space.g2k(tmp4, tmp5, zz, $this.z2l_1);
|
|
1494
|
+
}
|
|
1495
|
+
function XYZ(x, y, z, alpha, space) {
|
|
1496
|
+
Companion_getInstance_3();
|
|
1497
|
+
this.w2l_1 = x;
|
|
1498
|
+
this.x2l_1 = y;
|
|
1499
|
+
this.y2l_1 = z;
|
|
1500
|
+
this.z2l_1 = alpha;
|
|
1501
|
+
this.a2m_1 = space;
|
|
1502
|
+
}
|
|
1503
|
+
protoOf(XYZ).u2i = function () {
|
|
1504
|
+
return this.a2m_1;
|
|
1505
|
+
};
|
|
1506
|
+
protoOf(XYZ).l2n = function (space) {
|
|
1507
|
+
return adaptToM(this, space, get_CAT02_XYZ_TO_LMS(), get_CAT02_LMS_TO_XYZ());
|
|
1508
|
+
};
|
|
1509
|
+
protoOf(XYZ).b2m = function (space) {
|
|
1510
|
+
var tmp0_container = this.l2n(XYZColorSpace_0(space.q2l()));
|
|
1511
|
+
var x = tmp0_container.yd();
|
|
1512
|
+
var y = tmp0_container.zd();
|
|
1513
|
+
var z = tmp0_container.ji();
|
|
1514
|
+
var f = space.z2k();
|
|
1515
|
+
// Inline function 'com.github.ajalt.colormath.internal.dot' call
|
|
1516
|
+
var this_0 = _Matrix___init__impl__q3kp4w(space.p2l());
|
|
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;
|
|
1519
|
+
// Inline function 'com.github.ajalt.colormath.model.XYZ.toRGB.<anonymous>' call
|
|
1520
|
+
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.g2k(f.j2l(tmp4), f.j2l(tmp5), f.j2l(b), this.z2l_1);
|
|
1522
|
+
};
|
|
1523
|
+
protoOf(XYZ).v2i = function () {
|
|
1524
|
+
return this.b2m(RGBColorSpaces_getInstance().n2k_1);
|
|
1525
|
+
};
|
|
1526
|
+
protoOf(XYZ).w2i = function () {
|
|
1527
|
+
return this;
|
|
1528
|
+
};
|
|
1529
|
+
protoOf(XYZ).yd = function () {
|
|
1530
|
+
return this.w2l_1;
|
|
1531
|
+
};
|
|
1532
|
+
protoOf(XYZ).zd = function () {
|
|
1533
|
+
return this.x2l_1;
|
|
1534
|
+
};
|
|
1535
|
+
protoOf(XYZ).ji = function () {
|
|
1536
|
+
return this.y2l_1;
|
|
1537
|
+
};
|
|
1538
|
+
protoOf(XYZ).toString = function () {
|
|
1539
|
+
return 'XYZ(x=' + this.w2l_1 + ', y=' + this.x2l_1 + ', z=' + this.y2l_1 + ', alpha=' + this.z2l_1 + ', space=' + toString(this.a2m_1) + ')';
|
|
1540
|
+
};
|
|
1541
|
+
protoOf(XYZ).hashCode = function () {
|
|
1542
|
+
var result = getNumberHashCode(this.w2l_1);
|
|
1543
|
+
result = imul(result, 31) + getNumberHashCode(this.x2l_1) | 0;
|
|
1544
|
+
result = imul(result, 31) + getNumberHashCode(this.y2l_1) | 0;
|
|
1545
|
+
result = imul(result, 31) + getNumberHashCode(this.z2l_1) | 0;
|
|
1546
|
+
result = imul(result, 31) + hashCode(this.a2m_1) | 0;
|
|
1547
|
+
return result;
|
|
1548
|
+
};
|
|
1549
|
+
protoOf(XYZ).equals = function (other) {
|
|
1550
|
+
if (this === other)
|
|
1551
|
+
return true;
|
|
1552
|
+
if (!(other instanceof XYZ))
|
|
1553
|
+
return false;
|
|
1554
|
+
var tmp0_other_with_cast = other instanceof XYZ ? other : THROW_CCE();
|
|
1555
|
+
if (!equals(this.w2l_1, tmp0_other_with_cast.w2l_1))
|
|
1556
|
+
return false;
|
|
1557
|
+
if (!equals(this.x2l_1, tmp0_other_with_cast.x2l_1))
|
|
1558
|
+
return false;
|
|
1559
|
+
if (!equals(this.y2l_1, tmp0_other_with_cast.y2l_1))
|
|
1560
|
+
return false;
|
|
1561
|
+
if (!equals(this.z2l_1, tmp0_other_with_cast.z2l_1))
|
|
1562
|
+
return false;
|
|
1563
|
+
if (!equals(this.a2m_1, tmp0_other_with_cast.a2m_1))
|
|
1564
|
+
return false;
|
|
1565
|
+
return true;
|
|
1566
|
+
};
|
|
1567
|
+
function XYZColorSpace() {
|
|
1568
|
+
}
|
|
1569
|
+
function XYZColorSpace_0(whitePoint) {
|
|
1570
|
+
return whitePoint.equals(Illuminant_getInstance().n2j_1) ? XYZColorSpaces_getInstance().j2n_1 : whitePoint.equals(Illuminant_getInstance().l2j_1) ? XYZColorSpaces_getInstance().k2n_1 : new XYZColorSpaceImpl(whitePoint);
|
|
1571
|
+
}
|
|
1572
|
+
function XYZColorSpaces() {
|
|
1573
|
+
XYZColorSpaces_instance = this;
|
|
1574
|
+
this.j2n_1 = new XYZColorSpaceImpl(Illuminant_getInstance().n2j_1);
|
|
1575
|
+
this.k2n_1 = new XYZColorSpaceImpl(Illuminant_getInstance().l2j_1);
|
|
1576
|
+
}
|
|
1577
|
+
var XYZColorSpaces_instance;
|
|
1578
|
+
function XYZColorSpaces_getInstance() {
|
|
1579
|
+
if (XYZColorSpaces_instance == null)
|
|
1580
|
+
new XYZColorSpaces();
|
|
1581
|
+
return XYZColorSpaces_instance;
|
|
1582
|
+
}
|
|
1583
|
+
function chromaticAdaptationMatrix(_this__u8e3s4, srcWp, xyzToLms, lmsToXyz) {
|
|
1584
|
+
xyzToLms = xyzToLms === VOID ? get_CAT02_XYZ_TO_LMS() : xyzToLms;
|
|
1585
|
+
lmsToXyz = lmsToXyz === VOID ? get_CAT02_LMS_TO_XYZ() : lmsToXyz;
|
|
1586
|
+
var dstWp = _this__u8e3s4.q2l().h2j_1;
|
|
1587
|
+
var src = dot_0(xyzToLms, srcWp.g2n(), srcWp.e2n_1, srcWp.h2n());
|
|
1588
|
+
var dst = dot_0(xyzToLms, dstWp.g2n(), dstWp.e2n_1, dstWp.h2n());
|
|
1589
|
+
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
|
+
}
|
|
1591
|
+
function XYZColorSpaceImpl(whitePoint) {
|
|
1592
|
+
this.m2n_1 = whitePoint;
|
|
1593
|
+
this.n2n_1 = zeroOneComponentInfo('XYZ');
|
|
1594
|
+
}
|
|
1595
|
+
protoOf(XYZColorSpaceImpl).q2l = function () {
|
|
1596
|
+
return this.m2n_1;
|
|
1597
|
+
};
|
|
1598
|
+
protoOf(XYZColorSpaceImpl).s2j = function () {
|
|
1599
|
+
return this.n2n_1;
|
|
1600
|
+
};
|
|
1601
|
+
protoOf(XYZColorSpaceImpl).toString = function () {
|
|
1602
|
+
return 'XYZColorSpace(' + this.m2n_1.toString() + ')';
|
|
1603
|
+
};
|
|
1604
|
+
protoOf(XYZColorSpaceImpl).g2k = function (x, y, z, alpha) {
|
|
1605
|
+
return new XYZ(x, y, z, alpha, this);
|
|
1606
|
+
};
|
|
1607
|
+
protoOf(XYZColorSpaceImpl).hashCode = function () {
|
|
1608
|
+
return this.m2n_1.hashCode();
|
|
1609
|
+
};
|
|
1610
|
+
protoOf(XYZColorSpaceImpl).equals = function (other) {
|
|
1611
|
+
var tmp;
|
|
1612
|
+
if (!(other == null) ? isInterface(other, XYZColorSpace) : false) {
|
|
1613
|
+
tmp = this.m2n_1.equals(other.q2l());
|
|
1614
|
+
} else {
|
|
1615
|
+
tmp = false;
|
|
1616
|
+
}
|
|
1617
|
+
return tmp;
|
|
1618
|
+
};
|
|
1619
|
+
function xyY_init_$Init$(x, y, Y, $this) {
|
|
1620
|
+
Y = Y === VOID ? 1.0 : Y;
|
|
1621
|
+
xyY.call($this, numberToDouble(x), numberToDouble(y), numberToDouble(Y));
|
|
1622
|
+
return $this;
|
|
1623
|
+
}
|
|
1624
|
+
function xyY_init_$Create$(x, y, Y) {
|
|
1625
|
+
return xyY_init_$Init$(x, y, Y, objectCreate(protoOf(xyY)));
|
|
1626
|
+
}
|
|
1627
|
+
function xyY(x, y, Y) {
|
|
1628
|
+
Y = Y === VOID ? 1.0 : Y;
|
|
1629
|
+
this.c2n_1 = x;
|
|
1630
|
+
this.d2n_1 = y;
|
|
1631
|
+
this.e2n_1 = Y;
|
|
1632
|
+
}
|
|
1633
|
+
protoOf(xyY).f2n = function () {
|
|
1634
|
+
return 1 - this.c2n_1 - this.d2n_1;
|
|
1635
|
+
};
|
|
1636
|
+
protoOf(xyY).g2n = function () {
|
|
1637
|
+
return this.c2n_1 * this.e2n_1 / this.d2n_1;
|
|
1638
|
+
};
|
|
1639
|
+
protoOf(xyY).h2n = function () {
|
|
1640
|
+
return (1 - this.c2n_1 - this.d2n_1) * this.e2n_1 / this.d2n_1;
|
|
1641
|
+
};
|
|
1642
|
+
protoOf(xyY).toString = function () {
|
|
1643
|
+
return 'xyY(x=' + this.c2n_1 + ', y=' + this.d2n_1 + ', Y=' + this.e2n_1 + ')';
|
|
1644
|
+
};
|
|
1645
|
+
protoOf(xyY).hashCode = function () {
|
|
1646
|
+
var result = getNumberHashCode(this.c2n_1);
|
|
1647
|
+
result = imul(result, 31) + getNumberHashCode(this.d2n_1) | 0;
|
|
1648
|
+
result = imul(result, 31) + getNumberHashCode(this.e2n_1) | 0;
|
|
1649
|
+
return result;
|
|
1650
|
+
};
|
|
1651
|
+
protoOf(xyY).equals = function (other) {
|
|
1652
|
+
if (this === other)
|
|
1653
|
+
return true;
|
|
1654
|
+
if (!(other instanceof xyY))
|
|
1655
|
+
return false;
|
|
1656
|
+
var tmp0_other_with_cast = other instanceof xyY ? other : THROW_CCE();
|
|
1657
|
+
if (!equals(this.c2n_1, tmp0_other_with_cast.c2n_1))
|
|
1658
|
+
return false;
|
|
1659
|
+
if (!equals(this.d2n_1, tmp0_other_with_cast.d2n_1))
|
|
1660
|
+
return false;
|
|
1661
|
+
if (!equals(this.e2n_1, tmp0_other_with_cast.e2n_1))
|
|
1662
|
+
return false;
|
|
1663
|
+
return true;
|
|
1664
|
+
};
|
|
1665
|
+
//region block: post-declaration
|
|
1666
|
+
protoOf(Ansi16).w2i = toXYZ;
|
|
1667
|
+
protoOf(Ansi256).w2i = toXYZ;
|
|
1668
|
+
protoOf(HSV).w2i = toXYZ;
|
|
1669
|
+
protoOf(Companion_2).v2j = from255$default;
|
|
1670
|
+
protoOf(Companion_2).u2j = invoke$default;
|
|
1671
|
+
protoOf(Companion_2).z2j = invoke$default_0;
|
|
1672
|
+
protoOf(SRGB).v2j = from255$default;
|
|
1673
|
+
protoOf(SRGB).u2j = invoke$default;
|
|
1674
|
+
protoOf(SRGB).z2j = invoke$default_0;
|
|
1675
|
+
protoOf(RGBColorSpaceImpl).u2j = invoke$default;
|
|
1676
|
+
protoOf(RGBColorSpaceImpl).l2l = invoke;
|
|
1677
|
+
protoOf(RGBColorSpaceImpl).z2j = invoke$default_0;
|
|
1678
|
+
protoOf(RGBColorSpaceImpl).n2l = invoke_0;
|
|
1679
|
+
protoOf(RGBColorSpaceImpl).m2l = from255;
|
|
1680
|
+
protoOf(RGBColorSpaceImpl).v2j = from255$default;
|
|
1681
|
+
//endregion
|
|
1682
|
+
//region block: init
|
|
1683
|
+
PqNonlinearity_instance = new PqNonlinearity();
|
|
1684
|
+
LinearTransferFunctions_instance = new LinearTransferFunctions();
|
|
1685
|
+
SRGBTransferFunctions_instance = new SRGBTransferFunctions();
|
|
1686
|
+
ROMMTransferFunctions_instance = new ROMMTransferFunctions();
|
|
1687
|
+
//endregion
|
|
1688
|
+
//region block: exports
|
|
1689
|
+
export {
|
|
1690
|
+
Ansi16 as Ansi161fxj36mncd6rb,
|
|
1691
|
+
Ansi256 as Ansi25637kncr8jl8m76,
|
|
1692
|
+
Companion_getInstance_2 as Companion_getInstance2ok80g813z1l8,
|
|
1693
|
+
};
|
|
1694
|
+
//endregion
|
|
1695
|
+
|
|
1696
|
+
//# sourceMappingURL=colormath-root-colormath.mjs.map
|