Example #1
0
File: vxl.go Project: hawx/img
func runVxl(cmd *hadfield.Command, args []string) {
	i, data := utils.ReadStdin()

	if vxlRows > 0 {
		vxlHeight = utils.SizeForRows(i, vxlRows).H
	}

	i = pixelate.Vxl(i, vxlHeight, vxlFlip, vxlTop, vxlLeft, vxlRight)
	utils.WriteStdout(i, data)
}
Example #2
0
File: pixelate.go Project: hawx/img
func runPixelate(cmd *hadfield.Command, args []string) {
	i, data := utils.ReadStdin()

	// Default
	style := pixelate.FITTED

	if pixelateCrop {
		style = pixelate.CROPPED
	}

	if pixelateRows > 0 && pixelateCols > 0 {
		pixelateSize = utils.SizeForRowsAndCols(i, pixelateRows, pixelateCols)
	} else if pixelateRows > 0 {
		pixelateSize = utils.SizeForRows(i, pixelateRows)
	} else if pixelateCols > 0 {
		pixelateSize = utils.SizeForCols(i, pixelateCols)
	}

	i = pixelate.Pixelate(i, pixelateSize, style)
	utils.WriteStdout(i, data)
}