@flighthq/adjustments 0.5.1-next.903.f434bc2 → 0.5.1-next.905.5fbf787
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/README.md +2 -2
- package/package.json +3 -3
- package/src/adjustment.test.ts +7 -0
- package/src/brightnessContrastAdjustment.test.ts +9 -1
- package/src/channelMixerAdjustment.test.ts +6 -1
- package/src/colorBlindSimulationAdjustment.test.ts +9 -1
- package/src/colorGradeAdjustment.test.ts +6 -1
- package/src/colorLutAdjustment.test.ts +6 -1
- package/src/colorLutCache.test.ts +6 -1
- package/src/colorMatrixAdjustment.test.ts +6 -0
- package/src/colorScaleBiasAdjustment.test.ts +6 -1
- package/src/exposureAdjustment.test.ts +6 -1
- package/src/grayscaleAdjustment.test.ts +6 -1
- package/src/hueSaturationAdjustment.test.ts +6 -1
- package/src/invertAdjustment.test.ts +6 -1
- package/src/liftGammaGainAdjustment.test.ts +6 -1
- package/src/lookupTableGradeAdjustment.test.ts +6 -1
- package/src/sepiaAdjustment.test.ts +6 -1
- package/src/tintAdjustment.test.ts +6 -1
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/adjustments`. The `@
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/adjustments@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/adjustments@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/adjustments)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/adjustments",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.905.5fbf787",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/entity": "0.5.1-next.
|
|
42
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^5.3.0"
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createBrightnessContrastAdjustment,
|
|
3
|
+
initializeBrightnessContrastAdjustment,
|
|
4
|
+
} from './brightnessContrastAdjustment';
|
|
2
5
|
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
3
6
|
|
|
4
7
|
describe('createBrightnessContrastAdjustment', () => {
|
|
@@ -21,3 +24,8 @@ describe('createBrightnessContrastAdjustment', () => {
|
|
|
21
24
|
expect(applyColorMatrixToColor(adjustment.colorMatrix as number[], 0xffffffff)).toBe(0xbababaff);
|
|
22
25
|
});
|
|
23
26
|
});
|
|
27
|
+
describe('initializeBrightnessContrastAdjustment', () => {
|
|
28
|
+
it('is the construction initializer of createBrightnessContrastAdjustment', () => {
|
|
29
|
+
expect(typeof initializeBrightnessContrastAdjustment).toBe('function');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createChannelMixerAdjustment } from './channelMixerAdjustment';
|
|
1
|
+
import { createChannelMixerAdjustment, initializeChannelMixerAdjustment } from './channelMixerAdjustment';
|
|
2
2
|
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
3
3
|
|
|
4
4
|
describe('createChannelMixerAdjustment', () => {
|
|
@@ -22,3 +22,8 @@ describe('createChannelMixerAdjustment', () => {
|
|
|
22
22
|
expect(applyColorMatrixToColor(adjustment.colorMatrix as number[], 0x102030ff)).toBe(0xffffffff);
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
|
+
describe('initializeChannelMixerAdjustment', () => {
|
|
26
|
+
it('is the construction initializer of createChannelMixerAdjustment', () => {
|
|
27
|
+
expect(typeof initializeChannelMixerAdjustment).toBe('function');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createColorBlindSimulationAdjustment,
|
|
3
|
+
initializeColorBlindSimulationAdjustment,
|
|
4
|
+
} from './colorBlindSimulationAdjustment';
|
|
2
5
|
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
3
6
|
|
|
4
7
|
describe('createColorBlindSimulationAdjustment', () => {
|
|
@@ -25,3 +28,8 @@ describe('createColorBlindSimulationAdjustment', () => {
|
|
|
25
28
|
);
|
|
26
29
|
});
|
|
27
30
|
});
|
|
31
|
+
describe('initializeColorBlindSimulationAdjustment', () => {
|
|
32
|
+
it('is the construction initializer of createColorBlindSimulationAdjustment', () => {
|
|
33
|
+
expect(typeof initializeColorBlindSimulationAdjustment).toBe('function');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createColorGradeAdjustment } from './colorGradeAdjustment';
|
|
1
|
+
import { createColorGradeAdjustment, initializeColorGradeAdjustment } from './colorGradeAdjustment';
|
|
2
2
|
|
|
3
3
|
describe('createColorGradeAdjustment', () => {
|
|
4
4
|
it('defaults to approximately neutral (contrast 1, all stages near-neutral)', () => {
|
|
@@ -34,3 +34,8 @@ describe('createColorGradeAdjustment', () => {
|
|
|
34
34
|
expect(out[2]).toBeCloseTo(0.2126, 2);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
+
describe('initializeColorGradeAdjustment', () => {
|
|
38
|
+
it('is the construction initializer of createColorGradeAdjustment', () => {
|
|
39
|
+
expect(typeof initializeColorGradeAdjustment).toBe('function');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAdjustmentColorTransform, isColorLutAdjustment } from './colorLutAdjustment';
|
|
1
|
+
import { getAdjustmentColorTransform, initializeColorLutAdjustment, isColorLutAdjustment } from './colorLutAdjustment';
|
|
2
2
|
import { createHueSaturationAdjustment } from './hueSaturationAdjustment';
|
|
3
3
|
import { createInvertAdjustment } from './invertAdjustment';
|
|
4
4
|
|
|
@@ -25,6 +25,11 @@ describe('getAdjustmentColorTransform', () => {
|
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
describe('initializeColorLutAdjustment', () => {
|
|
29
|
+
it('is the construction initializer of createColorLutAdjustment', () => {
|
|
30
|
+
expect(typeof initializeColorLutAdjustment).toBe('function');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
28
33
|
describe('isColorLutAdjustment', () => {
|
|
29
34
|
it('is true for a LUT-tier adjustment', () => {
|
|
30
35
|
expect(isColorLutAdjustment(createHueSaturationAdjustment())).toBe(true);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createColorGradeAdjustment } from './colorGradeAdjustment';
|
|
2
2
|
import { bakeColorLut } from './colorLut';
|
|
3
3
|
import { getAdjustmentColorTransform } from './colorLutAdjustment';
|
|
4
|
-
import { bakeColorLutForRun, createColorLutCache } from './colorLutCache';
|
|
4
|
+
import { bakeColorLutForRun, createColorLutCache, initializeColorLutCache } from './colorLutCache';
|
|
5
5
|
import { createHueSaturationAdjustment } from './hueSaturationAdjustment';
|
|
6
6
|
|
|
7
7
|
describe('bakeColorLutForRun', () => {
|
|
@@ -59,3 +59,8 @@ describe('createColorLutCache', () => {
|
|
|
59
59
|
expect(cache.lut).toBeNull();
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
|
+
describe('initializeColorLutCache', () => {
|
|
63
|
+
it('is the construction initializer of createColorLutCache', () => {
|
|
64
|
+
expect(typeof initializeColorLutCache).toBe('function');
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createColorMatrixAdjustment,
|
|
3
3
|
getAdjustmentColorMatrix,
|
|
4
|
+
initializeColorMatrixAdjustment,
|
|
4
5
|
isColorMatrixAdjustment,
|
|
5
6
|
} from './colorMatrixAdjustment';
|
|
6
7
|
import { createIdentityColorMatrix } from './colorMatrixMath';
|
|
@@ -30,6 +31,11 @@ describe('getAdjustmentColorMatrix', () => {
|
|
|
30
31
|
expect(getAdjustmentColorMatrix({ kind: 'acme.Bad', colorMatrix: [1, 2, 3] } as never)).toBeNull();
|
|
31
32
|
});
|
|
32
33
|
});
|
|
34
|
+
describe('initializeColorMatrixAdjustment', () => {
|
|
35
|
+
it('is the construction initializer of createColorMatrixAdjustment', () => {
|
|
36
|
+
expect(typeof initializeColorMatrixAdjustment).toBe('function');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
33
39
|
describe('isColorMatrixAdjustment', () => {
|
|
34
40
|
it('is true for a matrix-tier adjustment and false for an effect', () => {
|
|
35
41
|
expect(isColorMatrixAdjustment(createInvertAdjustment())).toBe(true);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createColorScaleBiasAdjustment } from './colorScaleBiasAdjustment';
|
|
1
|
+
import { createColorScaleBiasAdjustment, initializeColorScaleBiasAdjustment } from './colorScaleBiasAdjustment';
|
|
2
2
|
|
|
3
3
|
describe('createColorScaleBiasAdjustment', () => {
|
|
4
4
|
it('keeps a legible bridge payload and contributes its diagonal matrix', () => {
|
|
@@ -19,3 +19,8 @@ describe('createColorScaleBiasAdjustment', () => {
|
|
|
19
19
|
expect(adjustment.colorMatrix[9]).toBe(0.25);
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
+
describe('initializeColorScaleBiasAdjustment', () => {
|
|
23
|
+
it('is the construction initializer of createColorScaleBiasAdjustment', () => {
|
|
24
|
+
expect(typeof initializeColorScaleBiasAdjustment).toBe('function');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
2
|
-
import { createExposureAdjustment } from './exposureAdjustment';
|
|
2
|
+
import { createExposureAdjustment, initializeExposureAdjustment } from './exposureAdjustment';
|
|
3
3
|
|
|
4
4
|
describe('createExposureAdjustment', () => {
|
|
5
5
|
it('defaults to the identity (exposure 0)', () => {
|
|
@@ -20,3 +20,8 @@ describe('createExposureAdjustment', () => {
|
|
|
20
20
|
expect(applyColorMatrixToColor(adjustment.colorMatrix as number[], 0x808080ff)).toBe(0xffffffff);
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
|
+
describe('initializeExposureAdjustment', () => {
|
|
24
|
+
it('is the construction initializer of createExposureAdjustment', () => {
|
|
25
|
+
expect(typeof initializeExposureAdjustment).toBe('function');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
2
|
-
import { createGrayscaleAdjustment } from './grayscaleAdjustment';
|
|
2
|
+
import { createGrayscaleAdjustment, initializeGrayscaleAdjustment } from './grayscaleAdjustment';
|
|
3
3
|
|
|
4
4
|
describe('createGrayscaleAdjustment', () => {
|
|
5
5
|
it('defaults to full BT.709 luma desaturation', () => {
|
|
@@ -21,3 +21,8 @@ describe('createGrayscaleAdjustment', () => {
|
|
|
21
21
|
expect(applyColorMatrixToColor(adjustment.colorMatrix as number[], 0x2040a0ff)).toBe(0x2040a0ff);
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
+
describe('initializeGrayscaleAdjustment', () => {
|
|
25
|
+
it('is the construction initializer of createGrayscaleAdjustment', () => {
|
|
26
|
+
expect(typeof initializeGrayscaleAdjustment).toBe('function');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHueSaturationAdjustment } from './hueSaturationAdjustment';
|
|
1
|
+
import { createHueSaturationAdjustment, initializeHueSaturationAdjustment } from './hueSaturationAdjustment';
|
|
2
2
|
|
|
3
3
|
describe('createHueSaturationAdjustment', () => {
|
|
4
4
|
it('defaults to the identity and carries a fusable transform', () => {
|
|
@@ -31,3 +31,8 @@ describe('createHueSaturationAdjustment', () => {
|
|
|
31
31
|
expect(out[2]).toBeCloseTo(0, 4);
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
+
describe('initializeHueSaturationAdjustment', () => {
|
|
35
|
+
it('is the construction initializer of createHueSaturationAdjustment', () => {
|
|
36
|
+
expect(typeof initializeHueSaturationAdjustment).toBe('function');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
2
|
-
import { createInvertAdjustment } from './invertAdjustment';
|
|
2
|
+
import { createInvertAdjustment, initializeInvertAdjustment } from './invertAdjustment';
|
|
3
3
|
|
|
4
4
|
describe('createInvertAdjustment', () => {
|
|
5
5
|
it('defaults to a full invert and carries the fusable kind', () => {
|
|
@@ -22,3 +22,8 @@ describe('createInvertAdjustment', () => {
|
|
|
22
22
|
expect(applyColorMatrixToColor(adjustment.colorMatrix as number[], 0x00ffccff)).toBe(0x808080ff);
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
|
+
describe('initializeInvertAdjustment', () => {
|
|
26
|
+
it('is the construction initializer of createInvertAdjustment', () => {
|
|
27
|
+
expect(typeof initializeInvertAdjustment).toBe('function');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLiftGammaGainAdjustment } from './liftGammaGainAdjustment';
|
|
1
|
+
import { createLiftGammaGainAdjustment, initializeLiftGammaGainAdjustment } from './liftGammaGainAdjustment';
|
|
2
2
|
|
|
3
3
|
describe('createLiftGammaGainAdjustment', () => {
|
|
4
4
|
it('defaults to approximately neutral', () => {
|
|
@@ -29,3 +29,8 @@ describe('createLiftGammaGainAdjustment', () => {
|
|
|
29
29
|
expect(out[0]).toBeCloseTo(1, 4);
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
+
describe('initializeLiftGammaGainAdjustment', () => {
|
|
33
|
+
it('is the construction initializer of createLiftGammaGainAdjustment', () => {
|
|
34
|
+
expect(typeof initializeLiftGammaGainAdjustment).toBe('function');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bakeColorLut } from './colorLut';
|
|
2
|
-
import { createLookupTableGradeAdjustment } from './lookupTableGradeAdjustment';
|
|
2
|
+
import { createLookupTableGradeAdjustment, initializeLookupTableGradeAdjustment } from './lookupTableGradeAdjustment';
|
|
3
3
|
|
|
4
4
|
describe('createLookupTableGradeAdjustment', () => {
|
|
5
5
|
it('is a neutral passthrough with no supplied LUT', () => {
|
|
@@ -47,3 +47,8 @@ describe('createLookupTableGradeAdjustment', () => {
|
|
|
47
47
|
expect(out[0]).toBeCloseTo(0.5, 4);
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
+
describe('initializeLookupTableGradeAdjustment', () => {
|
|
51
|
+
it('is the construction initializer of createLookupTableGradeAdjustment', () => {
|
|
52
|
+
expect(typeof initializeLookupTableGradeAdjustment).toBe('function');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
2
|
-
import { createSepiaAdjustment } from './sepiaAdjustment';
|
|
2
|
+
import { createSepiaAdjustment, initializeSepiaAdjustment } from './sepiaAdjustment';
|
|
3
3
|
|
|
4
4
|
describe('createSepiaAdjustment', () => {
|
|
5
5
|
it('defaults to a full sepia tone', () => {
|
|
@@ -16,3 +16,8 @@ describe('createSepiaAdjustment', () => {
|
|
|
16
16
|
expect(applyColorMatrixToColor(adjustment.colorMatrix as number[], 0x3366ccff)).toBe(0x3366ccff);
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
+
describe('initializeSepiaAdjustment', () => {
|
|
20
|
+
it('is the construction initializer of createSepiaAdjustment', () => {
|
|
21
|
+
expect(typeof initializeSepiaAdjustment).toBe('function');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
|
|
3
3
|
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
4
|
-
import { createTintAdjustment } from './tintAdjustment';
|
|
4
|
+
import { createTintAdjustment, initializeTintAdjustment } from './tintAdjustment';
|
|
5
5
|
|
|
6
6
|
describe('createTintAdjustment', () => {
|
|
7
7
|
it('carries the TintAdjustment kind and a 20-length diagonal matrix', () => {
|
|
@@ -29,3 +29,8 @@ describe('createTintAdjustment', () => {
|
|
|
29
29
|
expect(applyColorMatrixToColor(createTintAdjustment(0x808080ff).colorMatrix, 0x808080ff)).toBe(0x404040ff);
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
+
describe('initializeTintAdjustment', () => {
|
|
33
|
+
it('is the construction initializer of createTintAdjustment', () => {
|
|
34
|
+
expect(typeof initializeTintAdjustment).toBe('function');
|
|
35
|
+
});
|
|
36
|
+
});
|