Over at https://observablehq.com/@jobleonard/mario-klingemans-stackblur there is a modernized shift table. There are a few things useful to this repo:
- Correctness: the shift operator is corrected from
>> to >>> so integers stay okay until the intended 255 radius. And lots of | 0 to make sure.
- Simplicity:
- The shift table is removed in favor of a fixed 24-shift so values become more readable
- Since stacks only work one way, an array is used instead
- Fewer stray variables for cleaner code
- Modern JS