1
0

seed can be specified to reproduce output

This commit is contained in:
2022-05-02 20:29:22 +02:00
parent 67274a5699
commit 12dd4e7512
3 changed files with 12 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import (
"os"
"strconv"
"strings"
"time"
)
type Config struct {
@ -21,6 +22,7 @@ type Config struct {
Sepia bool
Amount int
Quiet bool
Seed int64
}
// loads configuration values from json file
@ -47,6 +49,9 @@ func (c *Config) SetOutputDimensions() {
}
func initConfigRegister() {
// default seed for the RNG
seed := time.Now().UnixNano()
// command line arguments
flag.StringVar(&ConfigRegister.Method, "blending", "darken", "Blending methods : darken, lighten, average, fuckyfun")
flag.StringVar(&ConfigRegister.OutputDir, "output", "./", "Output directory")
@ -56,7 +61,9 @@ func initConfigRegister() {
flag.BoolVar(&ConfigRegister.Grayscale, "grayscale", false, "Output image in shade of gray (around 50)")
flag.BoolVar(&ConfigRegister.Sepia, "sepia", false, "Output image with sepia tone")
flag.IntVar(&ConfigRegister.Amount, "amount", 2, "Number of images to blend together")
flag.Int64Var(&ConfigRegister.Seed, "seed", seed, "Number of images to blend together")
flag.BoolVar(&ConfigRegister.Quiet, "quiet", false, "No progress messages")
flag.Parse()
// set output's width and height