@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.
Files changed (118) hide show
  1. package/README.md +2 -2
  2. package/dist/.tsbuildinfo.contract +1 -0
  3. package/dist/.tsbuildinfo.runtime +1 -0
  4. package/dist/adjustment.d.ts +2 -1
  5. package/dist/adjustment.d.ts.map +1 -1
  6. package/dist/adjustment.js.map +1 -1
  7. package/dist/brightnessContrastAdjustment.d.ts +2 -1
  8. package/dist/brightnessContrastAdjustment.d.ts.map +1 -1
  9. package/dist/brightnessContrastAdjustment.js +6 -6
  10. package/dist/brightnessContrastAdjustment.js.map +1 -1
  11. package/dist/channelMixerAdjustment.d.ts +2 -1
  12. package/dist/channelMixerAdjustment.d.ts.map +1 -1
  13. package/dist/channelMixerAdjustment.js +4 -4
  14. package/dist/channelMixerAdjustment.js.map +1 -1
  15. package/dist/colorAdjustmentResolution.d.ts +3 -3
  16. package/dist/colorAdjustmentResolution.d.ts.map +1 -1
  17. package/dist/colorAdjustmentResolution.js +2 -2
  18. package/dist/colorAdjustmentResolution.js.map +1 -1
  19. package/dist/colorBlindSimulationAdjustment.d.ts +2 -1
  20. package/dist/colorBlindSimulationAdjustment.d.ts.map +1 -1
  21. package/dist/colorBlindSimulationAdjustment.js +5 -5
  22. package/dist/colorBlindSimulationAdjustment.js.map +1 -1
  23. package/dist/colorGradeAdjustment.d.ts +2 -1
  24. package/dist/colorGradeAdjustment.d.ts.map +1 -1
  25. package/dist/colorGradeAdjustment.js +3 -3
  26. package/dist/colorGradeAdjustment.js.map +1 -1
  27. package/dist/colorLut.d.ts +1 -1
  28. package/dist/colorLut.d.ts.map +1 -1
  29. package/dist/colorLut.js.map +1 -1
  30. package/dist/colorLutAdjustment.d.ts +2 -1
  31. package/dist/colorLutAdjustment.d.ts.map +1 -1
  32. package/dist/colorLutAdjustment.js +3 -3
  33. package/dist/colorLutAdjustment.js.map +1 -1
  34. package/dist/colorLutCache.d.ts +2 -1
  35. package/dist/colorLutCache.d.ts.map +1 -1
  36. package/dist/colorLutCache.js +4 -4
  37. package/dist/colorLutCache.js.map +1 -1
  38. package/dist/colorMatrixAdjustment.d.ts +5 -4
  39. package/dist/colorMatrixAdjustment.d.ts.map +1 -1
  40. package/dist/colorMatrixAdjustment.js +7 -7
  41. package/dist/colorMatrixAdjustment.js.map +1 -1
  42. package/dist/colorMatrixMath.d.ts +23 -24
  43. package/dist/colorMatrixMath.d.ts.map +1 -1
  44. package/dist/colorMatrixMath.js +58 -61
  45. package/dist/colorMatrixMath.js.map +1 -1
  46. package/dist/colorScaleBiasAdjustment.d.ts +2 -1
  47. package/dist/colorScaleBiasAdjustment.d.ts.map +1 -1
  48. package/dist/colorScaleBiasAdjustment.js +5 -5
  49. package/dist/colorScaleBiasAdjustment.js.map +1 -1
  50. package/dist/contract.adjustments-types.d.ts +2 -0
  51. package/dist/contract.adjustments-types.d.ts.map +1 -0
  52. package/dist/contract.adjustments-types.js +2 -0
  53. package/dist/contract.adjustments-types.js.map +1 -0
  54. package/dist/contract.d.ts +21 -34
  55. package/dist/contract.d.ts.map +1 -1
  56. package/dist/contract.js +20 -34
  57. package/dist/contract.js.map +1 -1
  58. package/dist/exposureAdjustment.d.ts +2 -1
  59. package/dist/exposureAdjustment.d.ts.map +1 -1
  60. package/dist/exposureAdjustment.js +5 -5
  61. package/dist/exposureAdjustment.js.map +1 -1
  62. package/dist/grayscaleAdjustment.d.ts +2 -1
  63. package/dist/grayscaleAdjustment.d.ts.map +1 -1
  64. package/dist/grayscaleAdjustment.js +5 -5
  65. package/dist/grayscaleAdjustment.js.map +1 -1
  66. package/dist/hueSaturationAdjustment.d.ts +2 -1
  67. package/dist/hueSaturationAdjustment.d.ts.map +1 -1
  68. package/dist/hueSaturationAdjustment.js +3 -3
  69. package/dist/hueSaturationAdjustment.js.map +1 -1
  70. package/dist/index.d.ts +19 -1
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +19 -1
  73. package/dist/index.js.map +1 -1
  74. package/dist/invertAdjustment.d.ts +2 -1
  75. package/dist/invertAdjustment.d.ts.map +1 -1
  76. package/dist/invertAdjustment.js +5 -5
  77. package/dist/invertAdjustment.js.map +1 -1
  78. package/dist/liftGammaGainAdjustment.d.ts +2 -1
  79. package/dist/liftGammaGainAdjustment.d.ts.map +1 -1
  80. package/dist/liftGammaGainAdjustment.js +3 -3
  81. package/dist/liftGammaGainAdjustment.js.map +1 -1
  82. package/dist/lookupTableGradeAdjustment.d.ts +2 -1
  83. package/dist/lookupTableGradeAdjustment.d.ts.map +1 -1
  84. package/dist/lookupTableGradeAdjustment.js +4 -4
  85. package/dist/lookupTableGradeAdjustment.js.map +1 -1
  86. package/dist/sepiaAdjustment.d.ts +2 -1
  87. package/dist/sepiaAdjustment.d.ts.map +1 -1
  88. package/dist/sepiaAdjustment.js +5 -5
  89. package/dist/sepiaAdjustment.js.map +1 -1
  90. package/dist/tintAdjustment.d.ts +2 -1
  91. package/dist/tintAdjustment.d.ts.map +1 -1
  92. package/dist/tintAdjustment.js +5 -5
  93. package/dist/tintAdjustment.js.map +1 -1
  94. package/dist/types.d.ts +119 -0
  95. package/dist/types.d.ts.map +1 -0
  96. package/dist/types.js +2 -0
  97. package/dist/types.js.map +1 -0
  98. package/package.json +5 -4
  99. package/src/adjustment.test.ts +1 -1
  100. package/src/brightnessContrastAdjustment.test.ts +6 -6
  101. package/src/channelMixerAdjustment.test.ts +5 -5
  102. package/src/colorAdjustmentResolution.test.ts +17 -11
  103. package/src/colorBlindSimulationAdjustment.test.ts +7 -7
  104. package/src/colorGradeAdjustment.test.ts +1 -1
  105. package/src/colorLut.test.ts +2 -3
  106. package/src/colorLutAdjustment.test.ts +7 -3
  107. package/src/colorLutCache.test.ts +5 -5
  108. package/src/colorMatrixAdjustment.test.ts +3 -3
  109. package/src/colorMatrixMath.test.ts +20 -12
  110. package/src/colorScaleBiasAdjustment.test.ts +1 -1
  111. package/src/exposureAdjustment.test.ts +5 -5
  112. package/src/grayscaleAdjustment.test.ts +4 -4
  113. package/src/hueSaturationAdjustment.test.ts +1 -1
  114. package/src/invertAdjustment.test.ts +6 -6
  115. package/src/liftGammaGainAdjustment.test.ts +1 -1
  116. package/src/lookupTableGradeAdjustment.test.ts +5 -2
  117. package/src/sepiaAdjustment.test.ts +4 -4
  118. 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 as number[], 0x808080ff)).toBe(0x7f7f7fff);
11
- expect(applyColorMatrixToColor(adjustment.colorMatrix as number[], 0xff0000ff)).toBe(0x00ffffff);
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 as number[], 0x123456ff)).toBe(0x123456ff);
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 as number[], 0x00ffccff)).toBe(0x808080ff);
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 { createLookupTableGradeAdjustment, initializeLookupTableGradeAdjustment } from './lookupTableGradeAdjustment';
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 as number[], 0xff0000ff);
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 as number[], 0x3366ccff)).toBe(0x3366ccff);
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', () => {