Nheko-Reborn / blurhash

C++ blurhash encoder/decoder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blurhash encoder/decoder for C++

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

Build Requirements

  • A C++20 compiler, specifically with support for parsing integers via std::from_chars, std::numbers::pi_v 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.

About

C++ blurhash encoder/decoder

License:Boost Software License 1.0


Languages

Language:C 76.1%Language:C++ 23.4%Language:Meson 0.4%