Skip to content

Improve memory overhead in PixelsIter #6

@rfuest

Description

@rfuest

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions