2 Commits

Author SHA1 Message Date
2e8ccce703 fix: video visualizer 2023-08-28 11:57:40 +02:00
77843db6de fixed assets 2023-08-27 19:58:22 +02:00
5 changed files with 10 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 6.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 MiB

After

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 9.7 MiB

View File

@ -8,7 +8,6 @@ import (
"os" "os"
"os/exec" "os/exec"
"path" "path"
"sync"
"github.com/mazznoer/colorgrad" "github.com/mazznoer/colorgrad"
) )
@ -35,26 +34,20 @@ func (v *VideoVisualizer) Visualize(solved_chan <-chan *maze.SolvedMaze) {
if err != nil { if err != nil {
panic(err) panic(err)
} }
var wg sync.WaitGroup
i := 0 i := 0
for solved := range solved_chan { for solved := range solved_chan {
wg.Add(1) img_writer := writer.ImageWriter{
go func() { Filename: path.Join(tmp_dir, fmt.Sprintf("%07v.png", i)),
img_writer := writer.ImageWriter{ Maze: solved,
Filename: path.Join(tmp_dir, fmt.Sprintf("%07v.png", i)), CellWidth: 5,
Maze: solved, CellHeight: 5,
CellWidth: 5, WallColor: color.Black,
CellHeight: 5, PathColor: color.White,
WallColor: color.Black, SolutionGradient: colorgrad.Warm(),
PathColor: color.White, }
SolutionGradient: colorgrad.Warm(), img_writer.Write()
}
img_writer.Write()
wg.Done()
}()
i++ i++
} }
wg.Wait()
cmd := exec.Command( cmd := exec.Command(
v.ffmpeg_cmd, v.ffmpeg_cmd,
"-y", "-y",