diff options
Diffstat (limited to 'third_party/blurhash/blurhash.cpp')
-rw-r--r-- | third_party/blurhash/blurhash.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/third_party/blurhash/blurhash.cpp b/third_party/blurhash/blurhash.cpp index 0ff6cb74..cd0a18a4 100644 --- a/third_party/blurhash/blurhash.cpp +++ b/third_party/blurhash/blurhash.cpp @@ -251,7 +251,7 @@ multiplyBasisFunction(Components components, int width, int height, unsigned cha namespace blurhash { Image -decode(std::string_view blurhash, size_t width, size_t height) +decode(std::string_view blurhash, size_t width, size_t height, size_t bytesPerPixel) { Image i{}; @@ -295,6 +295,9 @@ decode(std::string_view blurhash, size_t width, size_t height) i.image.push_back(static_cast<unsigned char>(linearToSrgb(c.r))); i.image.push_back(static_cast<unsigned char>(linearToSrgb(c.g))); i.image.push_back(static_cast<unsigned char>(linearToSrgb(c.b))); + + for (size_t p = 3; p < bytesPerPixel; p++) + i.image.push_back(255); } } |