2022-04-24 14:24:54 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2022-04-26 13:51:49 +02:00
|
|
|
"flag"
|
2022-04-24 14:24:54 +02:00
|
|
|
_ "image/jpeg"
|
|
|
|
_ "image/png"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-04-26 13:51:49 +02:00
|
|
|
// command line arguments
|
|
|
|
flag.StringVar(&ConfigRegister.Method, "blending", "darken", "Blending methods : darken, lighten, fuckyfun")
|
|
|
|
flag.StringVar(&ConfigRegister.OutputDir, "output", "./", "Output directory")
|
2022-05-01 09:48:37 +02:00
|
|
|
flag.StringVar(&ConfigRegister.InputDir, "input", "/home/gator/Photos", "Input directory. Where to look the images from")
|
2022-05-01 09:36:52 +02:00
|
|
|
flag.StringVar(&ConfigRegister.BaseImage, "base-img", "", "Path to the base image to work with. Random image if not set")
|
2022-05-01 20:52:03 +02:00
|
|
|
flag.StringVar(&ConfigRegister.Dimensions, "dimensions", "1280x1024", "Out image dimensions. <width>x<height>")
|
2022-05-01 17:49:51 +02:00
|
|
|
flag.BoolVar(&ConfigRegister.Grayscale, "grayscale", false, "Output image in shade of gray (around 50)")
|
2022-05-01 20:52:03 +02:00
|
|
|
flag.IntVar(&ConfigRegister.Amount, "amount", 2, "Number of images to blend together")
|
2022-04-26 13:51:49 +02:00
|
|
|
flag.Parse()
|
|
|
|
|
2022-05-01 15:33:55 +02:00
|
|
|
// set output's width and height
|
|
|
|
ConfigRegister.SetOutputDimensions()
|
|
|
|
|
2022-04-26 13:51:49 +02:00
|
|
|
// pool of workers unionizing, ready to blend a new picture using the power of friendship
|
2022-04-24 19:20:08 +02:00
|
|
|
var pool blendWorkerPool
|
2022-04-24 14:24:54 +02:00
|
|
|
|
2022-04-26 13:51:49 +02:00
|
|
|
// main blending routine
|
2022-05-01 20:52:03 +02:00
|
|
|
pool.BlendImagesMain()
|
2022-04-24 14:24:54 +02:00
|
|
|
}
|