示例#1
0
文件: vxl.go 项目: 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)
}
示例#2
0
文件: pixelate.go 项目: 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)
}