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")
|
|
|
|
flag.Parse()
|
|
|
|
|
2022-04-24 14:24:54 +02:00
|
|
|
// get two random images and load them
|
2022-05-01 09:15:49 +02:00
|
|
|
img1 := loadImage(getRandomImage())
|
|
|
|
img2 := loadImage(getRandomImage())
|
2022-04-24 14:24:54 +02:00
|
|
|
|
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
|
|
|
|
pool.InitWorkerPool()
|
2022-04-24 14:24:54 +02:00
|
|
|
|
2022-04-26 13:51:49 +02:00
|
|
|
// main blending routine
|
2022-04-24 19:20:08 +02:00
|
|
|
pool.BlendImages(img1, img2)
|
2022-04-24 14:24:54 +02:00
|
|
|
}
|