blurhash icon indicating copy to clipboard operation
blurhash copied to clipboard

Support for RGBA in encode

Open drxddy opened this issue 11 months ago • 0 comments

This may not be your priority, since the last commit that modified C dir was 2 years ago, this pr is adding support for encoding 4-channel RGBA byte arrays for uint8_t *rgb param in the blurHashForPixels function.

modifies multiplyBasisFunction function to infer number of channels from bytesPerRow & width params instead of just 3 channels.

this will not affect performance or public API, it just extends with the support for RGBA pixel values, assuming the user sets bytesPerRow accordingly.

for existing users, assuming they used the correct bytesPerRow, it will continue to behave like before, as the channels gets equal to 3 as before.

drxddy avatar Mar 22 '24 02:03 drxddy