pkg

package
v0.2.52 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScaleResize  = "resize"
	ScaleContain = "contain"
	ScaleCover   = "cover"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundType

type BackgroundType struct {
	Color string `json:"color" yaml:"color"`
}

type Config

type Config struct {
	Source     string          `json:"source" yaml:"source"`
	Scale      string          `json:"scale" yaml:"scale"`
	Background *BackgroundType `json:"background,omitempty" yaml:"background,omitempty"`
}

func ParseConfig

func ParseConfig(path string) (*Config, error)

func (*Config) GenerateImage

func (c *Config) GenerateImage(width, height int) (image.Image, error)

func (*Config) Validate

func (c *Config) Validate() error

type ImageGenerator

type ImageGenerator interface {
	GenerateImage(width, height int) (image.Image, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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