func runHxl(cmd *hadfield.Command, args []string) { i, data := utils.ReadStdin() if hxlCols > 0 { hxlWidth = utils.SizeForCols(i, hxlCols).W } i = pixelate.Hxl(i, hxlWidth) utils.WriteStdout(i, data) }
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) }