drawer

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoverColors

type CoverColors struct {
	Main   color.Color
	Box    color.Color
	Text   color.Color
	Shadow color.Color
}

func NewCoverColors

func NewCoverColors(im image.Image) CoverColors

type Draw

type Draw struct {
	DrawOptions

	Colors CoverColors
	// contains filtered or unexported fields
}

func NewDraw

func NewDraw(opts DrawOptions) (*Draw, error)

func (*Draw) Draw

func (d *Draw) Draw(ctx context.Context, source fetcher.Result) error

func (*Draw) DrawBase

func (d *Draw) DrawBase(ctx context.Context, source fetcher.Result) error

func (*Draw) DrawOver

func (d *Draw) DrawOver(ctx context.Context, source fetcher.Result) error

func (*Draw) Reset

func (d *Draw) Reset()

func (*Draw) SetBackground

func (d *Draw) SetBackground(_ context.Context, _ fetcher.Result) error

func (*Draw) SetImage

func (d *Draw) SetImage(ctx context.Context, source fetcher.Result) error

func (*Draw) SetText

func (d *Draw) SetText(_ context.Context, source fetcher.Result) error

func (*Draw) Write

func (d *Draw) Write(target io.Writer) error

type DrawOptions

type DrawOptions struct {
	Footer Footer
	Width  int
	Height int
}

type DrawPipe

type DrawPipe func(ctx context.Context, source fetcher.Result) error

type Fonts

type Fonts struct {
	Title       *truetype.Font
	Footer      *truetype.Font
	Description *truetype.Font
}
type Footer struct {
	Image string `fig:"image" json:"image" yaml:"image"`
	Text  string `fig:"text"  json:"text"  yaml:"text"`
}

Jump to

Keyboard shortcuts

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