@flighthq/adjustments 0.5.1-next.920.da8f530 → 0.6.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.
- package/README.md +2 -2
- package/dist/.tsbuildinfo.contract +1 -0
- package/dist/.tsbuildinfo.runtime +1 -0
- package/dist/adjustment.d.ts +2 -1
- package/dist/adjustment.d.ts.map +1 -1
- package/dist/adjustment.js.map +1 -1
- package/dist/brightnessContrastAdjustment.d.ts +2 -1
- package/dist/brightnessContrastAdjustment.d.ts.map +1 -1
- package/dist/brightnessContrastAdjustment.js +6 -6
- package/dist/brightnessContrastAdjustment.js.map +1 -1
- package/dist/channelMixerAdjustment.d.ts +2 -1
- package/dist/channelMixerAdjustment.d.ts.map +1 -1
- package/dist/channelMixerAdjustment.js +4 -4
- package/dist/channelMixerAdjustment.js.map +1 -1
- package/dist/colorAdjustmentResolution.d.ts +3 -3
- package/dist/colorAdjustmentResolution.d.ts.map +1 -1
- package/dist/colorAdjustmentResolution.js +2 -2
- package/dist/colorAdjustmentResolution.js.map +1 -1
- package/dist/colorBlindSimulationAdjustment.d.ts +2 -1
- package/dist/colorBlindSimulationAdjustment.d.ts.map +1 -1
- package/dist/colorBlindSimulationAdjustment.js +5 -5
- package/dist/colorBlindSimulationAdjustment.js.map +1 -1
- package/dist/colorGradeAdjustment.d.ts +2 -1
- package/dist/colorGradeAdjustment.d.ts.map +1 -1
- package/dist/colorGradeAdjustment.js +3 -3
- package/dist/colorGradeAdjustment.js.map +1 -1
- package/dist/colorLut.d.ts +1 -1
- package/dist/colorLut.d.ts.map +1 -1
- package/dist/colorLut.js.map +1 -1
- package/dist/colorLutAdjustment.d.ts +2 -1
- package/dist/colorLutAdjustment.d.ts.map +1 -1
- package/dist/colorLutAdjustment.js +3 -3
- package/dist/colorLutAdjustment.js.map +1 -1
- package/dist/colorLutCache.d.ts +2 -1
- package/dist/colorLutCache.d.ts.map +1 -1
- package/dist/colorLutCache.js +4 -4
- package/dist/colorLutCache.js.map +1 -1
- package/dist/colorMatrixAdjustment.d.ts +5 -4
- package/dist/colorMatrixAdjustment.d.ts.map +1 -1
- package/dist/colorMatrixAdjustment.js +7 -7
- package/dist/colorMatrixAdjustment.js.map +1 -1
- package/dist/colorMatrixMath.d.ts +23 -24
- package/dist/colorMatrixMath.d.ts.map +1 -1
- package/dist/colorMatrixMath.js +58 -61
- package/dist/colorMatrixMath.js.map +1 -1
- package/dist/colorScaleBiasAdjustment.d.ts +2 -1
- package/dist/colorScaleBiasAdjustment.d.ts.map +1 -1
- package/dist/colorScaleBiasAdjustment.js +5 -5
- package/dist/colorScaleBiasAdjustment.js.map +1 -1
- package/dist/contract.adjustments-types.d.ts +2 -0
- package/dist/contract.adjustments-types.d.ts.map +1 -0
- package/dist/contract.adjustments-types.js +2 -0
- package/dist/contract.adjustments-types.js.map +1 -0
- package/dist/contract.d.ts +21 -34
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +20 -34
- package/dist/contract.js.map +1 -1
- package/dist/exposureAdjustment.d.ts +2 -1
- package/dist/exposureAdjustment.d.ts.map +1 -1
- package/dist/exposureAdjustment.js +5 -5
- package/dist/exposureAdjustment.js.map +1 -1
- package/dist/grayscaleAdjustment.d.ts +2 -1
- package/dist/grayscaleAdjustment.d.ts.map +1 -1
- package/dist/grayscaleAdjustment.js +5 -5
- package/dist/grayscaleAdjustment.js.map +1 -1
- package/dist/hueSaturationAdjustment.d.ts +2 -1
- package/dist/hueSaturationAdjustment.d.ts.map +1 -1
- package/dist/hueSaturationAdjustment.js +3 -3
- package/dist/hueSaturationAdjustment.js.map +1 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/invertAdjustment.d.ts +2 -1
- package/dist/invertAdjustment.d.ts.map +1 -1
- package/dist/invertAdjustment.js +5 -5
- package/dist/invertAdjustment.js.map +1 -1
- package/dist/liftGammaGainAdjustment.d.ts +2 -1
- package/dist/liftGammaGainAdjustment.d.ts.map +1 -1
- package/dist/liftGammaGainAdjustment.js +3 -3
- package/dist/liftGammaGainAdjustment.js.map +1 -1
- package/dist/lookupTableGradeAdjustment.d.ts +2 -1
- package/dist/lookupTableGradeAdjustment.d.ts.map +1 -1
- package/dist/lookupTableGradeAdjustment.js +4 -4
- package/dist/lookupTableGradeAdjustment.js.map +1 -1
- package/dist/sepiaAdjustment.d.ts +2 -1
- package/dist/sepiaAdjustment.d.ts.map +1 -1
- package/dist/sepiaAdjustment.js +5 -5
- package/dist/sepiaAdjustment.js.map +1 -1
- package/dist/tintAdjustment.d.ts +2 -1
- package/dist/tintAdjustment.d.ts.map +1 -1
- package/dist/tintAdjustment.js +5 -5
- package/dist/tintAdjustment.js.map +1 -1
- package/dist/types.d.ts +119 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +5 -4
- package/src/adjustment.test.ts +1 -1
- package/src/brightnessContrastAdjustment.test.ts +6 -6
- package/src/channelMixerAdjustment.test.ts +5 -5
- package/src/colorAdjustmentResolution.test.ts +17 -11
- package/src/colorBlindSimulationAdjustment.test.ts +7 -7
- package/src/colorGradeAdjustment.test.ts +1 -1
- package/src/colorLut.test.ts +2 -3
- package/src/colorLutAdjustment.test.ts +7 -3
- package/src/colorLutCache.test.ts +5 -5
- package/src/colorMatrixAdjustment.test.ts +3 -3
- package/src/colorMatrixMath.test.ts +20 -12
- package/src/colorScaleBiasAdjustment.test.ts +1 -1
- package/src/exposureAdjustment.test.ts +5 -5
- package/src/grayscaleAdjustment.test.ts +4 -4
- package/src/hueSaturationAdjustment.test.ts +1 -1
- package/src/invertAdjustment.test.ts +6 -6
- package/src/liftGammaGainAdjustment.test.ts +1 -1
- package/src/lookupTableGradeAdjustment.test.ts +5 -2
- package/src/sepiaAdjustment.test.ts +4 -4
- package/src/tintAdjustment.test.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
2
|
-
import { createInvertAdjustment, initializeInvertAdjustment } from './invertAdjustment';
|
|
1
|
+
import { applyColorMatrixToColor } from './colorMatrixMath.ts';
|
|
2
|
+
import { createInvertAdjustment, initializeInvertAdjustment } from './invertAdjustment.ts';
|
|
3
3
|
|
|
4
4
|
describe('createInvertAdjustment', () => {
|
|
5
5
|
it('defaults to a full invert and carries the fusable kind', () => {
|
|
@@ -7,19 +7,19 @@ describe('createInvertAdjustment', () => {
|
|
|
7
7
|
expect(adjustment.kind).toBe('InvertAdjustment');
|
|
8
8
|
expect(adjustment.colorMatrix).toHaveLength(20);
|
|
9
9
|
// Opaque mid-grey inverts to itself; pure red inverts to cyan. Alpha is preserved.
|
|
10
|
-
expect(applyColorMatrixToColor(adjustment.colorMatrix
|
|
11
|
-
expect(applyColorMatrixToColor(adjustment.colorMatrix
|
|
10
|
+
expect(applyColorMatrixToColor(adjustment.colorMatrix, 0x808080ff)).toBe(0x7f7f7fff);
|
|
11
|
+
expect(applyColorMatrixToColor(adjustment.colorMatrix, 0xff0000ff)).toBe(0x00ffffff);
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it('intensity 0 is the identity', () => {
|
|
15
15
|
const adjustment = createInvertAdjustment({ intensity: 0 });
|
|
16
|
-
expect(applyColorMatrixToColor(adjustment.colorMatrix
|
|
16
|
+
expect(applyColorMatrixToColor(adjustment.colorMatrix, 0x123456ff)).toBe(0x123456ff);
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
it('intensity 0.5 collapses toward mid-grey', () => {
|
|
20
20
|
const adjustment = createInvertAdjustment({ intensity: 0.5 });
|
|
21
21
|
// scale 0, offset 127.5 → every channel rounds to 128.
|
|
22
|
-
expect(applyColorMatrixToColor(adjustment.colorMatrix
|
|
22
|
+
expect(applyColorMatrixToColor(adjustment.colorMatrix, 0x00ffccff)).toBe(0x808080ff);
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
describe('initializeInvertAdjustment', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLiftGammaGainAdjustment, initializeLiftGammaGainAdjustment } from './liftGammaGainAdjustment';
|
|
1
|
+
import { createLiftGammaGainAdjustment, initializeLiftGammaGainAdjustment } from './liftGammaGainAdjustment.ts';
|
|
2
2
|
|
|
3
3
|
describe('createLiftGammaGainAdjustment', () => {
|
|
4
4
|
it('defaults to approximately neutral', () => {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { bakeColorLut } from './colorLut';
|
|
2
|
-
import {
|
|
1
|
+
import { bakeColorLut } from './colorLut.ts';
|
|
2
|
+
import {
|
|
3
|
+
createLookupTableGradeAdjustment,
|
|
4
|
+
initializeLookupTableGradeAdjustment,
|
|
5
|
+
} from './lookupTableGradeAdjustment.ts';
|
|
3
6
|
|
|
4
7
|
describe('createLookupTableGradeAdjustment', () => {
|
|
5
8
|
it('is a neutral passthrough with no supplied LUT', () => {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
2
|
-
import { createSepiaAdjustment, initializeSepiaAdjustment } from './sepiaAdjustment';
|
|
1
|
+
import { applyColorMatrixToColor } from './colorMatrixMath.ts';
|
|
2
|
+
import { createSepiaAdjustment, initializeSepiaAdjustment } from './sepiaAdjustment.ts';
|
|
3
3
|
|
|
4
4
|
describe('createSepiaAdjustment', () => {
|
|
5
5
|
it('defaults to a full sepia tone', () => {
|
|
6
6
|
const adjustment = createSepiaAdjustment();
|
|
7
7
|
expect(adjustment.kind).toBe('SepiaAdjustment');
|
|
8
8
|
// White stays warm-white; red maps to the sepia red row (0.393·255 ≈ 100). Alpha preserved.
|
|
9
|
-
const red = applyColorMatrixToColor(adjustment.colorMatrix
|
|
9
|
+
const red = applyColorMatrixToColor(adjustment.colorMatrix, 0xff0000ff);
|
|
10
10
|
expect((red >>> 24) & 0xff).toBe(Math.round(0.393 * 255));
|
|
11
11
|
expect(red & 0xff).toBe(0xff);
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it('intensity 0 leaves color unchanged', () => {
|
|
15
15
|
const adjustment = createSepiaAdjustment({ intensity: 0 });
|
|
16
|
-
expect(applyColorMatrixToColor(adjustment.colorMatrix
|
|
16
|
+
expect(applyColorMatrixToColor(adjustment.colorMatrix, 0x3366ccff)).toBe(0x3366ccff);
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
describe('initializeSepiaAdjustment', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
|
|
3
|
-
import { applyColorMatrixToColor } from './colorMatrixMath';
|
|
4
|
-
import { createTintAdjustment, initializeTintAdjustment } from './tintAdjustment';
|
|
3
|
+
import { applyColorMatrixToColor } from './colorMatrixMath.ts';
|
|
4
|
+
import { createTintAdjustment, initializeTintAdjustment } from './tintAdjustment.ts';
|
|
5
5
|
|
|
6
6
|
describe('createTintAdjustment', () => {
|
|
7
7
|
it('carries the TintAdjustment kind and a 20-length diagonal matrix', () => {
|