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

Improve memory overhead in PixelsIter #6

Open
rfuest opened this issue Jan 14, 2022 · 0 comments
Open

Improve memory overhead in PixelsIter #6

rfuest opened this issue Jan 14, 2022 · 0 comments

Comments

@rfuest
Copy link
Member

rfuest commented Jan 14, 2022

PixelsIter stores the previous color values as an array of Rgb888, which uses 4 bytes per pixel. The memory overhead could be reduced by using an u8 array instead.

Using an byte array, where the elements are not aligned to 4 byte boundaries, could cause performance degradation so it might be useful to add a cargo feature to choose between better performance or lower memory consumption.

And the alpha values shouldn't be stored if the image isn't RGBA and a byte array is used. For an array of u32 pixel values (like Rgb888 uses) there would be no additional overhead in storing the alpha values, because the high byte is currently unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant