imagemerge

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptBaseDir

func OptBaseDir(dir string) func(*MergeImage)

OptBaseDir is an functional option to set the BaseDir field

func OptGridSize

func OptGridSize(sizeX, sizeY int) func(*MergeImage)

OptGridSize is an functional option to set the GridSize X & Y

func OptGridSizeFromNthImageSize

func OptGridSizeFromNthImageSize(n int) func(*MergeImage)

OptGridSizeFromNthImageSize is an functional option to set the GridSize from the nth image

Types

type Grid

type Grid struct {
	Image           image.Image
	ImageFilePath   string
	BackgroundColor color.Color
	OffsetX         int
	OffsetY         int
	Grids           []*Grid
	Filters         []imagefilter.FilterType
}

Grid holds the data for each grid

func (Grid) ApplyFilters

func (g Grid) ApplyFilters(img image.Image) image.Image

ApplyFilters applies the selected filters to the image.

type MergeImage

type MergeImage struct {
	Grids           []*Grid
	ImageCountDX    int
	ImageCountDY    int
	BaseDir         string
	FixedGridSizeX  int
	FixedGridSizeY  int
	GridSizeMode    gridSizeMode
	GridSizeFromNth int
}

MergeImage is the struct that is responsible for merging the given images

func New

func New(grids []*Grid, imageCountDX, imageCountDY int, opts ...func(*MergeImage)) *MergeImage

New returns a new *MergeImage instance

func (*MergeImage) Merge

func (m *MergeImage) Merge() (*image.RGBA, error)

Merge reads the contents of the given file paths, merges them according to given configuration

func (*MergeImage) ReadImageFile

func (m *MergeImage) ReadImageFile(path string) (image.Image, error)

Jump to

Keyboard shortcuts

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