Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow scanning codes that are color inverted #420

Merged
merged 1 commit into from
Apr 19, 2023
Merged

Allow scanning codes that are color inverted #420

merged 1 commit into from
Apr 19, 2023

Conversation

jiapw
Copy link
Contributor

@jiapw jiapw commented Mar 8, 2021

I used inverted luminance for all even frames to handle the case that the code being scanned is color inverted. For production, that should be made as an option, sorry I didn't walk through the entire library to learn how to do it.

P.S. I duplicated the loop for converting pixels, because I think that hurts performance a bit if the odd-even branching is made for every pixel. Not sure of that, I am not a TS guy. :) This is the first time for me to write TS code.

@werthdavid
Copy link
Member

That's nice! Have you tested that?

@johnnyb
Copy link

johnnyb commented May 12, 2022

What is the status of this? This would be extremely helpful for my current project.

@werthdavid
Copy link
Member

Can somebody test this and confirm that it works correctly?

@werthdavid werthdavid merged commit fae1b33 into zxing-js:master Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants