-
Notifications
You must be signed in to change notification settings - Fork 1.3k
displayio.Bitmap value_count max should be 65536 not 65535 #8426
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
Comments
I agree! would you be able to submit a pull request to fix this? |
It's been some time since I've built CircuitPython, but I can give it a shot. This should be against 8.2.x (git checkout 8.2.x) I guess? |
Yes please. That way it'll get into a stable release more quickly. (We periodically merge it back to main too.) |
Submitted PR #8434 to fix this issue. |
I think this issue is solved. ? |
Fixed by #8434. Because the PR was not on |
CircuitPython version
But in a colorspace like RGB565, all 65536 16-bit values are valid. As for user friendliness, all three of the examples in https://github.com/adafruit/Adafruit_CircuitPython_OV7670/blob/main/examples that use displayio.Bitmap supply 65536 as an argument.
The code in https://github.com/adafruit/circuitpython/blob/main/shared-bindings/displayio/Bitmap.c that calculates the bits (per pixel) from the value_count subtracts 1 from the value_count, so correctly yields 16 for 65536 as well as 65535.
Code/REPL
Behavior
Description
No response
Additional information
Changing the upper limit to 65536 in the definition of value_count in Bitmap.c (line 67 in the current github version) looks like it would resolve this issue.
The text was updated successfully, but these errors were encountered: