image

package
v0.0.0-...-245a412 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageToWriter

func ImageToWriter(img image.Image, w io.Writer, format ImageFormat) error

func IsImage

func IsImage(filename string) bool

func ReaderToImage

func ReaderToImage(r io.Reader) (image.Image, error)

func ResizeImageToChan

func ResizeImageToChan(
	imageChan chan<- image.Image,
	semaphore semaphore.Semaphore,
	wg *sync.WaitGroup,
	originalImage image.Image,
	destinationImage ImageSize,
	algorithm Algorithm,
)

func ResizeMonitor

func ResizeMonitor(imageChan chan image.Image, wg *sync.WaitGroup)

Types

type Algorithm

type Algorithm string
const (
	BiLinear        Algorithm = "BiLinear"
	ApproxBiLinear  Algorithm = "ApproxBiLinear"
	CatmullRom      Algorithm = "CatmullRom"
	NearestNeighbor Algorithm = "NearestNeighbor"
)

type ImageFormat

type ImageFormat string
const (
	Jpeg ImageFormat = "jpeg"
	Png  ImageFormat = "png"
	Gif  ImageFormat = "gif"
	Webp ImageFormat = "webp"
)

func GetImageFormat

func GetImageFormat(filename string) ImageFormat

type ImageSize

type ImageSize struct {
	X int `yaml:"x"`
	Y int `yaml:"y"`
}

func (*ImageSize) GetScales

func (s *ImageSize) GetScales(originalImageBounds image.Rectangle) float64

Jump to

Keyboard shortcuts

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