igfx

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFontLoadFailed  = errors.New("Failed to load Font")
	ErrFontParseFailed = errors.New("Failed to parse font")
	ErrFontFaceFailed  = errors.New("Failed to generate font face")
)
View Source
var (
	ErrImageLoadFailed        = errors.New("Failed to load image file")
	ErrImageDecodeFailed      = errors.New("Failed to decode image")
	ErrImageFormatUnsupported = errors.New("Image format is not supported")
	ErrImageFetchFailed       = errors.New("Failed to fetch image from URL")
)

Functions

func AddTextLabel

func AddTextLabel(img *image.RGBA, textFace font.Face, x, y int, label string)

func CardTemplate

func CardTemplate(templateImg image.Image, inputs ...interface{}) (image.Image, error)

func ResourceLoadFont

func ResourceLoadFont(location string, size float64) (font.Face, error)

func ResourceLoadImage

func ResourceLoadImage(location string) (image.Image, error)

func ResourceUrlLoadImage

func ResourceUrlLoadImage(url string) (image.Image, error)

func ScaleImageBilinear

func ScaleImageBilinear(img image.Image, newWidth, newHeight int) *image.RGBA

func ScaleImageNN

func ScaleImageNN(img image.Image, newWidth, newHeight int) *image.RGBA

Types

type ImageInput

type ImageInput struct {
	Image    image.Image
	Width    int
	Height   int
	XPadding int
	YPadding int
}

type TextInput

type TextInput struct {
	Text     string
	X        int
	Y        int
	TextFace font.Face
	Color    color.Color
}

Jump to

Keyboard shortcuts

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