sky

package
v0.0.0-...-a1867f6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blend

func Blend(targetImage lincolor.Image, skyImage lincolor.Image, skySize Size)

Blend merges the sky from the sky image into the target image.

Types

type Size

type Size struct {
	PureSkyHeight int
	BlendHeight   int
	// contains filtered or unexported fields
}

Size contains size information about the sky. All heights are expressed in pixels from the top row.

func FindSkyHeight

func FindSkyHeight(
	sourceImage image.Image,
	blendHeightFactor float64,
	expandFactor float64,
) Size

FindSkyHeight analyses the image to find the height of area with blank holes, and a suitable height for blending.

func NewSize

func NewSize(inputImageBounds image.Rectangle, skyHeight int, blendHeightFactor float64) Size

NewSize returns a Size with blend height factor accounted for.

func (*Size) DrawBounds

func (s *Size) DrawBounds(sourceImage draw.Image)

DrawBounds draws black lines to demark the pure sky and the blend area.

func (*Size) IsEmpty

func (s *Size) IsEmpty() bool

IsEmpty returns true iff the sky height is zero.

func (*Size) PureSkyBounds

func (s *Size) PureSkyBounds() image.Rectangle

PureSkyBounds returns the image rectangle covered by only the pure sky, no blend area.

func (*Size) TotalBounds

func (s *Size) TotalBounds() image.Rectangle

TotalBounds returns the image rectangle covered by the sky, including blend area.

func (*Size) TotalHeight

func (s *Size) TotalHeight() int

TotalHeight returns the total height of the sky (pure sky + blend area).

Jump to

Keyboard shortcuts

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