-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
60 lines (54 loc) · 1.32 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
"context"
"os"
)
func init() {
// setup color gradient, add additional hex values as desired.
// transitions between each color value are done in 2048 steps, which makes the length of the color
// palette equal to 2048 * (numberOfColors)
colorPalette = generateColorPalette("#000764", "#206acb", "#edffff", "#ffaa00", "#0002000")
}
// windows ffmpeg command to create mp4 from pngs
// ffmpeg -framerate 30 -i img%04d.png -c:v libx264 -pix_fmt yuv420p out.mp4
func main() {
if len(os.Args) > 0 {
run()
return
}
workerCount := 4
endRange := .005
increment := 0.0001
cReal := 0.280
cImaginary := 0.01
imageWidth := 1600
imageHeight := 1600
zoom := 1.
moveX := 0.
moveY := 0.
constructor := WorkerPoolConstructor{
WorkerCount: workerCount,
endRange: endRange,
increment: increment,
InitialCondition: InitialCondition{
cReal: cReal,
cImaginary: cImaginary,
},
ImageProperties: ImageProperties{
imageHeight: imageHeight,
imageWidth: imageWidth,
},
CameraModifiers: CameraModifiers{
zoom: zoom,
moveX: moveX,
moveY: moveY,
},
}
ctx, cancel := context.WithCancel(context.Background())
ffmpegProcessor := ImageProcessor{
Input: make(chan ImageInput),
endCtx: cancel,
}
StartWorkers(constructor.CreateWorkerPool(&ffmpegProcessor))
<-ctx.Done()
}