@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bevelEffect.d.ts","sourceRoot":"","sources":["../src/bevelEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAM,GAAG,WAAW,CAEhG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Bevel composite effect: the directional gradient of the blurred silhouette drives a highlight/shadow edge band, clipped by bevelType and composited over the source.
|
|
2
|
+
export function createBevelEffect(options = {}) {
|
|
3
|
+
return { kind: 'BevelEffect', ...options };
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=bevelEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bevelEffect.js","sourceRoot":"","sources":["../src/bevelEffect.ts"],"names":[],"mappings":"AAEA,uKAAuK;AACvK,MAAM,UAAU,iBAAiB,CAAC,UAA+C,EAAE;IACjF,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the power-of-two downsample level to apply before blurring with standard deviation
|
|
3
|
+
* `sigma`, following Skia's scale-then-blur strategy: large blurs are cheaper if the source is first
|
|
4
|
+
* halved in each dimension `level` times and blurred with a proportionally smaller residual sigma.
|
|
5
|
+
* The level is the smallest non-negative integer such that `sigma / 2^level` falls at or below
|
|
6
|
+
* `BLUR_DOWNSAMPLE_MAX_SIGMA`, i.e. `ceil(log2(sigma / max))` clamped to `>= 0`. Blurs at or below
|
|
7
|
+
* that threshold run at full resolution (level 0). `sigma <= 0` returns 0.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getBlurDownsampleLevel(sigma: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the residual standard deviation to blur with after downsampling by `level` power-of-two
|
|
12
|
+
* steps: `sigma / 2^level`. Blurring a `2^level`-times-downsampled image with this residual sigma
|
|
13
|
+
* reproduces a full-resolution blur of `sigma`, because a blur at half resolution covers twice the
|
|
14
|
+
* distance in source space. `sigma <= 0` returns 0.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getBlurResidualSigma(sigma: number, level: number): number;
|
|
17
|
+
//# sourceMappingURL=blurDownsample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blurDownsample.d.ts","sourceRoot":"","sources":["../src/blurDownsample.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGzE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Scale-then-blur downsample selection for large blurs. Substrate-agnostic recipe math.
|
|
2
|
+
//
|
|
3
|
+
// Copied verbatim from filters-math during the filters→effects migration — effects is the
|
|
4
|
+
// canonical home for the spatial-effect blur math (effect-adjustment-architecture.md, migration
|
|
5
|
+
// step 4). filters-math keeps its copy until the filters* packages retire; the duplicate is
|
|
6
|
+
// deliberate for the duration (mirrors the Phase 1 colorMatrixMath port).
|
|
7
|
+
/**
|
|
8
|
+
* Returns the power-of-two downsample level to apply before blurring with standard deviation
|
|
9
|
+
* `sigma`, following Skia's scale-then-blur strategy: large blurs are cheaper if the source is first
|
|
10
|
+
* halved in each dimension `level` times and blurred with a proportionally smaller residual sigma.
|
|
11
|
+
* The level is the smallest non-negative integer such that `sigma / 2^level` falls at or below
|
|
12
|
+
* `BLUR_DOWNSAMPLE_MAX_SIGMA`, i.e. `ceil(log2(sigma / max))` clamped to `>= 0`. Blurs at or below
|
|
13
|
+
* that threshold run at full resolution (level 0). `sigma <= 0` returns 0.
|
|
14
|
+
*/
|
|
15
|
+
export function getBlurDownsampleLevel(sigma) {
|
|
16
|
+
if (sigma <= BLUR_DOWNSAMPLE_MAX_SIGMA)
|
|
17
|
+
return 0;
|
|
18
|
+
return Math.ceil(Math.log2(sigma / BLUR_DOWNSAMPLE_MAX_SIGMA));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns the residual standard deviation to blur with after downsampling by `level` power-of-two
|
|
22
|
+
* steps: `sigma / 2^level`. Blurring a `2^level`-times-downsampled image with this residual sigma
|
|
23
|
+
* reproduces a full-resolution blur of `sigma`, because a blur at half resolution covers twice the
|
|
24
|
+
* distance in source space. `sigma <= 0` returns 0.
|
|
25
|
+
*/
|
|
26
|
+
export function getBlurResidualSigma(sigma, level) {
|
|
27
|
+
if (sigma <= 0)
|
|
28
|
+
return 0;
|
|
29
|
+
return sigma / 2 ** level;
|
|
30
|
+
}
|
|
31
|
+
// The largest residual sigma a downsample level is allowed to leave. Matches Skia's GPU blur cap:
|
|
32
|
+
// beyond ~4 the box/Gaussian passes gain little accuracy per pixel touched, so halving resolution
|
|
33
|
+
// and blurring the smaller image is the better trade.
|
|
34
|
+
const BLUR_DOWNSAMPLE_MAX_SIGMA = 4;
|
|
35
|
+
//# sourceMappingURL=blurDownsample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blurDownsample.js","sourceRoot":"","sources":["../src/blurDownsample.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,EAAE;AACF,0FAA0F;AAC1F,gGAAgG;AAChG,4FAA4F;AAC5F,0EAA0E;AAE1E;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,IAAI,KAAK,IAAI,yBAAyB;QAAE,OAAO,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,yBAAyB,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAAE,KAAa;IAC/D,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACzB,OAAO,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC;AAC5B,CAAC;AAED,kGAAkG;AAClG,kGAAkG;AAClG,sDAAsD;AACtD,MAAM,yBAAyB,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blurEffect.d.ts","sourceRoot":"","sources":["../src/blurEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAKlD,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAM,GAAG,UAAU,CAE7F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Plain separable Gaussian blur intent. `blurX`/`blurY` are the per-axis Gaussian standard deviations
|
|
2
|
+
// in pixels; the backends realize them as a two-pass separable blur bouncing through an offscreen
|
|
3
|
+
// target. The spatial-effect sibling of the directional/radial/motion blur variants.
|
|
4
|
+
export function createBlurEffect(options = {}) {
|
|
5
|
+
return { kind: 'BlurEffect', ...options };
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=blurEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blurEffect.js","sourceRoot":"","sources":["../src/blurEffect.ts"],"names":[],"mappings":"AAEA,sGAAsG;AACtG,kGAAkG;AAClG,qFAAqF;AACrF,MAAM,UAAU,gBAAgB,CAAC,UAA8C,EAAE;IAC/E,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the box-blur radius for pass `pass` of `passes`, using two adjacent
|
|
3
|
+
* odd box widths so the combined variance tracks a Gaussian of standard
|
|
4
|
+
* deviation `sigma`. The lower passes use the smaller width and the remaining
|
|
5
|
+
* passes use the next odd width up; this avoids the overshoot that repeating a
|
|
6
|
+
* single rounded radius `passes` times accumulates. Radii are non-decreasing in
|
|
7
|
+
* `pass`. Use this for backends that can vary the radius per pass (such as the
|
|
8
|
+
* Gl separable passes); `computeBoxBlurRadius` covers backends that apply one
|
|
9
|
+
* uniform radius across every pass.
|
|
10
|
+
*/
|
|
11
|
+
export declare function computeBoxBlurPassRadius(sigma: number, passes: number, pass: number): number;
|
|
12
|
+
/**
|
|
13
|
+
* Converts sigma to the single box-blur radius whose repeated application
|
|
14
|
+
* (`passes` times) has the same variance as a Gaussian with standard deviation
|
|
15
|
+
* `sigma`. Use this for backends that apply one uniform radius across every
|
|
16
|
+
* pass; for backends that can vary the radius per pass, `computeBoxBlurPassRadius`
|
|
17
|
+
* tracks `sigma` more closely.
|
|
18
|
+
*/
|
|
19
|
+
export declare function computeBoxBlurRadius(sigma: number, passes: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Converts a box-blur radius to the approximate Gaussian sigma that a single-pass box blur of
|
|
22
|
+
* that radius corresponds to. Inverse of the `computeBoxBlurRadius` uniform-pass formula:
|
|
23
|
+
* sigma = sqrt(passes * (2*radius + 1)^2 / 12). Useful for the reverse mapping (e.g. to feed a
|
|
24
|
+
* sigma-based backend from a Flash `blurX` value).
|
|
25
|
+
*/
|
|
26
|
+
export declare function computeGaussianSigmaForBlurRadius(radius: number, passes: number): number;
|
|
27
|
+
//# sourceMappingURL=boxBlurMath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxBlurMath.d.ts","sourceRoot":"","sources":["../src/boxBlurMath.ts"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAM5F;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG1E;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAIxF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Box-blur radius/sigma recipe math. Substrate-agnostic: every backend derives identical box-blur
|
|
2
|
+
// pass radii from the same sigma so the GL, WGPU, and CPU spreads match.
|
|
3
|
+
//
|
|
4
|
+
// Copied verbatim from filters-math during the filters→effects migration — effects is the
|
|
5
|
+
// canonical home for the spatial-effect blur math (effect-adjustment-architecture.md, migration
|
|
6
|
+
// step 4). filters-math keeps its copy until the filters* packages retire; the duplicate is
|
|
7
|
+
// deliberate for the duration (mirrors the Phase 1 colorMatrixMath port).
|
|
8
|
+
/**
|
|
9
|
+
* Returns the box-blur radius for pass `pass` of `passes`, using two adjacent
|
|
10
|
+
* odd box widths so the combined variance tracks a Gaussian of standard
|
|
11
|
+
* deviation `sigma`. The lower passes use the smaller width and the remaining
|
|
12
|
+
* passes use the next odd width up; this avoids the overshoot that repeating a
|
|
13
|
+
* single rounded radius `passes` times accumulates. Radii are non-decreasing in
|
|
14
|
+
* `pass`. Use this for backends that can vary the radius per pass (such as the
|
|
15
|
+
* Gl separable passes); `computeBoxBlurRadius` covers backends that apply one
|
|
16
|
+
* uniform radius across every pass.
|
|
17
|
+
*/
|
|
18
|
+
export function computeBoxBlurPassRadius(sigma, passes, pass) {
|
|
19
|
+
if (sigma <= 0)
|
|
20
|
+
return 0;
|
|
21
|
+
const lowerWidth = computeBoxBlurLowerWidth(sigma, passes);
|
|
22
|
+
const lowerCount = computeBoxBlurLowerPassCount(sigma, passes, lowerWidth);
|
|
23
|
+
const width = pass < lowerCount ? lowerWidth : lowerWidth + 2;
|
|
24
|
+
return Math.max(0, (width - 1) / 2);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Converts sigma to the single box-blur radius whose repeated application
|
|
28
|
+
* (`passes` times) has the same variance as a Gaussian with standard deviation
|
|
29
|
+
* `sigma`. Use this for backends that apply one uniform radius across every
|
|
30
|
+
* pass; for backends that can vary the radius per pass, `computeBoxBlurPassRadius`
|
|
31
|
+
* tracks `sigma` more closely.
|
|
32
|
+
*/
|
|
33
|
+
export function computeBoxBlurRadius(sigma, passes) {
|
|
34
|
+
if (sigma <= 0)
|
|
35
|
+
return 0;
|
|
36
|
+
return Math.max(0, Math.round((-1 + Math.sqrt(1 + (12 * sigma * sigma) / passes)) / 2));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Converts a box-blur radius to the approximate Gaussian sigma that a single-pass box blur of
|
|
40
|
+
* that radius corresponds to. Inverse of the `computeBoxBlurRadius` uniform-pass formula:
|
|
41
|
+
* sigma = sqrt(passes * (2*radius + 1)^2 / 12). Useful for the reverse mapping (e.g. to feed a
|
|
42
|
+
* sigma-based backend from a Flash `blurX` value).
|
|
43
|
+
*/
|
|
44
|
+
export function computeGaussianSigmaForBlurRadius(radius, passes) {
|
|
45
|
+
if (radius <= 0 || passes <= 0)
|
|
46
|
+
return 0;
|
|
47
|
+
const width = 2 * radius + 1;
|
|
48
|
+
return Math.sqrt((passes * width * width) / 12);
|
|
49
|
+
}
|
|
50
|
+
// Largest odd box width whose `passes`-fold variance stays at or below a Gaussian
|
|
51
|
+
// of standard deviation `sigma`. Odd keeps the radius (width - 1) / 2 integral.
|
|
52
|
+
function computeBoxBlurLowerWidth(sigma, passes) {
|
|
53
|
+
let width = Math.floor(Math.sqrt((12 * sigma * sigma) / passes + 1));
|
|
54
|
+
if (width % 2 === 0)
|
|
55
|
+
width -= 1;
|
|
56
|
+
return width;
|
|
57
|
+
}
|
|
58
|
+
// Number of passes that use `lowerWidth`; the remaining passes use the next odd
|
|
59
|
+
// width up so the combined variance tracks sigma. Derived from
|
|
60
|
+
// m·(wl² - 1)/12 + (passes - m)·(wu² - 1)/12 = σ², with wu = wl + 2.
|
|
61
|
+
function computeBoxBlurLowerPassCount(sigma, passes, lowerWidth) {
|
|
62
|
+
return Math.round((12 * sigma * sigma - passes * (lowerWidth * lowerWidth + 4 * lowerWidth + 3)) / (-4 * lowerWidth - 4));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=boxBlurMath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxBlurMath.js","sourceRoot":"","sources":["../src/boxBlurMath.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,yEAAyE;AACzE,EAAE;AACF,0FAA0F;AAC1F,gGAAgG;AAChG,4FAA4F;AAC5F,0EAA0E;AAE1E;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa,EAAE,MAAc,EAAE,IAAY;IAClF,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACzB,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,UAAU,GA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,CAAC;QAAE,KAAK,IAAI,CAAC,CAAC;IAChC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,gFAAgF;AAChF,+DAA+D;AAC/D,qEAAqE;AACrE,SAAS,4BAA4B,CAAC,KAAa,EAAE,MAAc,EAAE,UAAkB;IACrF,OAAO,IAAI,CAAC,KAAK,CACf,CAAC,EAAE,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,CAAC,UAAU,GAAG,UAAU,GAAG,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CACvG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convolutionEffect.d.ts","sourceRoot":"","sources":["../src/convolutionEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,GAAG,iBAAiB,CAE7G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convolutionEffect.js","sourceRoot":"","sources":["../src/convolutionEffect.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,uBAAuB,CAAC,OAAkD;IACxF,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,OAAO,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropShadowEffect.d.ts","sourceRoot":"","sources":["../src/dropShadowEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAM,GAAG,gBAAgB,CAE/G"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Drop-shadow composite effect: tint the scene silhouette, blur it, offset it by angle/distance, then composite the source over the shadow.
|
|
2
|
+
export function createDropShadowEffect(options = {}) {
|
|
3
|
+
return { kind: 'DropShadowEffect', ...options };
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=dropShadowEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropShadowEffect.js","sourceRoot":"","sources":["../src/dropShadowEffect.ts"],"names":[],"mappings":"AAEA,4IAA4I;AAC5I,MAAM,UAAU,sBAAsB,CAAC,UAAoD,EAAE;IAC3F,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,OAAO,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fills `out` with the 1D discrete Gaussian kernel weights for standard deviation `sigma`,
|
|
3
|
+
* normalized so the emitted weights sum to exactly 1. The kernel is symmetric with `out.length`
|
|
4
|
+
* set to `getGaussianKernelSize(sigma)` (an odd length), the center entry the largest. Because the
|
|
5
|
+
* kernel is truncated at radius `ceil(3 * sigma)`, the raw Gaussian samples are renormalized by
|
|
6
|
+
* their own truncated sum rather than the analytic 1/(sqrt(2π)·sigma) factor, so the discrete tail
|
|
7
|
+
* loss is absorbed and the taps a separable blur applies sum to 1. `sigma <= 0` yields a single
|
|
8
|
+
* unit weight (`[1]`), the identity kernel. Returns `out`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function computeGaussianKernelWeights(sigma: number, out: number[]): number[];
|
|
11
|
+
/**
|
|
12
|
+
* Returns the length of the discrete Gaussian kernel for standard deviation `sigma`: the odd count
|
|
13
|
+
* `radius * 2 + 1` where `radius = ceil(3 * sigma)`. Three standard deviations capture ~99.7% of the
|
|
14
|
+
* Gaussian mass, the conventional truncation point. `sigma <= 0` returns 1 (the identity kernel).
|
|
15
|
+
*/
|
|
16
|
+
export declare function getGaussianKernelSize(sigma: number): number;
|
|
17
|
+
//# sourceMappingURL=gaussianKernel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianKernel.d.ts","sourceRoot":"","sources":["../src/gaussianKernel.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAqBnF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI3D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Discrete Gaussian kernel weights. Substrate-agnostic recipe math shared by the CPU/GPU blur passes.
|
|
2
|
+
//
|
|
3
|
+
// Copied verbatim from filters-math during the filters→effects migration — effects is the
|
|
4
|
+
// canonical home for the spatial-effect blur math (effect-adjustment-architecture.md, migration
|
|
5
|
+
// step 4). filters-math keeps its copy until the filters* packages retire; the duplicate is
|
|
6
|
+
// deliberate for the duration (mirrors the Phase 1 colorMatrixMath port).
|
|
7
|
+
/**
|
|
8
|
+
* Fills `out` with the 1D discrete Gaussian kernel weights for standard deviation `sigma`,
|
|
9
|
+
* normalized so the emitted weights sum to exactly 1. The kernel is symmetric with `out.length`
|
|
10
|
+
* set to `getGaussianKernelSize(sigma)` (an odd length), the center entry the largest. Because the
|
|
11
|
+
* kernel is truncated at radius `ceil(3 * sigma)`, the raw Gaussian samples are renormalized by
|
|
12
|
+
* their own truncated sum rather than the analytic 1/(sqrt(2π)·sigma) factor, so the discrete tail
|
|
13
|
+
* loss is absorbed and the taps a separable blur applies sum to 1. `sigma <= 0` yields a single
|
|
14
|
+
* unit weight (`[1]`), the identity kernel. Returns `out`.
|
|
15
|
+
*/
|
|
16
|
+
export function computeGaussianKernelWeights(sigma, out) {
|
|
17
|
+
const size = getGaussianKernelSize(sigma);
|
|
18
|
+
out.length = size;
|
|
19
|
+
if (size === 1) {
|
|
20
|
+
out[0] = 1;
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
const radius = (size - 1) / 2;
|
|
24
|
+
const twoSigmaSquared = 2 * sigma * sigma;
|
|
25
|
+
let sum = 0;
|
|
26
|
+
for (let i = 0; i < size; i++) {
|
|
27
|
+
const x = i - radius;
|
|
28
|
+
const weight = Math.exp(-(x * x) / twoSigmaSquared);
|
|
29
|
+
out[i] = weight;
|
|
30
|
+
sum += weight;
|
|
31
|
+
}
|
|
32
|
+
const inverseSum = 1 / sum;
|
|
33
|
+
for (let i = 0; i < size; i++) {
|
|
34
|
+
out[i] *= inverseSum;
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Returns the length of the discrete Gaussian kernel for standard deviation `sigma`: the odd count
|
|
40
|
+
* `radius * 2 + 1` where `radius = ceil(3 * sigma)`. Three standard deviations capture ~99.7% of the
|
|
41
|
+
* Gaussian mass, the conventional truncation point. `sigma <= 0` returns 1 (the identity kernel).
|
|
42
|
+
*/
|
|
43
|
+
export function getGaussianKernelSize(sigma) {
|
|
44
|
+
if (sigma <= 0)
|
|
45
|
+
return 1;
|
|
46
|
+
const radius = Math.ceil(3 * sigma);
|
|
47
|
+
return radius * 2 + 1;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=gaussianKernel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianKernel.js","sourceRoot":"","sources":["../src/gaussianKernel.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,EAAE;AACF,0FAA0F;AAC1F,gGAAgG;AAChG,4FAA4F;AAC5F,0EAA0E;AAE1E;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAa,EAAE,GAAa;IACvE,MAAM,IAAI,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC1C,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,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EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,GAAG,mBAAmB,CAEnH"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Gradient-bevel composite effect: a bevel whose highlight→shadow band color is looked up from a colors/alphas/ratios gradient ramp indexed by the encoded bevel depth.
|
|
2
|
+
export function createGradientBevelEffect(options) {
|
|
3
|
+
return { kind: 'GradientBevelEffect', ...options };
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=gradientBevelEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradientBevelEffect.js","sourceRoot":"","sources":["../src/gradientBevelEffect.ts"],"names":[],"mappings":"AAEA,wKAAwK;AACxK,MAAM,UAAU,yBAAyB,CAAC,OAAoD;IAC5F,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,OAAO,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradientGlowEffect.d.ts","sourceRoot":"","sources":["../src/gradientGlowEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,GAAG,kBAAkB,CAEhH"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Gradient-glow composite effect: an outer glow whose color is looked up from a colors/alphas/ratios gradient ramp indexed by the blurred silhouette alpha.
|
|
2
|
+
export function createGradientGlowEffect(options) {
|
|
3
|
+
return { kind: 'GradientGlowEffect', ...options };
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=gradientGlowEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradientGlowEffect.js","sourceRoot":"","sources":["../src/gradientGlowEffect.ts"],"names":[],"mappings":"AAEA,4JAA4J;AAC5J,MAAM,UAAU,wBAAwB,CAAC,OAAmD;IAC1F,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,OAAO,EAAE,CAAC;AACpD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
1
|
export * from './autoExposureEffect';
|
|
2
2
|
export * from './barrelDistortionEffect';
|
|
3
|
+
export * from './bevelEffect';
|
|
3
4
|
export * from './bloomEffect';
|
|
5
|
+
export * from './blurDownsample';
|
|
6
|
+
export * from './blurEffect';
|
|
4
7
|
export * from './bokehDepthOfFieldEffect';
|
|
5
|
-
export * from './
|
|
8
|
+
export * from './boxBlurMath';
|
|
6
9
|
export * from './cameraMotionBlurEffect';
|
|
7
|
-
export * from './channelMixerEffect';
|
|
8
10
|
export * from './chromaticAberrationEffect';
|
|
9
|
-
export * from './colorBlindSimulationEffect';
|
|
10
|
-
export * from './colorGradeEffect';
|
|
11
11
|
export * from './colorScienceMath';
|
|
12
12
|
export * from './colorTemperatureMath';
|
|
13
13
|
export * from './contactShadowsEffect';
|
|
14
|
+
export * from './convolutionEffect';
|
|
14
15
|
export * from './crtEffect';
|
|
15
16
|
export * from './customShaderEffect';
|
|
16
17
|
export * from './depthMath';
|
|
17
18
|
export * from './directionalBlurEffect';
|
|
18
19
|
export * from './displacementEffect';
|
|
20
|
+
export * from './dropShadowEffect';
|
|
19
21
|
export * from './ditherEffect';
|
|
20
22
|
export * from './edgeDetectMath';
|
|
21
|
-
export * from './exposureEffect';
|
|
22
23
|
export * from './filmEmulationEffect';
|
|
23
24
|
export * from './filmGrainEffect';
|
|
24
25
|
export * from './fxaaEffect';
|
|
26
|
+
export * from './gaussianKernel';
|
|
25
27
|
export * from './gaussianMath';
|
|
26
28
|
export * from './glitchEffect';
|
|
27
29
|
export * from './godRaysEffect';
|
|
28
30
|
export * from './godRaysMath';
|
|
29
|
-
export * from './
|
|
31
|
+
export * from './gradientBevelEffect';
|
|
32
|
+
export * from './gradientGlowEffect';
|
|
30
33
|
export * from './halftoneEffect';
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
34
|
+
export * from './innerGlowEffect';
|
|
35
|
+
export * from './innerShadowEffect';
|
|
33
36
|
export * from './kuwaharaEffect';
|
|
34
37
|
export * from './kuwaharaMath';
|
|
35
38
|
export * from './lensDirtEffect';
|
|
36
39
|
export * from './lensDistortionEffect';
|
|
37
40
|
export * from './lensFlareEffect';
|
|
38
|
-
export * from './
|
|
39
|
-
export * from './
|
|
40
|
-
export * from './lutMath';
|
|
41
|
+
export * from './linearSampledGaussian';
|
|
42
|
+
export * from './medianEffect';
|
|
41
43
|
export * from './motionBlurEffect';
|
|
44
|
+
export * from './outerGlowEffect';
|
|
42
45
|
export * from './outlineEffect';
|
|
43
46
|
export * from './panniniProjectionEffect';
|
|
44
47
|
export * from './pixelateEffect';
|
|
@@ -50,7 +53,6 @@ export * from './renderEffectInterpolation';
|
|
|
50
53
|
export * from './renderEffectValidation';
|
|
51
54
|
export * from './scanlinesEffect';
|
|
52
55
|
export * from './screenSpaceFogEffect';
|
|
53
|
-
export * from './sepiaEffect';
|
|
54
56
|
export * from './sharpenEffect';
|
|
55
57
|
export * from './sketchEffect';
|
|
56
58
|
export * from './smaaEffect';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B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B,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
1
|
export * from './autoExposureEffect';
|
|
2
2
|
export * from './barrelDistortionEffect';
|
|
3
|
+
export * from './bevelEffect';
|
|
3
4
|
export * from './bloomEffect';
|
|
5
|
+
export * from './blurDownsample';
|
|
6
|
+
export * from './blurEffect';
|
|
4
7
|
export * from './bokehDepthOfFieldEffect';
|
|
5
|
-
export * from './
|
|
8
|
+
export * from './boxBlurMath';
|
|
6
9
|
export * from './cameraMotionBlurEffect';
|
|
7
|
-
export * from './channelMixerEffect';
|
|
8
10
|
export * from './chromaticAberrationEffect';
|
|
9
|
-
export * from './colorBlindSimulationEffect';
|
|
10
|
-
export * from './colorGradeEffect';
|
|
11
11
|
export * from './colorScienceMath';
|
|
12
12
|
export * from './colorTemperatureMath';
|
|
13
13
|
export * from './contactShadowsEffect';
|
|
14
|
+
export * from './convolutionEffect';
|
|
14
15
|
export * from './crtEffect';
|
|
15
16
|
export * from './customShaderEffect';
|
|
16
17
|
export * from './depthMath';
|
|
17
18
|
export * from './directionalBlurEffect';
|
|
18
19
|
export * from './displacementEffect';
|
|
20
|
+
export * from './dropShadowEffect';
|
|
19
21
|
export * from './ditherEffect';
|
|
20
22
|
export * from './edgeDetectMath';
|
|
21
|
-
export * from './exposureEffect';
|
|
22
23
|
export * from './filmEmulationEffect';
|
|
23
24
|
export * from './filmGrainEffect';
|
|
24
25
|
export * from './fxaaEffect';
|
|
26
|
+
export * from './gaussianKernel';
|
|
25
27
|
export * from './gaussianMath';
|
|
26
28
|
export * from './glitchEffect';
|
|
27
29
|
export * from './godRaysEffect';
|
|
28
30
|
export * from './godRaysMath';
|
|
29
|
-
export * from './
|
|
31
|
+
export * from './gradientBevelEffect';
|
|
32
|
+
export * from './gradientGlowEffect';
|
|
30
33
|
export * from './halftoneEffect';
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
34
|
+
export * from './innerGlowEffect';
|
|
35
|
+
export * from './innerShadowEffect';
|
|
33
36
|
export * from './kuwaharaEffect';
|
|
34
37
|
export * from './kuwaharaMath';
|
|
35
38
|
export * from './lensDirtEffect';
|
|
36
39
|
export * from './lensDistortionEffect';
|
|
37
40
|
export * from './lensFlareEffect';
|
|
38
|
-
export * from './
|
|
39
|
-
export * from './
|
|
40
|
-
export * from './lutMath';
|
|
41
|
+
export * from './linearSampledGaussian';
|
|
42
|
+
export * from './medianEffect';
|
|
41
43
|
export * from './motionBlurEffect';
|
|
44
|
+
export * from './outerGlowEffect';
|
|
42
45
|
export * from './outlineEffect';
|
|
43
46
|
export * from './panniniProjectionEffect';
|
|
44
47
|
export * from './pixelateEffect';
|
|
@@ -50,7 +53,6 @@ export * from './renderEffectInterpolation';
|
|
|
50
53
|
export * from './renderEffectValidation';
|
|
51
54
|
export * from './scanlinesEffect';
|
|
52
55
|
export * from './screenSpaceFogEffect';
|
|
53
|
-
export * from './sepiaEffect';
|
|
54
56
|
export * from './sharpenEffect';
|
|
55
57
|
export * from './sketchEffect';
|
|
56
58
|
export * from './smaaEffect';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[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AAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"innerGlowEffect.d.ts","sourceRoot":"","sources":["../src/innerGlowEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAM,GAAG,eAAe,CAE5G"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Inner-glow composite effect: tint the inverted silhouette, blur inward, clip to the source alpha, then composite over the source.
|
|
2
|
+
export function createInnerGlowEffect(options = {}) {
|
|
3
|
+
return { kind: 'InnerGlowEffect', ...options };
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=innerGlowEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"innerGlowEffect.js","sourceRoot":"","sources":["../src/innerGlowEffect.ts"],"names":[],"mappings":"AAEA,oIAAoI;AACpI,MAAM,UAAU,qBAAqB,CAAC,UAAmD,EAAE;IACzF,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,OAAO,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"innerShadowEffect.d.ts","sourceRoot":"","sources":["../src/innerShadowEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAM,GAAG,iBAAiB,CAElH"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Inner-shadow composite effect: tint the inverted silhouette, blur, offset by angle/distance, clip to the source alpha, then composite over the source.
|
|
2
|
+
export function createInnerShadowEffect(options = {}) {
|
|
3
|
+
return { kind: 'InnerShadowEffect', ...options };
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=innerShadowEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"innerShadowEffect.js","sourceRoot":"","sources":["../src/innerShadowEffect.ts"],"names":[],"mappings":"AAEA,yJAAyJ;AACzJ,MAAM,UAAU,uBAAuB,CAAC,UAAqD,EAAE;IAC7F,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,OAAO,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Produces the bilinear-tap ("linear sampling") form of a Gaussian blur for standard deviation
|
|
3
|
+
* `sigma`, writing the combined weights into `outWeights` and their signed sample offsets (in texels,
|
|
4
|
+
* relative to the center) into `outOffsets`. Both arrays are truncated to
|
|
5
|
+
* `getLinearSampledGaussianTapCount(sigma)`.
|
|
6
|
+
*
|
|
7
|
+
* A separable Gaussian of `N` discrete texels can be sampled with `ceil(N / 2)` bilinear taps: each
|
|
8
|
+
* adjacent texel pair `(i, i+1)` is replaced by one sample whose weight is `w[i] + w[i+1]` taken at
|
|
9
|
+
* the weighted-midpoint offset `(pos[i]·w[i] + pos[i+1]·w[i+1]) / (w[i] + w[i+1])`. Reading that
|
|
10
|
+
* fractional position with hardware bilinear filtering reconstructs the pair's summed contribution
|
|
11
|
+
* in a single fetch, halving the tap count. `N` is always odd, so the final texel is emitted as a
|
|
12
|
+
* standalone unit-pair sample at its own integer offset. The combined weights sum to 1 because the
|
|
13
|
+
* source discrete weights do. Returns `outWeights`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function computeLinearSampledGaussian(sigma: number, outWeights: number[], outOffsets: number[]): number[];
|
|
16
|
+
/**
|
|
17
|
+
* Returns the number of bilinear taps the linear-sampling Gaussian uses for standard deviation
|
|
18
|
+
* `sigma`: `ceil(N / 2)` where `N = getGaussianKernelSize(sigma)`. Callers size their weight and
|
|
19
|
+
* offset arrays with this before calling `computeLinearSampledGaussian`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getLinearSampledGaussianTapCount(sigma: number): number;
|
|
22
|
+
//# sourceMappingURL=linearSampledGaussian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linearSampledGaussian.d.ts","sourceRoot":"","sources":["../src/linearSampledGaussian.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAsBhH;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtE"}
|