render

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawTimeOnImage

func DrawTimeOnImage(img image.Image, fontConfig FontConfig) image.Image

Types

type FontConfig

type FontConfig struct {
	FontPath   string
	Size       float64
	DPI        float64
	Color      color.Color
	Style      FontStyle
	MinOpacity float64
	MaxOpacity float64
	Position   FontPositionConfig
	TimeFormat string // Added to make time format configurable
}

type FontPositionConfig

type FontPositionConfig struct {
	HorizontalAlignment    HorizontalAlignment
	VerticalAlignment      VerticalAlignment
	PaddingTop             int
	PaddingBottom          int
	PaddingLeft            int
	PaddingRight           int
	VerticalCenterOffset   int
	HorizontalCenterOffset int
}

type FontStyle

type FontStyle int
const (
	Regular FontStyle = iota
	Italic
	Bold
)

type HorizontalAlignment

type HorizontalAlignment int
const (
	AlignCenter HorizontalAlignment = iota
	AlignLeft
	AlignRight
)

type VerticalAlignment

type VerticalAlignment int
const (
	AlignMiddle VerticalAlignment = iota
	AlignTop
	AlignBottom
)

Jump to

Keyboard shortcuts

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