@pixerate/editor 0.112.0 → 0.114.0

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.
Files changed (129) hide show
  1. package/THIRD_PARTY_NOTICES.md +11 -0
  2. package/dist/animation-editor/index.cjs +60 -54
  3. package/dist/animation-editor/index.cjs.map +1 -1
  4. package/dist/animation-editor/index.d.cts +3 -3
  5. package/dist/animation-editor/index.d.ts +3 -3
  6. package/dist/animation-editor/index.js +14 -8
  7. package/dist/animation-editor/index.js.map +1 -1
  8. package/dist/builtin-CY97ppKM.d.cts +354 -0
  9. package/dist/builtin-CY97ppKM.d.ts +354 -0
  10. package/dist/canvas/index.cjs +3 -3
  11. package/dist/canvas/index.cjs.map +1 -1
  12. package/dist/canvas/index.js +9 -9
  13. package/dist/chunk-26PGXHY7.cjs +753 -0
  14. package/dist/chunk-26PGXHY7.cjs.map +1 -0
  15. package/dist/chunk-2OJACTPR.cjs +929 -0
  16. package/dist/chunk-2OJACTPR.cjs.map +1 -0
  17. package/dist/chunk-3UFGNHSP.js +929 -0
  18. package/dist/chunk-3UFGNHSP.js.map +1 -0
  19. package/dist/{chunk-YGIMK4NX.cjs → chunk-5OVJHMZQ.cjs} +757 -825
  20. package/dist/chunk-5OVJHMZQ.cjs.map +1 -0
  21. package/dist/chunk-643B2HKC.cjs +534 -0
  22. package/dist/chunk-643B2HKC.cjs.map +1 -0
  23. package/dist/chunk-6FCKOS2B.js +534 -0
  24. package/dist/chunk-6FCKOS2B.js.map +1 -0
  25. package/dist/chunk-BRLYOPLT.js +2574 -0
  26. package/dist/chunk-BRLYOPLT.js.map +1 -0
  27. package/dist/{chunk-LQEEDHOP.js → chunk-C6C5PDKU.js} +759 -761
  28. package/dist/chunk-C6C5PDKU.js.map +1 -0
  29. package/dist/chunk-DFQEX3AM.cjs +781 -0
  30. package/dist/chunk-DFQEX3AM.cjs.map +1 -0
  31. package/dist/{chunk-CZOXTEMN.js → chunk-EUVSQ25B.js} +336 -404
  32. package/dist/chunk-EUVSQ25B.js.map +1 -0
  33. package/dist/chunk-G5NMLUVF.cjs +2574 -0
  34. package/dist/chunk-G5NMLUVF.cjs.map +1 -0
  35. package/dist/chunk-LKCYANMW.js +781 -0
  36. package/dist/chunk-LKCYANMW.js.map +1 -0
  37. package/dist/{chunk-W3GXSUSQ.cjs → chunk-LPLCWZTM.cjs} +5087 -1283
  38. package/dist/chunk-LPLCWZTM.cjs.map +1 -0
  39. package/dist/chunk-MMVHBKMM.js +753 -0
  40. package/dist/chunk-MMVHBKMM.js.map +1 -0
  41. package/dist/{chunk-POGBUYWE.cjs → chunk-ST7E3NEE.cjs} +857 -859
  42. package/dist/chunk-ST7E3NEE.cjs.map +1 -0
  43. package/dist/{chunk-7VOHOPLW.cjs → chunk-TCKIXI46.cjs} +59 -59
  44. package/dist/{chunk-7VOHOPLW.cjs.map → chunk-TCKIXI46.cjs.map} +1 -1
  45. package/dist/{chunk-XIOMMGPD.cjs → chunk-TFOPHZ3U.cjs} +1 -1
  46. package/dist/chunk-TFOPHZ3U.cjs.map +1 -0
  47. package/dist/{chunk-Z4BC6M74.js → chunk-UBIXVXPR.js} +2 -2
  48. package/dist/{chunk-BLWCAQCW.js → chunk-VXR7XWMF.js} +4574 -770
  49. package/dist/chunk-VXR7XWMF.js.map +1 -0
  50. package/dist/{chunk-HNS7UHCM.js → chunk-XK5LZKBD.js} +1 -1
  51. package/dist/chunk-XK5LZKBD.js.map +1 -0
  52. package/dist/cms/index.cjs +146 -0
  53. package/dist/cms/index.cjs.map +1 -0
  54. package/dist/cms/index.d.cts +51 -0
  55. package/dist/cms/index.d.ts +51 -0
  56. package/dist/cms/index.js +146 -0
  57. package/dist/{export-DNu_Jr8p.d.ts → export-_1dUKwpF.d.ts} +326 -195
  58. package/dist/{export-DBba-buV.d.cts → export-b6NjCZ5-.d.cts} +326 -195
  59. package/dist/image-editor/index.cjs +2377 -1291
  60. package/dist/image-editor/index.cjs.map +1 -1
  61. package/dist/image-editor/index.d.cts +149 -97
  62. package/dist/image-editor/index.d.ts +149 -97
  63. package/dist/image-editor/index.js +1343 -257
  64. package/dist/image-editor/index.js.map +1 -1
  65. package/dist/opentype-BZEOSOX3.d.ts +188 -0
  66. package/dist/opentype-Dpe75vL5.d.cts +188 -0
  67. package/dist/paint/index.cjs +63 -4
  68. package/dist/paint/index.cjs.map +1 -1
  69. package/dist/paint/index.d.cts +30 -3
  70. package/dist/paint/index.d.ts +30 -3
  71. package/dist/paint/index.js +62 -3
  72. package/dist/paint-editor/index.cjs +146 -145
  73. package/dist/paint-editor/index.cjs.map +1 -1
  74. package/dist/paint-editor/index.d.cts +9 -8
  75. package/dist/paint-editor/index.d.ts +9 -8
  76. package/dist/paint-editor/index.js +6 -5
  77. package/dist/paint-editor/index.js.map +1 -1
  78. package/dist/raster/index.cjs +53 -3
  79. package/dist/raster/index.cjs.map +1 -1
  80. package/dist/raster/index.d.cts +62 -91
  81. package/dist/raster/index.d.ts +62 -91
  82. package/dist/raster/index.js +59 -9
  83. package/dist/{render-BEriFuqK.d.cts → render-B1K_OoLy.d.cts} +87 -2
  84. package/dist/{render-tjzKaik-.d.ts → render-CrmHOgpo.d.ts} +87 -2
  85. package/dist/{blending-aOE6Y3UE.d.cts → retouch-Bxkuc0KH.d.cts} +219 -2
  86. package/dist/{blending-DXl06NSx.d.ts → retouch-Do6tBs2H.d.ts} +219 -2
  87. package/dist/{surface-C8RRg_Bh.d.ts → surface-Cn30xIV6.d.cts} +6 -1
  88. package/dist/{surface-C8RRg_Bh.d.cts → surface-Cn30xIV6.d.ts} +6 -1
  89. package/dist/{svg-D_cfkhlB.d.cts → svg-BnRj0q8i.d.cts} +16 -4
  90. package/dist/{svg-wIaKLrU0.d.ts → svg-CmmBFfGT.d.ts} +16 -4
  91. package/dist/{types-DtL_qLFz.d.ts → types-1SUQKDAw.d.ts} +273 -4
  92. package/dist/{types-DyQq-WPY.d.cts → types-yINF17Ta.d.cts} +273 -4
  93. package/dist/vector/index.cjs +12170 -7343
  94. package/dist/vector/index.cjs.map +1 -1
  95. package/dist/vector/index.d.cts +1579 -16
  96. package/dist/vector/index.d.ts +1579 -16
  97. package/dist/vector/index.js +6303 -1476
  98. package/dist/vector/index.js.map +1 -1
  99. package/dist/warp-B39VsOtd.d.cts +348 -0
  100. package/dist/warp-DMN30aY6.d.ts +348 -0
  101. package/dist/zlib-dxQdgHyN.d.cts +95 -0
  102. package/dist/zlib-dxQdgHyN.d.ts +95 -0
  103. package/package.json +6 -1
  104. package/skills/pixerate-image-editor/SKILL.md +34 -34
  105. package/skills/pixerate-image-editor/references/color-management.md +37 -0
  106. package/skills/pixerate-image-editor/references/photoshop-files.md +39 -0
  107. package/skills/pixerate-image-editor/references/retouching.md +36 -0
  108. package/skills/pixerate-vector/SKILL.md +154 -5
  109. package/dist/chunk-BLWCAQCW.js.map +0 -1
  110. package/dist/chunk-CZOXTEMN.js.map +0 -1
  111. package/dist/chunk-FTBZPI77.cjs +0 -1
  112. package/dist/chunk-FTBZPI77.cjs.map +0 -1
  113. package/dist/chunk-HNS7UHCM.js.map +0 -1
  114. package/dist/chunk-JLYX4V57.cjs +0 -2001
  115. package/dist/chunk-JLYX4V57.cjs.map +0 -1
  116. package/dist/chunk-KB2YBCVS.js +0 -2001
  117. package/dist/chunk-KB2YBCVS.js.map +0 -1
  118. package/dist/chunk-LQEEDHOP.js.map +0 -1
  119. package/dist/chunk-POGBUYWE.cjs.map +0 -1
  120. package/dist/chunk-VKK5VS2T.js +0 -1
  121. package/dist/chunk-W3GXSUSQ.cjs.map +0 -1
  122. package/dist/chunk-XIOMMGPD.cjs.map +0 -1
  123. package/dist/chunk-YGIMK4NX.cjs.map +0 -1
  124. package/dist/homography-CZ-tFjay.d.cts +0 -50
  125. package/dist/homography-Ctfjoc1b.d.ts +0 -50
  126. package/dist/warp-CWHZzE3x.d.ts +0 -118
  127. package/dist/warp-D5jz_tN7.d.cts +0 -118
  128. /package/dist/{chunk-Z4BC6M74.js.map → chunk-UBIXVXPR.js.map} +0 -0
  129. /package/dist/{chunk-VKK5VS2T.js.map → cms/index.js.map} +0 -0
