ogimage

package module
v0.0.0-...-ce97471 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Position LogoPosition
	Padding  int
	Texts    []Text
}

type LogoPosition

type LogoPosition int
const (
	TopLeft LogoPosition = iota
	TopRight
	BottomLeft
	BottomRight
	Center
)

type OgImage

type OgImage struct {
	Template image.Image
}

func NewOgImage

func NewOgImage(templateData, logoData []byte) (*OgImage, error)

func (*OgImage) Generate

func (og *OgImage) Generate(config Config) ([]byte, error)

func (*OgImage) GenerateDefault

func (og *OgImage) GenerateDefault(title, subtitle Text, padding int) ([]byte, error)

type Text

type Text struct {
	Content  string
	FontData []byte
	FontFace font.Face
	FontSize float64
	Color    color.Color
	Point    image.Point
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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