@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.
- package/dist/bevelEffect.d.ts +3 -0
- package/dist/bevelEffect.d.ts.map +1 -0
- package/dist/bevelEffect.js +5 -0
- package/dist/bevelEffect.js.map +1 -0
- package/dist/blurDownsample.d.ts +17 -0
- package/dist/blurDownsample.d.ts.map +1 -0
- package/dist/blurDownsample.js +35 -0
- package/dist/blurDownsample.js.map +1 -0
- package/dist/blurEffect.d.ts +3 -0
- package/dist/blurEffect.d.ts.map +1 -0
- package/dist/blurEffect.js +7 -0
- package/dist/blurEffect.js.map +1 -0
- package/dist/boxBlurMath.d.ts +27 -0
- package/dist/boxBlurMath.d.ts.map +1 -0
- package/dist/boxBlurMath.js +64 -0
- package/dist/boxBlurMath.js.map +1 -0
- package/dist/convolutionEffect.d.ts +3 -0
- package/dist/convolutionEffect.d.ts.map +1 -0
- package/dist/convolutionEffect.js +4 -0
- package/dist/convolutionEffect.js.map +1 -0
- package/dist/dropShadowEffect.d.ts +3 -0
- package/dist/dropShadowEffect.d.ts.map +1 -0
- package/dist/dropShadowEffect.js +5 -0
- package/dist/dropShadowEffect.js.map +1 -0
- package/dist/gaussianKernel.d.ts +17 -0
- package/dist/gaussianKernel.d.ts.map +1 -0
- package/dist/gaussianKernel.js +49 -0
- package/dist/gaussianKernel.js.map +1 -0
- package/dist/gradientBevelEffect.d.ts +3 -0
- package/dist/gradientBevelEffect.d.ts.map +1 -0
- package/dist/gradientBevelEffect.js +5 -0
- package/dist/gradientBevelEffect.js.map +1 -0
- package/dist/gradientGlowEffect.d.ts +3 -0
- package/dist/gradientGlowEffect.d.ts.map +1 -0
- package/dist/gradientGlowEffect.js +5 -0
- package/dist/gradientGlowEffect.js.map +1 -0
- package/dist/index.d.ts +14 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/dist/innerGlowEffect.d.ts +3 -0
- package/dist/innerGlowEffect.d.ts.map +1 -0
- package/dist/innerGlowEffect.js +5 -0
- package/dist/innerGlowEffect.js.map +1 -0
- package/dist/innerShadowEffect.d.ts +3 -0
- package/dist/innerShadowEffect.d.ts.map +1 -0
- package/dist/innerShadowEffect.js +5 -0
- package/dist/innerShadowEffect.js.map +1 -0
- package/dist/linearSampledGaussian.d.ts +22 -0
- package/dist/linearSampledGaussian.d.ts.map +1 -0
- package/dist/linearSampledGaussian.js +56 -0
- package/dist/linearSampledGaussian.js.map +1 -0
- package/dist/medianEffect.d.ts +3 -0
- package/dist/medianEffect.d.ts.map +1 -0
- package/dist/medianEffect.js +4 -0
- package/dist/medianEffect.js.map +1 -0
- package/dist/outerGlowEffect.d.ts +3 -0
- package/dist/outerGlowEffect.d.ts.map +1 -0
- package/dist/outerGlowEffect.js +5 -0
- package/dist/outerGlowEffect.js.map +1 -0
- package/dist/renderEffectDefaults.js +22 -20
- package/dist/renderEffectDefaults.js.map +1 -1
- package/dist/renderEffectInputs.d.ts.map +1 -1
- package/dist/renderEffectInputs.js +10 -11
- package/dist/renderEffectInputs.js.map +1 -1
- package/package.json +7 -2
- package/src/bevelEffect.test.ts +11 -0
- package/src/blurDownsample.test.ts +46 -0
- package/src/blurEffect.test.ts +17 -0
- package/src/boxBlurMath.test.ts +96 -0
- package/src/convolutionEffect.test.ts +20 -0
- package/src/dropShadowEffect.test.ts +11 -0
- package/src/gaussianKernel.test.ts +80 -0
- package/src/gradientBevelEffect.test.ts +15 -0
- package/src/gradientGlowEffect.test.ts +15 -0
- package/src/innerGlowEffect.test.ts +11 -0
- package/src/innerShadowEffect.test.ts +11 -0
- package/src/linearSampledGaussian.test.ts +87 -0
- package/src/medianEffect.test.ts +11 -0
- package/src/outerGlowEffect.test.ts +11 -0
- package/src/renderEffectDefaults.test.ts +4 -5
- package/src/renderEffectInputs.test.ts +3 -5
- package/src/renderEffectInterpolation.test.ts +6 -9
- package/src/renderEffectValidation.test.ts +2 -2
- package/dist/brightnessContrastEffect.d.ts +0 -3
- package/dist/brightnessContrastEffect.d.ts.map +0 -1
- package/dist/brightnessContrastEffect.js +0 -4
- package/dist/brightnessContrastEffect.js.map +0 -1
- package/dist/channelMixerEffect.d.ts +0 -3
- package/dist/channelMixerEffect.d.ts.map +0 -1
- package/dist/channelMixerEffect.js +0 -4
- package/dist/channelMixerEffect.js.map +0 -1
- package/dist/colorBlindSimulationEffect.d.ts +0 -3
- package/dist/colorBlindSimulationEffect.d.ts.map +0 -1
- package/dist/colorBlindSimulationEffect.js +0 -4
- package/dist/colorBlindSimulationEffect.js.map +0 -1
- package/dist/colorGradeEffect.d.ts +0 -3
- package/dist/colorGradeEffect.d.ts.map +0 -1
- package/dist/colorGradeEffect.js +0 -4
- package/dist/colorGradeEffect.js.map +0 -1
- package/dist/exposureEffect.d.ts +0 -3
- package/dist/exposureEffect.d.ts.map +0 -1
- package/dist/exposureEffect.js +0 -4
- package/dist/exposureEffect.js.map +0 -1
- package/dist/grayscaleEffect.d.ts +0 -3
- package/dist/grayscaleEffect.d.ts.map +0 -1
- package/dist/grayscaleEffect.js +0 -4
- package/dist/grayscaleEffect.js.map +0 -1
- package/dist/hueSaturationEffect.d.ts +0 -3
- package/dist/hueSaturationEffect.d.ts.map +0 -1
- package/dist/hueSaturationEffect.js +0 -4
- package/dist/hueSaturationEffect.js.map +0 -1
- package/dist/invertEffect.d.ts +0 -3
- package/dist/invertEffect.d.ts.map +0 -1
- package/dist/invertEffect.js +0 -4
- package/dist/invertEffect.js.map +0 -1
- package/dist/liftGammaGainEffect.d.ts +0 -3
- package/dist/liftGammaGainEffect.d.ts.map +0 -1
- package/dist/liftGammaGainEffect.js +0 -4
- package/dist/liftGammaGainEffect.js.map +0 -1
- package/dist/lookupTableGradeEffect.d.ts +0 -3
- package/dist/lookupTableGradeEffect.d.ts.map +0 -1
- package/dist/lookupTableGradeEffect.js +0 -4
- package/dist/lookupTableGradeEffect.js.map +0 -1
- package/dist/lutMath.d.ts +0 -7
- package/dist/lutMath.d.ts.map +0 -1
- package/dist/lutMath.js +0 -39
- package/dist/lutMath.js.map +0 -1
- package/dist/sepiaEffect.d.ts +0 -3
- package/dist/sepiaEffect.d.ts.map +0 -1
- package/dist/sepiaEffect.js +0 -4
- package/dist/sepiaEffect.js.map +0 -1
- package/src/brightnessContrastEffect.test.ts +0 -14
- package/src/channelMixerEffect.test.ts +0 -12
- package/src/colorBlindSimulationEffect.test.ts +0 -13
- package/src/colorGradeEffect.test.ts +0 -11
- package/src/exposureEffect.test.ts +0 -7
- package/src/grayscaleEffect.test.ts +0 -11
- package/src/hueSaturationEffect.test.ts +0 -15
- package/src/invertEffect.test.ts +0 -11
- package/src/liftGammaGainEffect.test.ts +0 -15
- package/src/lookupTableGradeEffect.test.ts +0 -11
- package/src/lutMath.test.ts +0 -67
- 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
|
-
});
|
package/src/lutMath.test.ts
DELETED
|
@@ -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
|
-
});
|
package/src/sepiaEffect.test.ts
DELETED
|
@@ -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
|
-
});
|