Lokathor/imagine

[bmp] Converting bitmasked data into RGBA8 should use SIMD

Closed this issue · 0 comments

BMP allows for data to be encoded in a "bitmasked" form where bitmasks define the location of channel data within a u16 or u32.
This leads to each channel (R/G/B/A) being treated separately through several math ops.
Since we have 4 channels all doing identical operations, this lends itself very naturally to using SIMD.

Of course, since BMP is not a popular format, the percentage of use cases that would see a benefit from this gain is perhaps quite small. Still, when there's time it wouldn't hurt.

Preferably this would be done once portable-simd is stabilized, because it's not worth keeping the crate nightly-only for.