utils

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 LinearTosRGB

func LinearTosRGB(val float64) int

LinearTosRGB converts the given value in linear RGB space into sRGB space

func ReadImgFile

func ReadImgFile(filePath string) (image.Image, error)

ReadPNGFile reads the PNG image file with the given path then encodes it into an instance of `image.Image`

func SRGBToLinear

func SRGBToLinear(val int) float64

SRGBToLinear converts the given value in sRGB space into linear RGB space

func SignPow

func SignPow(val, exp float64) float64

Types

type ErrEmptyFile

type ErrEmptyFile string

ErrEmptyFile occurs when a file which was opened by I/O is empty

func (ErrEmptyFile) Error

func (e ErrEmptyFile) Error() string

type ErrUnknownFileType

type ErrUnknownFileType string

ErrUnknownFileType occurs when the type of a specific file could not be detected

func (ErrUnknownFileType) Error

func (e ErrUnknownFileType) Error() string

type ErrUnsupportedFile

type ErrUnsupportedFile string

ErrUnsupportedFile occurs when a file other than PNG or JPG is read to do blurhash encode

func (ErrUnsupportedFile) Error

func (e ErrUnsupportedFile) Error() string

Jump to

Keyboard shortcuts

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