generate

package
v0.0.0-...-9510e77 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InputImage holds the path to the background image
	InputImage = "./background.jpg"
	// Output Path for the generated image
	OutputImage = "./social-media-banner.png"
	// default text (domain name)
	DefaultText = "https://www.rockyourcode.com"
	// Title
	Title = "Programmatically generate social media images in Go"
)

Variables

This section is empty.

Functions

func CLI

func CLI(args []string) int

CLI runs the generate command line app and returns its exit status.

Types

type AppEnv

type AppEnv struct {
	// contains filtered or unexported fields
}

AppEnv holds the local context for the application.

func (*AppEnv) AddDefaultText

func (app *AppEnv) AddDefaultText(text string) error

Add default text (domain name)

func (*AppEnv) AddTitle

func (app *AppEnv) AddTitle(title string) error

Add title

func (*AppEnv) LoadFontFace

func (app *AppEnv) LoadFontFace(fontBytes []byte, points float64) error

LoadFontFace loads the specified font into the draw context.

func (*AppEnv) LoadImage

func (app *AppEnv) LoadImage(inputImage string) (image.Image, error)

Load image file from disk

func (*AppEnv) RenderImage

func (app *AppEnv) RenderImage(img image.Image)

Render image with semi-transparent overlay

func (*AppEnv) SaveImage

func (app *AppEnv) SaveImage(outputFileName string) error

Save the image

Jump to

Keyboard shortcuts

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