core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWallpaper

func GetWallpaper() (string, error)

GetWallpaper returns the path to the current wallpaper.

func SetWallpaper

func SetWallpaper(path string) error

SetWallpaper sets the wallpaper from the given path.

func SkipOAT

func SkipOAT(t testing.TB)

SkipOAT skips the test if TEST_OAT is not set to true

Types

type Image

type Image struct {
	image.Image
	Description string
	SearchURL   string
	DownloadURL string
}

Image is a wrapper around the image.Image interface.

func DownloadAndDecode

func DownloadAndDecode(day types.Day, region types.Region, resolution types.Resolution) (*Image, error)

DownloadAndDecode fetches the Bing wallpaper and decodes it.

func SetupTestImage

func SetupTestImage() *Image

setupTestImage returns a test image

func (*Image) DrawDescription

func (img *Image) DrawDescription(position types.Position, fontName string) error

DrawDescription draws a title onto the given image.

func (*Image) DrawQRCode

func (img *Image) DrawQRCode(resolution types.Resolution, position types.Position) error

DrawQRCode draws a QR code onto the given image.

func (*Image) DrawWatermark

func (img *Image) DrawWatermark(watermarkFile string, rotateCounterClockwise bool) error

DrawWatermark draws a watermark onto the given image.

func (*Image) EncodeAndDump

func (img *Image) EncodeAndDump(targetDir string) (string, error)

EncodeAndDump encodes the image and dumps it to the target directory.

func (*Image) Equals

func (i *Image) Equals(other *Image) bool

Equals returns true if the given image is equal to the receiver.

Jump to

Keyboard shortcuts

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