blurhash

package
v0.0.0-...-9115d3a Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Components

func Components(blurhash string) (numX, numY int, err error)

Components decodes and returns the x/y component of the given hash string

func Decode

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

Decode decodes the given hash string into the blur image. `punch` argument is the factor indicating how much the contrast is.

func Encode

func Encode(xComps, yComps int, rgba image.Image) (string, error)

Types

type ErrInvalidComps

type ErrInvalidComps int

ErrInvalidComps occurs when the x-component or y-component is not in the range of 1 and 9 exclusively

func (ErrInvalidComps) Error

func (e ErrInvalidComps) Error() string

type ErrInvalidHashLength

type ErrInvalidHashLength int

ErrInvalidHashLength occurs when the length of blurhash is less than 6 or not equal (4 + 2 * numX * numY), where numX and numY are the number of x/y-compoments respectively

func (ErrInvalidHashLength) Error

func (e ErrInvalidHashLength) Error() string

Jump to

Keyboard shortcuts

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