xwallpaper

package
v0.0.0-...-523ce56 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(dst draw.Image, src image.Image, trim image.Rectangle, mode Mode, filter draw.Transformer)

Draw transforms src using mode with trim as the area of interest, drawing it onto dst using the provided filter.

If trim is the zero rectangle, it is set to the bounds of src.

func DrawRez

func DrawRez(dst draw.Image, src image.Image, trim image.Rectangle, mode Mode, filter rez.Filter)

DrawRez is like Draw, but uses a rez.Filter for better performance.

Types

type Mode

type Mode int

Mode specifies an algorithm for cropping, panning, and scaling the image.

const (
	// Tile crops the image to the area of interest then repeats it to cover the
	// output starting from the top-left corner of the screen.
	Tile Mode = iota

	// Center crops the image to the area of interest then centers it on the
	// output. If it is larger than the output, parts of it will be cut off.
	Center

	// Stretch crops the image to the area of interest then stretches it to
	// cover the output, ignoring the aspect ratio.
	Stretch

	// Zoom crops the image to the area of interest then zooms the image in or
	// out until the shortest dimension matches the output. If the aspect ratio
	// doesn't match the output, parts of it will be cut off.
	Zoom

	// Maximize crops the image to the area of interest then zooms the image in
	// or out as necessary to ensure the entire image is visible, centering it
	// if it is smaller.
	Maximize

	// Focus zooms the image out to ensure the entire area of interest is
	// visible, then zooms in if necessary to eliminate black areas. Unlike
	// [Maximize], the parts of the image outside of the area of interest are
	// not cropped.
	Focus
)

func (Mode) String

func (m Mode) String() string

Jump to

Keyboard shortcuts

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