@flighthq/effects 0.1.0 → 0.2.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 (144) hide show
  1. package/dist/bevelEffect.d.ts +3 -0
  2. package/dist/bevelEffect.d.ts.map +1 -0
  3. package/dist/bevelEffect.js +5 -0
  4. package/dist/bevelEffect.js.map +1 -0
  5. package/dist/blurDownsample.d.ts +17 -0
  6. package/dist/blurDownsample.d.ts.map +1 -0
  7. package/dist/blurDownsample.js +35 -0
  8. package/dist/blurDownsample.js.map +1 -0
  9. package/dist/blurEffect.d.ts +3 -0
  10. package/dist/blurEffect.d.ts.map +1 -0
  11. package/dist/blurEffect.js +7 -0
  12. package/dist/blurEffect.js.map +1 -0
  13. package/dist/boxBlurMath.d.ts +27 -0
  14. package/dist/boxBlurMath.d.ts.map +1 -0
  15. package/dist/boxBlurMath.js +64 -0
  16. package/dist/boxBlurMath.js.map +1 -0
  17. package/dist/convolutionEffect.d.ts +3 -0
  18. package/dist/convolutionEffect.d.ts.map +1 -0
  19. package/dist/convolutionEffect.js +4 -0
  20. package/dist/convolutionEffect.js.map +1 -0
  21. package/dist/dropShadowEffect.d.ts +3 -0
  22. package/dist/dropShadowEffect.d.ts.map +1 -0
  23. package/dist/dropShadowEffect.js +5 -0
  24. package/dist/dropShadowEffect.js.map +1 -0
  25. package/dist/gaussianKernel.d.ts +17 -0
  26. package/dist/gaussianKernel.d.ts.map +1 -0
  27. package/dist/gaussianKernel.js +49 -0
  28. package/dist/gaussianKernel.js.map +1 -0
  29. package/dist/gradientBevelEffect.d.ts +3 -0
  30. package/dist/gradientBevelEffect.d.ts.map +1 -0
  31. package/dist/gradientBevelEffect.js +5 -0
  32. package/dist/gradientBevelEffect.js.map +1 -0
  33. package/dist/gradientGlowEffect.d.ts +3 -0
  34. package/dist/gradientGlowEffect.d.ts.map +1 -0
  35. package/dist/gradientGlowEffect.js +5 -0
  36. package/dist/gradientGlowEffect.js.map +1 -0
  37. package/dist/index.d.ts +14 -12
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +14 -12
  40. package/dist/index.js.map +1 -1
  41. package/dist/innerGlowEffect.d.ts +3 -0
  42. package/dist/innerGlowEffect.d.ts.map +1 -0
  43. package/dist/innerGlowEffect.js +5 -0
  44. package/dist/innerGlowEffect.js.map +1 -0
  45. package/dist/innerShadowEffect.d.ts +3 -0
  46. package/dist/innerShadowEffect.d.ts.map +1 -0
  47. package/dist/innerShadowEffect.js +5 -0
  48. package/dist/innerShadowEffect.js.map +1 -0
  49. package/dist/linearSampledGaussian.d.ts +22 -0
  50. package/dist/linearSampledGaussian.d.ts.map +1 -0
  51. package/dist/linearSampledGaussian.js +56 -0
  52. package/dist/linearSampledGaussian.js.map +1 -0
  53. package/dist/medianEffect.d.ts +3 -0
  54. package/dist/medianEffect.d.ts.map +1 -0
  55. package/dist/medianEffect.js +4 -0
  56. package/dist/medianEffect.js.map +1 -0
  57. package/dist/outerGlowEffect.d.ts +3 -0
  58. package/dist/outerGlowEffect.d.ts.map +1 -0
  59. package/dist/outerGlowEffect.js +5 -0
  60. package/dist/outerGlowEffect.js.map +1 -0
  61. package/dist/renderEffectDefaults.js +22 -20
  62. package/dist/renderEffectDefaults.js.map +1 -1
  63. package/dist/renderEffectInputs.d.ts.map +1 -1
  64. package/dist/renderEffectInputs.js +10 -11
  65. package/dist/renderEffectInputs.js.map +1 -1
  66. package/package.json +7 -2
  67. package/src/bevelEffect.test.ts +11 -0
  68. package/src/blurDownsample.test.ts +46 -0
  69. package/src/blurEffect.test.ts +17 -0
  70. package/src/boxBlurMath.test.ts +96 -0
  71. package/src/convolutionEffect.test.ts +20 -0
  72. package/src/dropShadowEffect.test.ts +11 -0
  73. package/src/gaussianKernel.test.ts +80 -0
  74. package/src/gradientBevelEffect.test.ts +15 -0
  75. package/src/gradientGlowEffect.test.ts +15 -0
  76. package/src/innerGlowEffect.test.ts +11 -0
  77. package/src/innerShadowEffect.test.ts +11 -0
  78. package/src/linearSampledGaussian.test.ts +87 -0
  79. package/src/medianEffect.test.ts +11 -0
  80. package/src/outerGlowEffect.test.ts +11 -0
  81. package/src/renderEffectDefaults.test.ts +4 -5
  82. package/src/renderEffectInputs.test.ts +3 -5
  83. package/src/renderEffectInterpolation.test.ts +6 -9
  84. package/src/renderEffectValidation.test.ts +2 -2
  85. package/dist/brightnessContrastEffect.d.ts +0 -3
  86. package/dist/brightnessContrastEffect.d.ts.map +0 -1
  87. package/dist/brightnessContrastEffect.js +0 -4
  88. package/dist/brightnessContrastEffect.js.map +0 -1
  89. package/dist/channelMixerEffect.d.ts +0 -3
  90. package/dist/channelMixerEffect.d.ts.map +0 -1
  91. package/dist/channelMixerEffect.js +0 -4
  92. package/dist/channelMixerEffect.js.map +0 -1
  93. package/dist/colorBlindSimulationEffect.d.ts +0 -3
  94. package/dist/colorBlindSimulationEffect.d.ts.map +0 -1
  95. package/dist/colorBlindSimulationEffect.js +0 -4
  96. package/dist/colorBlindSimulationEffect.js.map +0 -1
  97. package/dist/colorGradeEffect.d.ts +0 -3
  98. package/dist/colorGradeEffect.d.ts.map +0 -1
  99. package/dist/colorGradeEffect.js +0 -4
  100. package/dist/colorGradeEffect.js.map +0 -1
  101. package/dist/exposureEffect.d.ts +0 -3
  102. package/dist/exposureEffect.d.ts.map +0 -1
  103. package/dist/exposureEffect.js +0 -4
  104. package/dist/exposureEffect.js.map +0 -1
  105. package/dist/grayscaleEffect.d.ts +0 -3
  106. package/dist/grayscaleEffect.d.ts.map +0 -1
  107. package/dist/grayscaleEffect.js +0 -4
  108. package/dist/grayscaleEffect.js.map +0 -1
  109. package/dist/hueSaturationEffect.d.ts +0 -3
  110. package/dist/hueSaturationEffect.d.ts.map +0 -1
  111. package/dist/hueSaturationEffect.js +0 -4
  112. package/dist/hueSaturationEffect.js.map +0 -1
  113. package/dist/invertEffect.d.ts +0 -3
  114. package/dist/invertEffect.d.ts.map +0 -1
  115. package/dist/invertEffect.js +0 -4
  116. package/dist/invertEffect.js.map +0 -1
  117. package/dist/liftGammaGainEffect.d.ts +0 -3
  118. package/dist/liftGammaGainEffect.d.ts.map +0 -1
  119. package/dist/liftGammaGainEffect.js +0 -4
  120. package/dist/liftGammaGainEffect.js.map +0 -1
  121. package/dist/lookupTableGradeEffect.d.ts +0 -3
  122. package/dist/lookupTableGradeEffect.d.ts.map +0 -1
  123. package/dist/lookupTableGradeEffect.js +0 -4
  124. package/dist/lookupTableGradeEffect.js.map +0 -1
  125. package/dist/lutMath.d.ts +0 -7
  126. package/dist/lutMath.d.ts.map +0 -1
  127. package/dist/lutMath.js +0 -39
  128. package/dist/lutMath.js.map +0 -1
  129. package/dist/sepiaEffect.d.ts +0 -3
  130. package/dist/sepiaEffect.d.ts.map +0 -1
  131. package/dist/sepiaEffect.js +0 -4
  132. package/dist/sepiaEffect.js.map +0 -1
  133. package/src/brightnessContrastEffect.test.ts +0 -14
  134. package/src/channelMixerEffect.test.ts +0 -12
  135. package/src/colorBlindSimulationEffect.test.ts +0 -13
  136. package/src/colorGradeEffect.test.ts +0 -11
  137. package/src/exposureEffect.test.ts +0 -7
  138. package/src/grayscaleEffect.test.ts +0 -11
  139. package/src/hueSaturationEffect.test.ts +0 -15
  140. package/src/invertEffect.test.ts +0 -11
  141. package/src/liftGammaGainEffect.test.ts +0 -15
  142. package/src/lookupTableGradeEffect.test.ts +0 -11
  143. package/src/lutMath.test.ts +0 -67
  144. package/src/sepiaEffect.test.ts +0 -11
