Skip to content

OnDiskBitmap: add a pixel_shader property #4636

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

Closed
jepler opened this issue Apr 19, 2021 · 0 comments · Fixed by #4823
Closed

OnDiskBitmap: add a pixel_shader property #4636

jepler opened this issue Apr 19, 2021 · 0 comments · Fixed by #4823

Comments

@jepler
Copy link

jepler commented Apr 19, 2021

Right now, OnDiskBitmap is a bit odd--it kind of has an internal palette or color converter depending on the format of the underlying bitmap file. This has led to bugs (#3834) and made it difficult to implement features we want (#4438).

For 7.0, I basically propose an incompatible change to OnDiskBitmap so that it gets a .pixel_shader property that is to be used with the bitmap. If the bitmap is paletted, it is a Palette otherwise it's a ColorConverter.

6.x Compatibility code can use something like

def get_pixel_shader(on_disk_bitmap):
    return getattr(on_disk_bitmap, 'pixel_shader', None) or ColorConverter()`

With this change, #4438 becomes "free".

This will make it necessary to support other RGB formats such as RGB565 by ColorConverter, which I've done in a work-in-progress (not yet pull-requested) branch.

@jepler jepler added this to the 7.0.0 milestone Apr 19, 2021
@jepler jepler changed the title OnDiskBitmap: make it use a ColorConverter object OnDiskBitmap: add a pixel_shader property May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants