ag-psd 28.2.0 → 28.2.2
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/.v8-cache/v22.13.1-x64-00250a7c/b3c2fab7 +0 -0
- package/dist/additionalInfo.js +12 -16
- package/dist/additionalInfo.js.map +1 -1
- package/dist/bundle.js +36 -2163
- package/dist/psd.d.ts +1 -1
- package/dist-es/additionalInfo.js +12 -16
- package/dist-es/additionalInfo.js.map +1 -1
- package/dist-es/psd.d.ts +1 -1
- package/package.json +1 -1
- package/src/additionalInfo.ts +41 -38
- package/src/psd.ts +1 -1
package/dist-es/psd.d.ts
CHANGED
package/package.json
CHANGED
package/src/additionalInfo.ts
CHANGED
|
@@ -1939,7 +1939,7 @@ type SoLdDescriptorFilterItem = {
|
|
|
1939
1939
|
_name: 'Curves';
|
|
1940
1940
|
_classID: 'Crvs';
|
|
1941
1941
|
presetKind: string; // 'presetKindType.presetKindCustom';
|
|
1942
|
-
Adjs
|
|
1942
|
+
Adjs?: {
|
|
1943
1943
|
_name: '';
|
|
1944
1944
|
_classID: 'CrvA';
|
|
1945
1945
|
Chnl: string[]; // 'Chnl.Cmps' | 'Chnl.Rd ' | 'Chnl.Grn ' | 'Chnl.Bl '
|
|
@@ -2216,7 +2216,7 @@ function parseFilterFXItem(f: SoLdDescriptorFilterItem, options: ReadOptions): F
|
|
|
2216
2216
|
reduceColorNoise: parsePercent(f.Fltr.ClNs),
|
|
2217
2217
|
sharpenDetails: parsePercent(f.Fltr.Shrp),
|
|
2218
2218
|
channelDenoise: f.Fltr.channelDenoise.map(c => ({
|
|
2219
|
-
channels: c.Chnl.map(
|
|
2219
|
+
channels: c.Chnl.map(Chnl.decode),
|
|
2220
2220
|
amount: c.Amnt,
|
|
2221
2221
|
...(c.EdgF ? { preserveDetails: c.EdgF } : {}),
|
|
2222
2222
|
})),
|
|
@@ -2565,24 +2565,25 @@ function parseFilterFXItem(f: SoLdDescriptorFilterItem, options: ReadOptions): F
|
|
|
2565
2565
|
type: 'curves',
|
|
2566
2566
|
filter: {
|
|
2567
2567
|
presetKind: presetKindType.decode(f.Fltr.presetKind),
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2568
|
+
...(f.Fltr.Adjs ? {
|
|
2569
|
+
adjustments: f.Fltr.Adjs.map(a => {
|
|
2570
|
+
const channels = a.Chnl.map(Chnl.decode);
|
|
2571
|
+
if (a['Crv ']) {
|
|
2572
|
+
return {
|
|
2573
|
+
channels,
|
|
2574
|
+
curve: a['Crv '].map(c => {
|
|
2575
|
+
const point: { x: number; y: number; curved?: boolean; } = { x: c.Hrzn, y: c.Vrtc };
|
|
2576
|
+
if (c.Cnty) point.curved = true;
|
|
2577
|
+
return point;
|
|
2578
|
+
}),
|
|
2579
|
+
};
|
|
2580
|
+
} else if (a.Mpng) {
|
|
2581
|
+
return { channels, values: a.Mpng };
|
|
2582
|
+
} else {
|
|
2583
|
+
throw new Error(`Unknown curve adjustment`);
|
|
2584
|
+
}
|
|
2585
|
+
})
|
|
2586
|
+
} : {}),
|
|
2586
2587
|
},
|
|
2587
2588
|
};
|
|
2588
2589
|
};
|
|
@@ -2599,7 +2600,7 @@ function parseFilterFXItem(f: SoLdDescriptorFilterItem, options: ReadOptions): F
|
|
|
2599
2600
|
};
|
|
2600
2601
|
default:
|
|
2601
2602
|
if (options.throwForMissingFeatures) {
|
|
2602
|
-
console.log('FILTER', require('util').inspect(f, false, 99, true));
|
|
2603
|
+
// console.log('FILTER', require('util').inspect(f, false, 99, true));
|
|
2603
2604
|
throw new Error(`Unknown filter classId: ${(f as any).Fltr._classID}`);
|
|
2604
2605
|
}
|
|
2605
2606
|
return undefined;
|
|
@@ -2621,7 +2622,7 @@ function parseFilterFXItem(f: SoLdDescriptorFilterItem, options: ReadOptions): F
|
|
|
2621
2622
|
case 1231976050: return { ...base, type: 'invert' }
|
|
2622
2623
|
default:
|
|
2623
2624
|
if (options.throwForMissingFeatures) {
|
|
2624
|
-
console.log('FILTER', require('util').inspect(f, false, 99, true));
|
|
2625
|
+
// console.log('FILTER', require('util').inspect(f, false, 99, true));
|
|
2625
2626
|
throw new Error(`Unknown filterID: ${(f as any).filterID}`);
|
|
2626
2627
|
}
|
|
2627
2628
|
}
|
|
@@ -3297,23 +3298,25 @@ function serializeFilterFXItem(f: Filter): SoLdDescriptorFilterItem {
|
|
|
3297
3298
|
_name: 'Curves',
|
|
3298
3299
|
_classID: 'Crvs',
|
|
3299
3300
|
presetKind: presetKindType.encode(f.filter.presetKind),
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
_classID: 'CrvA',
|
|
3303
|
-
Chnl: a.channels.map(c => Chnl.encode(c)),
|
|
3304
|
-
'Crv ': a.curve.map(c => ({
|
|
3301
|
+
...(f.filter.adjustments ? {
|
|
3302
|
+
Adjs: f.filter.adjustments.map(a => 'curve' in a ? {
|
|
3305
3303
|
_name: '',
|
|
3306
|
-
_classID: '
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3304
|
+
_classID: 'CrvA',
|
|
3305
|
+
Chnl: a.channels.map(Chnl.encode),
|
|
3306
|
+
'Crv ': a.curve.map(c => ({
|
|
3307
|
+
_name: '',
|
|
3308
|
+
_classID: 'Pnt ',
|
|
3309
|
+
Hrzn: c.x,
|
|
3310
|
+
Vrtc: c.y,
|
|
3311
|
+
...(c.curved ? { Cnty: true } : {}),
|
|
3312
|
+
}) as FilterCurvesCurvePoint),
|
|
3313
|
+
} : {
|
|
3314
|
+
_name: '',
|
|
3315
|
+
_classID: 'CrvA',
|
|
3316
|
+
Chnl: a.channels.map(Chnl.encode),
|
|
3317
|
+
Mpng: a.values,
|
|
3318
|
+
})
|
|
3319
|
+
} : {}),
|
|
3317
3320
|
},
|
|
3318
3321
|
filterID: 1131574899,
|
|
3319
3322
|
};
|
package/src/psd.ts
CHANGED
|
@@ -1161,7 +1161,7 @@ type FilterVariant = {
|
|
|
1161
1161
|
type: 'curves';
|
|
1162
1162
|
filter: {
|
|
1163
1163
|
presetKind: 'custom' | 'default';
|
|
1164
|
-
adjustments
|
|
1164
|
+
adjustments?: ({
|
|
1165
1165
|
channels: ('composite' | 'red' | 'green' | 'blue')[];
|
|
1166
1166
|
curve: { x: number; y: number; curved?: boolean; }[];
|
|
1167
1167
|
} | {
|