@@ -0,0 +1,354 @@
1
+ /**
2
+ * Small colour-science helpers: 3×3 matrices, CIE XYZ ↔ L*a*b*, chromatic adaptation. All from
3
+ * public standards: CIE 15 (L*a*b*), ICC.1:2010 Annex A (PCS, D50) and the Bradford matrix
4
+ * (Lam 1985).
5
+ */
6
+ /** The ICC PCS illuminant (D50) as the header stores it: X 0.9642, Y 1, Z 0.8249. */
7
+ declare const D50: readonly [number, number, number];
8
+ /** CIE D65 chromaticity (sRGB, Display P3, Adobe RGB). */
9
+ declare const D65_XY: readonly [number, number];
10
+ /** Row-major 3×3 matrix. */
11
+ type Mat3 = [[number, number, number], [number, number, number], [number, number, number]];
12
+ type Vec3 = [number, number, number];
13
+ declare const IDENTITY: Mat3;
14
+ declare function mul(a: Mat3, b: Mat3): Mat3;
15
+ declare function apply(m: Mat3, v: readonly number[]): Vec3;
16
+ declare function det(m: Mat3): number;
17
+ /** Inverse, or `null` when (nearly) singular. */
18
+ declare function invert(m: Mat3): Mat3 | null;
19
+ /** XYZ (Y = 1) of a chromaticity. */
20
+ declare function xyToXyz(xy: readonly number[]): Vec3;
21
+ /** Bradford chromatic adaptation from white `src` to white `dst` (XYZ). */
22
+ declare function bradford(src: readonly number[], dst: readonly number[]): Mat3;
23
+ /** RGB → XYZ matrix (relative to `white`) from primaries' chromaticities, or `null` when they are dependent. */
24
+ declare function rgbToXyzMatrix(r: readonly number[], g: readonly number[], b: readonly number[], white: readonly number[]): Mat3 | null;
25
+ /** CIE XYZ → L*a*b* relative to `white` (CIE 15). */
26
+ declare function xyzToLab(xyz: readonly number[], white?: readonly number[]): Vec3;
27
+ /** CIE L*a*b* → XYZ relative to `white`. */
28
+ declare function labToXyz(lab: readonly number[], white?: readonly number[]): Vec3;
29
+ /** CIE 1976 colour difference. */
30
+ declare function deltaE76(a: readonly number[], b: readonly number[]): number;
31
+ /** Rounds to ICC s15Fixed16 (what a profile can store). */
32
+ declare const s15f16Round: (v: number) => number;
33
+ /** D50 exactly as an ICC header stores it. */
34
+ declare const d50Quantized: () => Vec3;
35
+
36
+ /**
37
+ * One-dimensional tone curves (ICC `curv` and `para`) and their inverses. Gamma and parametric
38
+ * curves evaluate analytically, also outside 0..1 (negatives mirror, values above 1 extend the
39
+ * formula), so float transforms keep HDR values. Tables clamp their input to 0..1.
40
+ */
41
+ type Curve = {
42
+ type: 'identity';
43
+ } | {
44
+ type: 'gamma';
45
+ gamma: number;
46
+ }
47
+ /** ICC `parametricCurveType` function `kind` (0–4), parameters `[g, a, b, c, d, e, f]`. */
48
+ | {
49
+ type: 'parametric';
50
+ kind: number;
51
+ p: number[];
52
+ }
53
+ /** Samples at evenly spaced inputs over 0..1. */
54
+ | {
55
+ type: 'table';
56
+ table: Float32Array;
57
+ };
58
+ declare const IDENTITY_CURVE: Curve;
59
+ /** The sRGB transfer function (IEC 61966-2.1) as ICC parametric type 3. */
60
+ declare function srgbTrc(): Curve;
61
+ declare const gammaCurve: (g: number) => Curve;
62
+ /** Parameters stored for a parametric function type. */
63
+ declare function paramCount(kind: number): number;
64
+ declare function isIdentityCurve(c: Curve): boolean;
65
+ /** Evaluates a curve at `x`. */
66
+ declare function evalCurve(c: Curve, x: number): number;
67
+ /** Evaluates the inverse curve at `y`. */
68
+ declare function evalCurveInverse(c: Curve, y: number): number;
69
+ /** `n` evenly spaced samples over 0..1. */
70
+ declare function sampleCurve(c: Curve, n: number): Float32Array;
71
+
72
+ /**
73
+ * Multidimensional colour lookup tables (ICC CLUTs): node values normalised to 0..1, evaluated
74
+ * with tetrahedral interpolation for 3 inputs, two tetrahedra lerped along the first input for 4,
75
+ * and multilinear otherwise.
76
+ */
77
+ declare const MAX_CHANNELS = 15;
78
+ declare class Clut {
79
+ readonly grid: number[];
80
+ readonly outputs: number;
81
+ readonly data: Float32Array;
82
+ readonly inputs: number;
83
+ readonly strides: number[];
84
+ constructor(grid: number[], outputs: number, data: Float32Array);
85
+ get nodes(): number;
86
+ /** A table sampled from `f` at every node. */
87
+ static sample(grid: number[], outputs: number, f: (input: Float32Array, out: Float32Array) => void): Clut;
88
+ /** Base offset, fraction and stride along input `d` at `v`. */
89
+ locate(d: number, v: number, out: number[], k: number): void;
90
+ private readonly loc;
91
+ private readonly lo;
92
+ private readonly hi;
93
+ eval(input: ArrayLike<number>, out: Float32Array | number[]): void;
94
+ /** Tetrahedral interpolation in one cube at `base` with strides `sx, sy, sz` and fractions `rx, ry, rz`. */
95
+ tetra(base: number, sx: number, sy: number, sz: number, rx: number, ry: number, rz: number, out: Float32Array | number[]): void;
96
+ evalMultilinear(input: ArrayLike<number>, out: Float32Array | number[]): void;
97
+ }
98
+
99
+ /**
100
+ * Float evaluation pipelines: stages mapping normalised device values to the profile connection
101
+ * space (or back). This is the exact path; `Transform` builds faster tables from it.
102
+ */
103
+
104
+ /** Largest channel count flowing through a pipeline. */
105
+ declare const MAX_PIPE = 16;
106
+ type Stage = {
107
+ kind: 'curves';
108
+ curves: Curve[];
109
+ } | {
110
+ kind: 'inv-curves';
111
+ curves: Curve[];
112
+ }
113
+ /** `out[r] = Σ m[r·cols + c]·in[c] + offset[r]`. */
114
+ | {
115
+ kind: 'matrix';
116
+ rows: number;
117
+ cols: number;
118
+ m: number[];
119
+ offset: number[];
120
+ } | {
121
+ kind: 'clut';
122
+ clut: Clut;
123
+ }
124
+ /** Float Lab (L 0–100) → XYZ (D50, Y = 1), and back. */
125
+ | {
126
+ kind: 'lab-to-xyz';
127
+ } | {
128
+ kind: 'xyz-to-lab';
129
+ }
130
+ /** ICC v4 / 8-bit Lab encoding (normalised) ↔ float Lab. */
131
+ | {
132
+ kind: 'decode-lab-v4';
133
+ } | {
134
+ kind: 'encode-lab-v4';
135
+ }
136
+ /** ICC v2 legacy 16-bit Lab encoding (`lut16Type`) ↔ float Lab. */
137
+ | {
138
+ kind: 'decode-lab-v2';
139
+ } | {
140
+ kind: 'encode-lab-v2';
141
+ }
142
+ /** u1Fixed15 XYZ encoding ↔ XYZ. */
143
+ | {
144
+ kind: 'decode-xyz';
145
+ } | {
146
+ kind: 'encode-xyz';
147
+ } | {
148
+ kind: 'clamp01';
149
+ };
150
+ declare function matrix3(m: Mat3): Stage;
151
+ /** Output channels of a stage given `n` inputs. */
152
+ declare function stageOutputs(s: Stage, n: number): number;
153
+ /** A sequence of stages with fixed input and output channel counts. */
154
+ declare class Pipeline {
155
+ readonly inputs: number;
156
+ stages: Stage[];
157
+ outputs: number;
158
+ private readonly v;
159
+ private readonly tmp;
160
+ private readonly tmpIn;
161
+ private readonly tmpOut;
162
+ constructor(inputs: number, stages: Stage[]);
163
+ extend(stages: Stage[]): void;
164
+ /** Evaluates one colour: `input` has `inputs` values, `out` receives `outputs`. */
165
+ eval(input: ArrayLike<number>, out: Float32Array | Float64Array | number[]): void;
166
+ /** Removes no-op stages, cancels adjacent inverse pairs and merges consecutive 3×3 matrices. */
167
+ optimize(): void;
168
+ }
169
+
170
+ /** ICC rendering intent. */
171
+ type Intent = 'perceptual' | 'relative' | 'saturation' | 'absolute';
172
+ declare const INTENTS: readonly Intent[];
173
+ declare const intentCode: (i: Intent) => number;
174
+ declare const intentFromCode: (n: number) => Intent | null;
175
+ /** Errors from parsing profiles or building transforms. */
176
+ declare class CmsError extends Error {
177
+ constructor(message: string);
178
+ }
179
+ type ProfileClass = 'input' | 'display' | 'output' | 'link' | 'colorspace' | 'abstract' | 'named' | 'unknown';
180
+ declare const classSig: (c: ProfileClass) => string;
181
+ /** Data colour space. */
182
+ type ColorSpace = 'xyz' | 'lab' | 'luv' | 'ycbcr' | 'yxy' | 'rgb' | 'gray' | 'hsv' | 'hls' | 'cmyk' | 'cmy' | `${number}clr` | 'unknown';
183
+ declare function spaceSig(c: ColorSpace): string;
184
+ /** Channels of a colour space. */
185
+ declare function spaceChannels(c: ColorSpace): number;
186
+ /** The PCS a stage list ends in (XYZ with Y = 1 for the white, or Lab with L 0–100). */
187
+ type Pcs = 'xyz' | 'lab';
188
+ /** Encoding family of a LUT tag, which fixes how its PCS side is encoded. */
189
+ type LutKind = 'lut8' | 'lut16' | 'ab';
190
+ /** A parsed `AToB` / `BToA` tag: device and PCS values normalised to 0..1. */
191
+ interface Lut {
192
+ kind: LutKind;
193
+ inputs: number;
194
+ outputs: number;
195
+ stages: Stage[];
196
+ }
197
+ /** A parsed ICC profile. */
198
+ interface Profile {
199
+ /** Major version and minor.bugfix byte (`[4, 0x30]` for 4.3). */
200
+ version: [number, number];
201
+ profileClass: ProfileClass;
202
+ colorSpace: ColorSpace;
203
+ pcs: Pcs;
204
+ renderingIntent: Intent;
205
+ description: string;
206
+ copyright: string;
207
+ /** `wtpt` (D50 when absent). */
208
+ whitePoint: Vec3;
209
+ blackPoint: Vec3 | null;
210
+ /** `chad` chromatic adaptation. */
211
+ chad: Mat3 | null;
212
+ /** Colorant matrix (columns rXYZ, gXYZ, bXYZ), D50-adapted. */
213
+ matrix: Mat3 | null;
214
+ trc: [Curve, Curve, Curve] | null;
215
+ grayTrc: Curve | null;
216
+ /** AToB0/1/2 (perceptual, colorimetric, saturation). */
217
+ a2b: [Lut | null, Lut | null, Lut | null];
218
+ b2a: [Lut | null, Lut | null, Lut | null];
219
+ /** The bytes it was parsed from (or encoded to), for byte-exact embedding. */
220
+ bytes: Uint8Array | null;
221
+ }
222
+ declare function profileChannels(p: Profile): number;
223
+ /** Largest ΔE*ab at which `sameColors` treats two profiles as one colour space. */
224
+ declare const SAME_COLORS_MAX_DELTA_E = 0.5;
225
+ /**
226
+ * Media white for ICC-absolute colorimetry: `wtpt`, except for v2 display profiles, whose
227
+ * `wtpt` records the unadapted display white; those count as D50.
228
+ */
229
+ declare function mediaWhite(p: Profile): Vec3;
230
+ /** True for matrix/TRC RGB or grey TRC profiles without LUTs. */
231
+ declare function isMatrixShaper(p: Profile): boolean;
232
+ /** Whether the profile has its own table for `intent` (matrix profiles serve every intent). */
233
+ declare function supportsIntent(p: Profile, intent: Intent, input: boolean): boolean;
234
+ /** Stages mapping normalised device values to the float PCS. */
235
+ declare function deviceToPcs(p: Profile, intent: Intent): {
236
+ stages: Stage[];
237
+ pcs: Pcs;
238
+ };
239
+ /** Stages mapping the float PCS (of the returned kind) to normalised device values. */
240
+ declare function pcsToDevice(p: Profile, intent: Intent): {
241
+ stages: Stage[];
242
+ pcs: Pcs;
243
+ };
244
+ /** Whether colours can be converted into this profile for every intent (input-only profiles cannot). */
245
+ declare function canBeDestination(p: Profile): boolean;
246
+ /**
247
+ * An RGB view of a grey TRC profile: R, G and B each carry the grey curve and a third of the
248
+ * white, so (v, v, v) has exactly the colour of grey v.
249
+ */
250
+ declare function grayAsRgb(p: Profile): Profile | null;
251
+ /** Parses ICC profile bytes. Throws `CmsError` for anything that is not a usable profile. */
252
+ declare function parseProfile(bytes: Uint8Array): Profile;
253
+
254
+ interface TransformOptions {
255
+ intent: Intent;
256
+ /** Black point compensation (ignored for absolute colorimetric). Default true. */
257
+ bpc: boolean;
258
+ /** Float buffers through the exact pipeline (default true) rather than the tables. */
259
+ preciseFloat: boolean;
260
+ }
261
+ declare const DEFAULT_TRANSFORM_OPTIONS: Readonly<TransformOptions>;
262
+ /** A colour transform from one profile's device space to another's. Build once, apply often. */
263
+ declare class Transform {
264
+ readonly pipeline: Pipeline;
265
+ readonly options: TransformOptions;
266
+ readonly inputs: number;
267
+ readonly outputs: number;
268
+ private core;
269
+ private post;
270
+ private readonly mid;
271
+ private readonly tmp;
272
+ private readonly inp;
273
+ constructor(pipeline: Pipeline, options: TransformOptions);
274
+ /** From `src` to `dst` with `intent` (and black point compensation). */
275
+ static create(src: Profile, dst: Profile, options?: Partial<TransformOptions>): Transform;
276
+ /**
277
+ * Soft proof `src → proof → dst` (View › Proof Setup): `intent` / `bpc` apply to the
278
+ * document → proof step; proof → display is relative colorimetric with BPC, or absolute
279
+ * colorimetric without it when `simulatePaper` (paper colour and black ink simulated).
280
+ */
281
+ static proof(src: Profile, proof: Profile, dst: Profile, intent: Intent, bpc: boolean, simulatePaper: boolean): Transform;
282
+ /** The device-link node at the source's device white gets exactly the destination's white. */
283
+ private fixWhite;
284
+ /** Exact evaluation of one colour. */
285
+ eval(input: ArrayLike<number>, out: Float32Array | number[]): void;
286
+ /** Table evaluation of one colour (what integer buffers use). */
287
+ evalFast(input: ArrayLike<number>, out: Float32Array | number[]): void;
288
+ private finish;
289
+ /**
290
+ * Converts 8-bit interleaved pixels: `src` has `srcStride` samples per pixel (colour first),
291
+ * `dst` `dstStride`. With `copyExtra`, trailing channels (alpha) are copied.
292
+ */
293
+ convert8(src: ArrayLike<number>, srcStride: number, dst: Uint8Array | Uint8ClampedArray, dstStride: number, copyExtra?: boolean): void;
294
+ /** Converts 16-bit interleaved pixels (see `convert8`). */
295
+ convert16(src: ArrayLike<number>, srcStride: number, dst: Uint16Array, dstStride: number, copyExtra?: boolean): void;
296
+ /** Converts float interleaved pixels (exact unless `preciseFloat` is off). */
297
+ convertFloat(src: ArrayLike<number>, srcStride: number, dst: Float32Array, dstStride: number, copyExtra?: boolean): void;
298
+ private check;
299
+ }
300
+ /** Stages from `src` device values to `dst` device values. */
301
+ declare function linkStages(src: Profile, dst: Profile, intent: Intent, bpc: boolean): Stage[];
302
+ /** Luminance (Y, D50-relative) of a profile's black point for `intent`. */
303
+ declare function blackPoint(p: Profile, intent: Intent): number;
304
+ /** A transform from a small cache keyed by the profile objects and the options. */
305
+ declare function cachedTransform(src: Profile, dst: Profile, options?: Partial<TransformOptions>): Transform;
306
+ /**
307
+ * Whether two profiles describe the same colours: same colour space, and every sample of a
308
+ * device grid lands within ΔE*ab 0.5 through both (relative colorimetric), whatever their
309
+ * encodings (Photoshop's v2 sRGB and a v4 parametric sRGB are the same colours).
310
+ */
311
+ declare function sameColors(a: Profile, b: Profile, lab: Profile): boolean;
312
+ /** Out-of-gamut test (Photoshop's Gamut Warning): ΔE between a colour and its round trip through a proof profile. */
313
+ declare class GamutCheck {
314
+ /** ΔE*ab above which a colour is out of gamut (default 4). */
315
+ readonly threshold: number;
316
+ private readonly grid;
317
+ private readonly direct;
318
+ private readonly via;
319
+ constructor(src: Profile, proof: Profile, lab: Profile,
320
+ /** ΔE*ab above which a colour is out of gamut (default 4). */
321
+ threshold?: number);
322
+ /** ΔE*ab of a colour (normalised device values). */
323
+ deltaE(px: ArrayLike<number>): number;
324
+ outOfGamut(px: ArrayLike<number>): boolean;
325
+ }
326
+ /** A 3D lookup table of an RGB → RGB transform (`size`³ RGB triples, red fastest), for fast display paths. */
327
+ declare class Lut3d {
328
+ readonly size: number;
329
+ readonly data: Float32Array;
330
+ constructor(t: Transform, size?: number);
331
+ /** Trilinear sample of 0..1 RGB into `out`. */
332
+ sample(r: number, g: number, b: number, out: number[] | Float32Array): void;
333
+ /** Applies the table to 8-bit RGBA in place (alpha kept), through a per-code 8-bit cache of the lattice. */
334
+ apply8(data: Uint8ClampedArray | Uint8Array): void;
335
+ }
336
+
337
+ declare const BUILTIN_COPYRIGHT = "No copyright: CC0-1.0 public domain dedication. Generated by Pixerate.";
338
+ /** Identifiers of the built-in profiles. */
339
+ type BuiltinProfileId = 'srgb' | 'display-p3' | 'adobe-rgb-compat' | 'prophoto-compat' | 'linear-srgb' | 'rec2020' | 'gray-gamma-2.2' | 'sgray' | 'dot-gain-20-compat' | 'lab-d50' | 'coated-cmyk';
340
+ declare const BUILTIN_PROFILES: readonly {
341
+ id: BuiltinProfileId;
342
+ description: string;
343
+ colorSpace: ColorSpace;
344
+ }[];
345
+ /** Looks up a built-in id (case-insensitive; a few aliases and the descriptions too). */
346
+ declare function builtinProfileId(s: string): BuiltinProfileId | null;
347
+ /** A built-in profile (built once; the synthetic CMYK takes about a second the first time). */
348
+ declare function builtinProfile(id: BuiltinProfileId): Profile;
349
+ /** sRGB IEC 61966-2.1, the default working space. */
350
+ declare const srgbProfile: () => Profile;
351
+ /** The default profile of a colour space: sRGB, Dot Gain 20 %-compatible grey, the coated CMYK, Lab D50. */
352
+ declare function defaultProfileFor(cs: ColorSpace): Profile | null;
353
+
354
+ export { linkStages as $, classSig as A, BUILTIN_COPYRIGHT as B, Clut as C, D50 as D, d50Quantized as E, defaultProfileFor as F, GamutCheck as G, deltaE76 as H, IDENTITY as I, det as J, deviceToPcs as K, type Lut as L, MAX_CHANNELS as M, evalCurve as N, evalCurveInverse as O, type Profile as P, gammaCurve as Q, grayAsRgb as R, SAME_COLORS_MAX_DELTA_E as S, Transform as T, intentCode as U, type Vec3 as V, intentFromCode as W, invert as X, isIdentityCurve as Y, isMatrixShaper as Z, labToXyz as _, BUILTIN_PROFILES as a, matrix3 as a0, mediaWhite as a1, mul as a2, paramCount as a3, parseProfile as a4, pcsToDevice as a5, profileChannels as a6, rgbToXyzMatrix as a7, s15f16Round as a8, sameColors as a9, sampleCurve as aa, spaceChannels as ab, spaceSig as ac, srgbProfile as ad, srgbTrc as ae, stageOutputs as af, supportsIntent as ag, xyToXyz as ah, xyzToLab as ai, type BuiltinProfileId as b, CmsError as c, type ColorSpace as d, type Curve as e, D65_XY as f, DEFAULT_TRANSFORM_OPTIONS as g, IDENTITY_CURVE as h, INTENTS as i, type Intent as j, Lut3d as k, type LutKind as l, MAX_PIPE as m, type Mat3 as n, type Pcs as o, Pipeline as p, type ProfileClass as q, type Stage as r, type TransformOptions as s, apply as t, blackPoint as u, bradford as v, builtinProfile as w, builtinProfileId as x, cachedTransform as y, canBeDestination as z };