Last active
November 11, 2018 13:42
-
-
Save mamaz/f881645e5bff55b9158960e5d947e81c to your computer and use it in GitHub Desktop.
Running Resize Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
resizeParallel "Exercise/ResizeImage/ResizeParallel" | |
resizeSequential "Exercise/ResizeImage/ResizeSequential" | |
"Exercise/ResizeImage/lib/types" | |
"flag" | |
"fmt" | |
) | |
func main() { | |
var inputFileName string | |
var maxprocs *int | |
flag.StringVar(&inputFileName, "input", "", "input filename") | |
maxprocs = flag.Int("maxprocs", -1, "maxprocs") | |
flag.Parse() | |
sizes := []types.Size{ | |
types.Size{Width: 1280, Height: 800}, | |
types.Size{Width: 1024, Height: 768}, | |
types.Size{Width: 800, Height: 600}, | |
} | |
fmt.Println("Input file name: ", inputFileName) | |
fmt.Println("Sizes: ", sizes) | |
fmt.Println("Maxprocs: ", *maxprocs) | |
if *maxprocs == -1 { | |
resizeSequential.ResizeSequential(inputFileName, sizes) | |
} else { | |
resizeParallel.ResizeParallel(inputFileName, sizes, *maxprocs) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment