graphics

package
v0.0.0-...-eace32e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptBaseDir

func OptBaseDir(dir string) func(*MergedImage)

OptBaseDir is an functional option to set the BaseDir field

func OptGridSize

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

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

func OptGridSizeFromNthImageSize

func OptGridSizeFromNthImageSize(n int) func(*MergedImage)

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

Types

type Drawing

type Drawing struct {
	Version int
	Index   int
	Message string
	Data    string
}

Drawing represents pixels data

func MakeDrawing

func MakeDrawing() Drawing

MakeDrawing - Creates a transparent 1x1 drawing

type Grid

type Grid struct {
	Image           image.Image
	BackgroundColor color.Color
	OffsetX         int
	OffsetY         int
	Grids           []*Grid
}

Grid holds the data for each grid

type MergedImage

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

MergedImage is responsible for merging the given images

func NewMergedImage

func NewMergedImage(grids []*Grid, imageCountDX, imageCountDY int, opts ...func(*MergedImage)) *MergedImage

NewMergedImage returns a new *MergedImage instance

func (*MergedImage) Merge

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

Merge merges the images according to given configuration

Jump to

Keyboard shortcuts

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