Open danimoh opened 5 years ago
I just noticed, that a canOverwriteImage
value of false
is not correctly assigned by the current options merge strategy.
I opened https://github.com/cozmo/jsQR/pull/117 therefore, which would be a requirement for merging this PR.
Hi Cosmo. I noticed that in the binarizer new buffers are assigned for the grayscale image and binary image(s). However, these buffers can be assigned within the rgba image buffer, as this data is not needed anymore after conversion to grayscale / binarization. This saves allocation and garbage collection of up to 3 * pixelCount + blackPointsCount bytes. According to my tests, this makes the code 20%-30% faster.
(Sorry for the force-pushs. I couldn't run the tests locally and therefore had to rely on travis for testing.)