@@ -1,15 +0,0 @@
1
- import { createLiftGammaGainEffect } from './liftGammaGainEffect';
2
-
3
- describe('createLiftGammaGainEffect', () => {
4
- it('tags the intent type', () => {
5
- expect(createLiftGammaGainEffect().kind).toBe('LiftGammaGainEffect');
6
- });
7
-
8
- it('carries options', () => {
9
- expect(createLiftGammaGainEffect({ lift: 0x808080ff, gamma: 0x808080ff, gain: 0x808080ff })).toMatchObject({
10
- lift: 0x808080ff,
11
- gamma: 0x808080ff,
12
- gain: 0x808080ff,
13
- });
14
- });
15
- });
@@ -1,11 +0,0 @@
1
- import { createLookupTableGradeEffect } from './lookupTableGradeEffect';
2
-
3
- describe('createLookupTableGradeEffect', () => {
4
- it('tags the intent type', () => {
5
- expect(createLookupTableGradeEffect().kind).toBe('LookupTableGradeEffect');
6
- });
7
-
8
- it('carries options', () => {
9
- expect(createLookupTableGradeEffect({ size: 32, strength: 0.8 })).toMatchObject({ size: 32, strength: 0.8 });
10
- });
11
- });
@@ -1,67 +0,0 @@
1
- import { computeLookupTableCoord, getLookupTableTileLayout } from './lutMath';
2
-
3
- describe('computeLookupTableCoord', () => {
4
- it('writes two values into out', () => {
5
- const out: [number, number] = [0, 0];
6
- computeLookupTableCoord(0.5, 0.5, 0.5, 16, out);
7
- expect(typeof out[0]).toBe('number');
8
- expect(typeof out[1]).toBe('number');
9
- });
10
- it('black (0,0,0) maps to near (0, 0)', () => {
11
- const out: [number, number] = [0, 0];
12
- computeLookupTableCoord(0, 0, 0, 16, out);
13
- expect(out[0]).toBeGreaterThanOrEqual(0);
14
- expect(out[1]).toBeGreaterThanOrEqual(0);
15
- });
16
- it('U and V are in [0, 1] range for valid input', () => {
17
- const out: [number, number] = [0, 0];
18
- computeLookupTableCoord(0.5, 0.5, 0.5, 16, out);
19
- expect(out[0]).toBeGreaterThanOrEqual(0);
20
- expect(out[0]).toBeLessThanOrEqual(1);
21
- expect(out[1]).toBeGreaterThanOrEqual(0);
22
- expect(out[1]).toBeLessThanOrEqual(1);
23
- });
24
- it('high G shifts V up', () => {
25
- const outLow: [number, number] = [0, 0];
26
- const outHigh: [number, number] = [0, 0];
27
- computeLookupTableCoord(0.5, 0.1, 0.5, 16, outLow);
28
- computeLookupTableCoord(0.5, 0.9, 0.5, 16, outHigh);
29
- expect(outHigh[1]).toBeGreaterThan(outLow[1]);
30
- });
31
- it('high B shifts U right', () => {
32
- const outLow: [number, number] = [0, 0];
33
- const outHigh: [number, number] = [0, 0];
34
- computeLookupTableCoord(0.5, 0.5, 0.1, 16, outLow);
35
- computeLookupTableCoord(0.5, 0.5, 0.9, 16, outHigh);
36
- expect(outHigh[0]).toBeGreaterThan(outLow[0]);
37
- });
38
- it('clamps out-of-range input', () => {
39
- const out1: [number, number] = [0, 0];
40
- const out2: [number, number] = [0, 0];
41
- computeLookupTableCoord(0, 0, 0, 16, out1);
42
- computeLookupTableCoord(-0.5, -0.5, -0.5, 16, out2);
43
- expect(out1[0]).toBeCloseTo(out2[0], 5);
44
- expect(out1[1]).toBeCloseTo(out2[1], 5);
45
- });
46
- });
47
-
48
- describe('getLookupTableTileLayout', () => {
49
- it('returns [size², size] for a given LUT size', () => {
50
- const out: [number, number] = [0, 0];
51
- getLookupTableTileLayout(16, out);
52
- expect(out[0]).toBe(256); // 16 * 16
53
- expect(out[1]).toBe(16);
54
- });
55
- it('works for size 32', () => {
56
- const out: [number, number] = [0, 0];
57
- getLookupTableTileLayout(32, out);
58
- expect(out[0]).toBe(1024);
59
- expect(out[1]).toBe(32);
60
- });
61
- it('handles size 1 without dividing by zero', () => {
62
- const out: [number, number] = [0, 0];
63
- getLookupTableTileLayout(1, out);
64
- expect(out[0]).toBe(1);
65
- expect(out[1]).toBe(1);
66
- });
67
- });
@@ -1,11 +0,0 @@
1
- import { createSepiaEffect } from './sepiaEffect';
2
-
3
- describe('createSepiaEffect', () => {
4
- it('tags the intent type', () => {
5
- expect(createSepiaEffect().kind).toBe('SepiaEffect');
6
- });
7
-
8
- it('carries options', () => {
9
- expect(createSepiaEffect({ intensity: 0.6 })).toMatchObject({ intensity: 0.6 });
10
- });
11
- });