Skip to content

OnDiskBitmap: add a pixel_shader property #4636

Closed
@jepler

Description

@jepler

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions