imagegen

package
v0.0.0-...-08c3e5d Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	W     = 1080
	H     = 1920
	Ratio = 2
	//BarColor        = "#B4F8C8"
	//BackgroundColor = "#000000"
	IconColor       = "#FFF"
	BarColor        = "#FCA311"
	BackgroundColor = "#14213D"
	TitleFontSize   = 48
	BoldFontSize    = 20
	RegularFontSize = 14
)

Variables

This section is empty.

Functions

func AutoResizeImage

func AutoResizeImage(h uint, img image.Image) image.Image

func DownloadImageFromUrl

func DownloadImageFromUrl(name, folder, url string) (image.Image, error)

func FindBoxArtUrl

func FindBoxArtUrl(title string, isBoxArt bool, serperAPIKey string) (string, error)

func LoadFonts

func LoadFonts()

func ResizeAndCropImage

func ResizeAndCropImage(w, h uint, img image.Image) image.Image

func ResizeImage

func ResizeImage(w, h uint, img image.Image) image.Image

Types

type BarChartItem

type BarChartItem interface {
	GetTitle() string
	GetMetric() int
	RenderMetric() string
	RenderIcon(height uint) image.Image
}

type SaveableDrawing

type SaveableDrawing interface {
	SavePNG(path string) error
}

func RenderMostPlayedWrapped

func RenderMostPlayedWrapped(title string, data []BarChartItem, n int) SaveableDrawing

Jump to

Keyboard shortcuts

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