Desktop client for Matrix using Qt and C++20.
Find a file
Nicolò Balzarotti e7d1113a2b
Update blurhash.cpp
Apply suggestion from github interface (will need to be squashed before merge)

Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>
2021-01-20 15:18:47 +01:00
subprojects Initial decoder 2020-03-01 01:59:56 +01:00
.clang-format Initial decoder 2020-03-01 01:59:56 +01:00
.gitignore Initial decoder 2020-03-01 01:59:56 +01:00
.gitmodules Initial decoder 2020-03-01 01:59:56 +01:00
blurhash.cpp Update blurhash.cpp 2021-01-20 15:18:47 +01:00
blurhash.hpp Allow different byte per pixel values 2020-09-03 21:12:16 +02:00
blurhash2bmp.cpp Add encoding 2020-03-01 13:42:22 +01:00
image2blurhash.cpp Add encoding 2020-03-01 13:42:22 +01:00
LICENSE Add encoding 2020-03-01 13:42:22 +01:00
meson.build meson: install pkgconfig and header files 2021-01-20 14:47:52 +01:00
README.md Add readme 2020-03-01 14:00:59 +01:00
stb_image.h Add encoding 2020-03-01 13:42:22 +01:00
stb_image_write.h Initial decoder 2020-03-01 01:59:56 +01:00

Blurhash encoder/decoder for C++

Simple encoder and decoder for blurhashes. In large parts inspired by the reference implementation.

Build Requirements

  • A C++17 compiler, specifically with support for parsing integers via std::from_chars and some other smaller features.
  • The meson build system, if you don't want to embed the library into your project.

Usage as a library

Just add blurhash.h and blurhash.cpp to your project. Use blurhash::encode for encoding and blurhash::decode for decoding.

Usage from the command line

After building, run blurhash for creating a hash and blurhash2bmp for decoding a hash. You need to specify the intended components for encoding and the intended dimensions and file name for decoding.

Attributions

Projects that made this project possible:

  • The blurhash project for creating and documenting the algorithm and reference implementations.
  • The stb project for creating the image encoder and decoder used in the command line tools.
  • Doctest for providing the easy to use testing framework.