Skip to content

Commit

Permalink
batch seems to be working
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimbbp committed Mar 11, 2024
1 parent 8efca74 commit b3e247d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func main() {
false,
)
case "batchRes":
batchResIndices := []int{0, 4, 9}
batchResIndices := []int{0, 2, 6}
util.TimeIt(
"generating video for multiple resolutions",
video.BatchSequence,
Expand Down
4 changes: 3 additions & 1 deletion src/util/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const DatabasePath = DatabaseFolderPath + "/sprite_color_db"

const SpriteInput = AssetBasePath + "/sprites_512"
const SpriteSizes = OutputBasePath + "/sprite_mgmt"
const ImageOutput = OutputBasePath + "/image_output"
const ImageOutputConst = OutputBasePath + "/image_output"

var ImageOutput = OutputBasePath + "/image_output"

const SequencePath = TestFootageBasePath + "/scuba" //change this to your own 1280x720 .png sequence

Expand Down
16 changes: 10 additions & 6 deletions src/video/batchResSequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@ package video

import (
"fmt"
"strconv"

"github.com/joachimbbp/spritefire/src/util"
)

func BatchSequence(sequencePath string, spriteColorDbPath string, spriteResIndices []int) {
fmt.Printf("not implemented yet, batchSequence")

fmt.Println(sequencePath, spriteColorDbPath, spriteResIndices)

for _, resIndex := range spriteResIndices {
fmt.Println("resolution: ")
fmt.Println((util.SpriteSizes[resIndex]))
fmt.Println(resIndex, "\n")

res := strconv.Itoa(int(util.ResizeResolutions[resIndex]))
util.ImageOutput = util.ImageOutputConst + "/" + res
util.CreateIfNotExist(util.ImageOutput)

fmt.Println("index: ")
fmt.Println(resIndex)
fmt.Println("\noutput: ", util.ImageOutput)

//Sequence(sequencePath, spriteColorDbPath, resIndex, true)
Sequence(sequencePath, spriteColorDbPath, resIndex)
}
util.ImageOutput = util.ImageOutputConst
}
8 changes: 2 additions & 6 deletions src/video/sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ import (
"github.com/joachimbbp/spritefire/src/util"
)

func Sequence(sequencePath string, spriteColorDbPath string, spriteSizeIndex int, batch bool) {
prefix := ""
spriteSize := util.SpriteSizes[spriteSizeIndex]
if batch {
prefix = strconv.Itoa(int(spriteSize)) + "_"
}
func Sequence(sequencePath string, spriteColorDbPath string, spriteSizeIndex int) {
prefix := strconv.Itoa((util.ResizeResolutions[spriteSizeIndex])) + "_"

frames, err := os.ReadDir(sequencePath)
if err != nil {
Expand Down

0 comments on commit b3e247d

Please sign in to comment.