Documentation ¶
Index ¶
- func DefaultReader() func(mergeImage *MergeImage)
- func OptBaseDir(dir string) func(*MergeImage)
- func OptGridSize(sizeX, sizeY int) func(*MergeImage)
- func OptGridSizeFromNthImageSize(n int) func(*MergeImage)
- func WithReadFunc(fnc func(string) (image.Image, error)) func(mergeImage *MergeImage)
- type EngineOpt
- type Grid
- type MergeEngine
- type MergeImage
- type ReadFunc
- type WriterFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultReader ¶
func DefaultReader() func(mergeImage *MergeImage)
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
func WithReadFunc ¶
func WithReadFunc(fnc func(string) (image.Image, error)) func(mergeImage *MergeImage)
Types ¶
type EngineOpt ¶
type EngineOpt func(engine *MergeEngine)
func WithDefaultWriter ¶
func WithDefaultWriter() EngineOpt
func WithOutputPath ¶
func WithReader ¶
func WithWriter ¶
func WithWriter(writer WriterFunc) EngineOpt
type Grid ¶
type Grid struct { Image image.Image ImageFilePath string BackgroundColor color.Color OffsetX int OffsetY int Grids []*Grid }
Grid holds the data for each grid
type MergeEngine ¶
type MergeEngine struct { AssetPath string OutputPath string ResultPath string BackgroundImage string Layers []*Grid Merger *MergeImage WriteFunc WriterFunc }
func NewMergeEngine ¶
func NewMergeEngine(assetPath string, outputPath string, opts ...EngineOpt) *MergeEngine
func (*MergeEngine) AddLayer ¶
func (m *MergeEngine) AddLayer(imagePath string) *MergeEngine
func (*MergeEngine) Background ¶
func (m *MergeEngine) Background(imagePath string) *MergeEngine
func (*MergeEngine) FromLayers ¶
func (m *MergeEngine) FromLayers(imagePath ...string) *MergeEngine
func (*MergeEngine) Merge ¶
func (m *MergeEngine) Merge(output string) error
type MergeImage ¶
type MergeImage struct { Grids []*Grid ImageCountDX int ImageCountDY int BaseDir string FixedGridSizeX int FixedGridSizeY int GridSizeMode gridSizeMode GridSizeFromNth int ReadFunc ReadFunc }
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)
Click to show internal directories.
Click to hide internal directories.