igfx

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScaleNearestNeighbor = iota
	ScaleBilinear
)

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 LoadFontLocal added in v1.3.0

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

func LoadImgLocal added in v1.3.0

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

func LoadImgURL added in v1.3.0

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

Types

type GfxDesign added in v1.3.0

type GfxDesign struct {
	Image image.Image
}

func InitializeFromImage added in v1.3.0

func InitializeFromImage(img image.Image) *GfxDesign

func (*GfxDesign) CreateCardByTemplate added in v1.3.0

func (gfx *GfxDesign) CreateCardByTemplate(inputs ...interface{}) (image.Image, error)

func (*GfxDesign) DrawImage added in v1.3.0

func (gfx *GfxDesign) DrawImage(img image.Image, scaleMethod uint8, w, h, x, y int)

func (*GfxDesign) DrawText added in v1.3.0

func (gfx *GfxDesign) DrawText(fontFace font.Face, fontColor color.Color, x, y int, text string) error

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