Documentation ¶
Overview ¶
Package slicerdicer provides a very simple API to crop image objects and slice image objects into same-sized pieces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrPointOutOfBounds = errors.New("point is out of bounds") ErrDimensionOutOfBounds = errors.New("dimension is out of bounds") )
Functions ¶
func Crop ¶
Crop returns an image which is cropped by the given dimensions dx and dy starting at the point x and y.
Errors are returned when the given point and dimensions are out of the image bounds.
func Slice ¶
Slice takes an image and an ammount of slices per side. The passed image is then sliced into partsPerSide * partsPerSide pieces with the size of imgX / partsPerSide times imgY / partsPerSide. The resulting pieces are returned in a two-dimensional array of image instances arranged in the order of the original image.
Errors are returned if the calculated sizes are out of bounds of the passed image.
Types ¶
This section is empty.