Closed jokoyoski closed 1 year ago
Hey, thanks for the PR! However, I'm not so sure these changes are necessary. I think the code before was fine. There is a lot of refactoring that needs to be done across the project, such as splitting up large methods in movie.ts. There are also some issues related to the blur effect (like #44). If you'd like to open another PR, I'd by happy to merge it.
In the refactored code:
The variable declarations (const) remain the same. The createImageData method is replaced with new ImageData constructor to create the imageData object. The pixel data manipulation is done directly on the imageData.data array. The pixelIndex calculation has been extracted for clarity. The ctx.putImageData method is kept as it is. These changes maintain the original functionality while providing some clarity and improving the code structure.