logo

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Abbrev string `json:"abbrev"`
	Pt     *Pt    `json:"pt"`
	XSize  int    `json:"xSize"`
	YSize  int    `json:"ySize"`
	// FitImage determines if image scaling is based on bounds given
	// to render functions. Default of false uses the matrix bounds for scaling
	FitImage bool `json:"fit"`
}

Config ...

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

Logo is used to manage logo rendering

func New

func New(key string, getter SourceGetter, targetDirectory string, matrixBounds image.Rectangle, conf *Config) *Logo

New ...

func (*Logo) GetThumbnail

func (l *Logo) GetThumbnail(ctx context.Context, size image.Rectangle) (image.Image, error)

GetThumbnail returns the resized image

func (*Logo) Key

func (l *Logo) Key() string

Key returns the key name of the logo

func (*Logo) RenderLeftAligned

func (l *Logo) RenderLeftAligned(ctx context.Context, bounds image.Rectangle, endX int) (image.Image, error)

RenderLeftAligned renders the logo on the left side of the matrix

func (*Logo) RenderLeftAlignedWithStart

func (l *Logo) RenderLeftAlignedWithStart(ctx context.Context, bounds image.Rectangle, startX int) (image.Image, error)

RenderLeftAlignedWithStart renders the logo on the left side of the matrix with a starting X point

func (*Logo) RenderRightAligned

func (l *Logo) RenderRightAligned(ctx context.Context, bounds image.Rectangle, startX int) (image.Image, error)

RenderRightAligned renders the logo on the right side of the matrix

func (*Logo) RenderRightAlignedWithEnd

func (l *Logo) RenderRightAlignedWithEnd(ctx context.Context, bounds image.Rectangle, endX int) (image.Image, error)

RenderRightAlignedWithEnd renders the logo on the right side of the matrix

func (*Logo) SetLogger

func (l *Logo) SetLogger(logger *zap.Logger)

SetLogger ...

func (*Logo) ThumbnailFilename

func (l *Logo) ThumbnailFilename(size image.Rectangle) string

ThumbnailFilename returns the filname for the resized thumbnail to use

type Pt

type Pt struct {
	X    int     `json:"xShift"`
	Y    int     `json:"yShift"`
	Zoom float64 `json:"zoom"`
}

Pt defines the x, y shift and zoom values for a logo

type SourceGetter

type SourceGetter func(ctx context.Context) (image.Image, error)

SourceGetter is a func type that retrieves a source logo image.Image

Jump to

Keyboard shortcuts

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