https://github.com/geopjr/blurhash-glib
[MIRROR] A GLib-based blurhash implementation partially ported from fast-blurhash including further optimizations.
https://github.com/geopjr/blurhash-glib
Last synced: 3 months ago
JSON representation
[MIRROR] A GLib-based blurhash implementation partially ported from fast-blurhash including further optimizations.
- Host: GitHub
- URL: https://github.com/geopjr/blurhash-glib
- Owner: GeopJr
- License: bsd-2-clause
- Created: 2024-01-20T04:24:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-21T00:00:13.000Z (over 2 years ago)
- Last Synced: 2025-01-23T01:25:45.843Z (over 1 year ago)
- Language: Vala
- Homepage: https://gitlab.gnome.org/GeopJr/blurhash-glib
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# blurhash-glib
A GLib-based [blurhash](https://github.com/woltapp/blurhash) implementation partially ported from [fast-blurhash](https://github.com/mad-gooze/fast-blurhash) including further optimizations.
# Usage
```vala
public static Gdk.Pixbuf? blurhash_to_pixbuf (string blurhash, int width, int height) {
uint8[]? data = Blurhash.decode_to_data (blurhash, width, height);
if (data == null) return null;
return new Gdk.Pixbuf.from_data (
data,
Gdk.Colorspace.RGB,
true,
8,
width,
height,
4 * height
);
}
```
# Building
```sh
$ meson setup builddir .
$ meson compile -C builddir
$ meson test -C builddir
$ meson install -C builddir
```
# Contributing
1. Read the [Code of Conduct](./CODE_OF_CONDUCT.md)
1. Fork it ( https://gitlab.gnome.org/GeopJr/blurhash-glib/-/forks/new )
1. Create your feature branch (git checkout -b my-new-feature)
1. Commit your changes (git commit -am 'Add some feature')
1. Push to the branch (git push origin my-new-feature)
1. Create a new Pull Request