any more optimisation I can do for this function?
问题 I have a simple box blur function in a graphics library (for JavaScript/canvas, using ImageData) I'm writing. I've done a few optimisations to avoid piles of redundant code such as looping through [0..3] for the channels instead of copying the code, and having each surrounding pixel implemented with a single, uncopied line of code, averaging values at the end. Those were optimisations to cut down on redundant lines of code. Are there any further optimisations I can do of that kind, or, better