StackBlur icon indicating copy to clipboard operation
StackBlur copied to clipboard

Use jobleonard improvements

Open Artoria2e5 opened this issue 5 years ago • 1 comments

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

Artoria2e5 avatar Apr 04 '20 02:04 Artoria2e5

In what way is the JS more modern? The source here is pretty modern.

Before accepting any non-obvious changes, I personally think we need some mocha + nyc testing, using some canvas or image testing library, to ensure current behavior is working as intended.

brettz9 avatar Apr 04 '20 03:04 brettz9