util

package
v0.0.0-...-c082557 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AspectRatio

func AspectRatio(img image.Image) image.Point

AspectRatio calculates the minimal aspect ratio of the given image

func ConvertTiles

func ConvertTiles(imageAspectRatio, tileAspectRatio image.Point, targetTileCount int) image.Point

func LogTime

func LogTime(s string) func()

LogTime creates a simple time logger

func MinTiles

func MinTiles(imageAspectRatio image.Point, tileAspectRatio image.Point) image.Point

Calculate the minimum number of tiles in each direction to go from the tile aspect ratio to the image aspect ratio

func NearestSaneAspectRatio

func NearestSaneAspectRatio(aspectRatio image.Point) image.Point

func ParseAspectRatioString

func ParseAspectRatioString(aspectRatio string) (image.Point, error)

func Paste

func Paste(dst, src *image.NRGBA, loc image.Point, blend float64) error

Paste the src image into the dst image at the given location on the dst image. returns an error if the src image would not fit

Types

type Limiter

type Limiter struct {
	// contains filtered or unexported fields
}

func NewLimiter

func NewLimiter(limit int) *Limiter

func (*Limiter) Close

func (l *Limiter) Close()

func (*Limiter) Go

func (l *Limiter) Go(f func())

Jump to

Keyboard shortcuts

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