(n: number)
| 102 | * the newest frame solid, so the composite of real painted frames reads as a |
| 103 | * motion trail leading to the final pose. One alpha in [0,1] per sample. */ |
| 104 | export function ghostAlphas(n: number): number[] { |
| 105 | if (n <= 0) return []; |
| 106 | if (n === 1) return [1]; |
| 107 | const lo = 0.14; |
| 108 | return Array.from( |
| 109 | { length: n }, |
| 110 | (_, i) => Math.round((lo + (1 - lo) * (i / (n - 1))) * 1000) / 1000, |
| 111 | ); |
| 112 | } |
| 113 | |
| 114 | /** Scale+centre transform that fits `pts` into a W×H frame (with padding). */ |
| 115 | export function fitTransform( |
no test coverage detected