blurhash

package
v0.0.0-...-5d153c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidComponents = errors.New("blurhash: must have between 1 and 9 components")

ErrInvalidComponents is returned when components passed to Encode are invalid.

View Source
var ErrInvalidHash = errors.New("blurhash: invalid hash")

ErrInvalidHash is returned when the library encounters a hash it can't recognise.

View Source
var ErrInvalidInput = errors.New("base83: invalid input")

Functions

func Components

func Components(hash string) (x, y int, err error)

Components returns the X and Y components of a blurhash.

func Decode

func Decode(hash string, width, height int, punch int) (image.Image, error)

Decode returns an NRGBA image of the given hash with the given size.

func DecodeDraw

func DecodeDraw(dst draw.Image, hash string, punch float64) error

DecodeDraw decodes the given hash into the given image.

func Encode

func Encode(xComponents, yComponents int, img image.Image) (hash string, err error)

Encode returns the blurhash for the given image.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL